From 3466eed4d599ae7e1e54e4fa1cdc1f3fac46bf8b Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Mon, 25 Oct 2021 19:34:27 +0000 Subject: [PATCH] Documentation for 779e2f073e30694c6448e8f988e54e3ae007caf4 --- annotated.html | 104 +- annotated_dup.js | 45 +- classes.html | 71 +- d0/d04/qr__decompose_8h__incl.map | 2 +- d0/d04/qr__decompose_8h__incl.svg | 6 +- d0/d10/struct_queue_rep.html | 41 +- d0/d10/struct_queue_rep.js | 6 - d0/d1f/structnode__coll__graph.map | 2 +- d0/d1f/structnode__coll__graph.svg | 32 +- d0/d3d/insertion__sort_8c__incl.map | 2 +- d0/d3d/insertion__sort_8c__incl.svg | 4 +- d0/d3d/problem__8_2sol2_8c__incl.map | 2 +- d0/d3d/problem__8_2sol2_8c__incl.svg | 6 +- d0/d43/structpid.html | 57 +- d0/d43/structpid.js | 8 - d0/d46/kohonen__som__trace_8c.html | 546 +++--- ...283886819c7c140a023582b7269e2d0_cgraph.map | 12 +- ...283886819c7c140a023582b7269e2d0_cgraph.svg | 150 +- ...86819c7c140a023582b7269e2d0_cgraph_org.svg | 118 ++ ...07f00650b8041f77767927073ddddb8_cgraph.map | 2 +- ...07f00650b8041f77767927073ddddb8_cgraph.svg | 16 +- ...440a7779ac56f47a3f355ce4a8c7da0_cgraph.map | 12 +- ...440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg | 150 +- ...7779ac56f47a3f355ce4a8c7da0_cgraph_org.svg | 118 ++ ...c04138a5bfe5d72780bb7e82a18e627_cgraph.map | 15 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 | 1 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.svg | 344 ++++ ...38a5bfe5d72780bb7e82a18e627_cgraph_org.svg | 256 +++ ...1ae16442e3e5b891a58d2e5932a2cd0_cgraph.map | 2 +- ...1ae16442e3e5b891a58d2e5932a2cd0_cgraph.svg | 16 +- ...d0455dd5c30adda100e95f0423c786e_cgraph.map | 12 +- ...d0455dd5c30adda100e95f0423c786e_cgraph.svg | 150 +- ...5dd5c30adda100e95f0423c786e_cgraph_org.svg | 118 ++ ...2246f940155472084ee461f3685d614_cgraph.map | 2 +- ...2246f940155472084ee461f3685d614_cgraph.svg | 16 +- d0/d4d/problem__5_2sol1_8c__incl.map | 6 +- d0/d4d/problem__5_2sol1_8c__incl.svg | 28 +- d0/d57/hash__xor8_8c.html | 78 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 5 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 52 + d0/d59/problem__9_2sol2_8c__incl.map | 6 +- d0/d59/problem__9_2sol2_8c__incl.svg | 28 +- d0/d6b/structelem.html | 37 +- d0/d6b/structelem.js | 5 - d0/d6c/problem__4_2sol_8c.html | 110 +- ...40291bc02cba5474a4cb46a9b9566fe_cgraph.map | 4 + ...40291bc02cba5474a4cb46a9b9566fe_cgraph.md5 | 1 + ...40291bc02cba5474a4cb46a9b9566fe_cgraph.svg | 37 + d0/d6d/problem__10_2sol1_8c.html | 167 +- ...ddf1224851353fc92bfbff6f499fa97_cgraph.map | 5 + ...ddf1224851353fc92bfbff6f499fa97_cgraph.md5 | 1 + ...ddf1224851353fc92bfbff6f499fa97_cgraph.svg | 52 + ...3d987cb2ad0ddb0c3caa4c2506a20e5_cgraph.map | 4 + ...3d987cb2ad0ddb0c3caa4c2506a20e5_cgraph.md5 | 1 + ...3d987cb2ad0ddb0c3caa4c2506a20e5_cgraph.svg | 37 + d0/d7f/so1_8c.html | 91 +- d0/d8a/octal__to__hexadecimal_8c.html | 147 +- d0/d8a/octal__to__hexadecimal_8c.js | 2 +- ...3ef5170955cfef40e07d9a4d2e87e2_cgraph.map} | 4 +- ...3ef5170955cfef40e07d9a4d2e87e2_cgraph.md5} | 0 ...3ef5170955cfef40e07d9a4d2e87e2_cgraph.svg} | 20 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 4 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.md5 | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 26 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 4 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 30 +- d0/d8a/structmax__heap.html | 47 +- d0/d8a/structmax__heap.js | 6 - d0/d91/binary__search_8c__incl.map | 6 +- d0/d91/binary__search_8c__incl.svg | 28 +- d0/d99/c__atoi__str__to__integer_8c__incl.map | 2 +- d0/d99/c__atoi__str__to__integer_8c__incl.svg | 6 +- d0/db8/collatz_8c__incl.map | 2 +- d0/db8/collatz_8c__incl.svg | 4 +- d0/dc7/geometry__datatypes_8h.html | 51 +- d0/dc7/geometry__datatypes_8h_source.html | 261 ++- d0/dcb/group__kohonen__1d.html | 259 ++- d0/dcb/group__kohonen__1d.map | 4 +- d0/dcb/group__kohonen__1d.svg | 22 +- ...334493a0917a24736fe5ba82aa6f81f_cgraph.map | 4 +- ...334493a0917a24736fe5ba82aa6f81f_cgraph.svg | 20 +- ...aeffbff2be4d5d15b0d4f10f846abde_cgraph.map | 6 +- ...aeffbff2be4d5d15b0d4f10f846abde_cgraph.svg | 28 +- d0/dcb/poly__add_8c.html | 519 +++-- ...c5173884bd798a6ca6f437b9b932409_cgraph.map | 8 +- ...c5173884bd798a6ca6f437b9b932409_cgraph.svg | 40 +- ...40291bc02cba5474a4cb46a9b9566fe_cgraph.map | 8 +- ...40291bc02cba5474a4cb46a9b9566fe_cgraph.svg | 72 +- ...138609c765e2fd8b89e9c107cd40d57_cgraph.map | 8 +- ...138609c765e2fd8b89e9c107cd40d57_cgraph.svg | 40 +- ...215107dbb50c7efa811a687ce9b95af_cgraph.map | 8 +- ...215107dbb50c7efa811a687ce9b95af_cgraph.svg | 40 +- d0/dd9/hexadecimal__to__octal2_8c.html | 247 ++- d0/dd9/hexadecimal__to__octal2_8c.js | 4 +- d0/df1/structhash__set__t.html | 41 +- d0/df1/structhash__set__t.js | 7 - d0/df1/threaded__binary__trees_8c__incl.map | 6 +- d0/df1/threaded__binary__trees_8c__incl.svg | 28 +- .../insertion__sort__recursive_8c__incl.map | 2 +- .../insertion__sort__recursive_8c__incl.svg | 6 +- d1/d07/sol4_8c__incl.map | 4 +- d1/d07/sol4_8c__incl.svg | 20 +- d1/d10/structelem__coll__graph.svg | 2 +- ...md_data_structures_stack__r_e_a_d_m_e.html | 53 +- d1/d20/server_8c.html | 232 ++- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 4 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 37 + d1/d2f/problem__7_2sol_8c.html | 97 +- ...40291bc02cba5474a4cb46a9b9566fe_cgraph.svg | 2 +- d1/d5e/structobservation.html | 47 +- d1/d6b/group__kohonen__2d.html | 487 +++-- d1/d6b/group__kohonen__2d.js | 2 +- d1/d6b/group__kohonen__2d.map | 4 +- d1/d6b/group__kohonen__2d.svg | 22 +- ...9d35f68f5d11d8ef6f8cce0d0e7bcba_cgraph.map | 4 +- ...9d35f68f5d11d8ef6f8cce0d0e7bcba_cgraph.md5 | 2 +- ...9d35f68f5d11d8ef6f8cce0d0e7bcba_cgraph.svg | 22 +- ...3abb572c60d202e100595a989dfe123_cgraph.map | 6 +- ...3abb572c60d202e100595a989dfe123_cgraph.md5 | 2 +- ...3abb572c60d202e100595a989dfe123_cgraph.svg | 30 +- ...b42eda8af6ebd6a141a34ab00a0b710_cgraph.map | 8 +- ...b42eda8af6ebd6a141a34ab00a0b710_cgraph.md5 | 2 +- ...b42eda8af6ebd6a141a34ab00a0b710_cgraph.svg | 38 +- d1/d6b/tcp__full__duplex__server_8c.html | 400 ++++ d1/d6b/tcp__full__duplex__server_8c.js | 6 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 4 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 37 + d1/d6c/ode__forward__euler_8c__incl.map | 2 +- d1/d6c/ode__forward__euler_8c__incl.svg | 6 +- d1/d8d/struct_a_v_lnode__coll__graph.map | 2 +- d1/d8d/struct_a_v_lnode__coll__graph.svg | 20 +- d1/d94/odd__even__sort_8c.html | 349 ++++ d1/d94/odd__even__sort_8c.js | 7 + ...7761a0788916faded6e2ca1f478ad33_cgraph.map | 4 + ...7761a0788916faded6e2ca1f478ad33_cgraph.md5 | 1 + ...7761a0788916faded6e2ca1f478ad33_cgraph.svg | 37 + ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 5 + ...8dca7b867074164d5f45b0f3851269d_cgraph.md5 | 1 + ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 52 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 6 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 67 + d1/d98/tcp__full__duplex__client_8c.html | 371 ++++ d1/d98/tcp__full__duplex__client_8c.js | 6 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 4 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 37 + d1/d99/structcluster.html | 47 +- d1/dac/doubly__linked__list_8c__incl.map | 6 +- d1/dac/doubly__linked__list_8c__incl.svg | 28 +- d1/dba/decimal__to__any__base_8c.html | 507 +++++ d1/dba/decimal__to__any__base_8c.js | 9 + ...c5ccb926a23bc0050f213ba3408e18d_cgraph.map | 3 + ...c5ccb926a23bc0050f213ba3408e18d_cgraph.md5 | 1 + ...c5ccb926a23bc0050f213ba3408e18d_cgraph.svg | 28 + ...e4a7cfc97a528faa4d6e5741461109c_cgraph.map | 6 + ...e4a7cfc97a528faa4d6e5741461109c_cgraph.md5 | 1 + ...e4a7cfc97a528faa4d6e5741461109c_cgraph.svg | 79 + ...99b3a7e0f1fac5a465eac0d4b10d711_cgraph.map | 3 + ...99b3a7e0f1fac5a465eac0d4b10d711_cgraph.md5 | 1 + ...99b3a7e0f1fac5a465eac0d4b10d711_cgraph.svg | 28 + ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 7 + ...8dca7b867074164d5f45b0f3851269d_cgraph.md5 | 1 + ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 94 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 8 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 109 + d1/dbe/include_8h_source.html | 138 ++ d1/dc2/ode__midpoint__euler_8c.html | 255 ++- ...ddf1224851353fc92bfbff6f499fa97_cgraph.map | 7 + ...ddf1224851353fc92bfbff6f499fa97_cgraph.md5 | 1 + ...ddf1224851353fc92bfbff6f499fa97_cgraph.svg | 82 + ...48003d8b261d040c1c41e73b40af1dd_cgraph.map | 6 +- ...48003d8b261d040c1c41e73b40af1dd_cgraph.svg | 28 +- ...fe6cc2ab040b94a29e6c41782f72d51_cgraph.map | 4 +- ...fe6cc2ab040b94a29e6c41782f72d51_cgraph.svg | 20 +- d1/dd3/problem__401_2sol1_8c__incl.map | 2 +- d1/dd3/problem__401_2sol1_8c__incl.svg | 6 +- d1/de4/infix__to__postfix2_8c__incl.map | 9 + d1/de4/infix__to__postfix2_8c__incl.md5 | 1 + d1/de4/infix__to__postfix2_8c__incl.svg | 113 ++ d1/ded/group__misc.html | 117 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 4 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 24 +- ...0f2228420376f4db7e1274f2b41667c_cgraph.map | 4 +- ...0f2228420376f4db7e1274f2b41667c_cgraph.svg | 24 +- d1/df8/merge__sort_8c__incl.map | 2 +- d1/df8/merge__sort_8c__incl.svg | 4 +- d1/df9/problem__26_2sol1_8c.html | 197 +- ...ddf1224851353fc92bfbff6f499fa97_cgraph.map | 4 + ...ddf1224851353fc92bfbff6f499fa97_cgraph.md5 | 1 + ...ddf1224851353fc92bfbff6f499fa97_cgraph.svg | 37 + d2/d36/structqueue.html | 45 +- d2/d36/structqueue.js | 8 - d2/d3e/structdual__quat____coll__graph.map | 6 +- d2/d3e/structdual__quat____coll__graph.svg | 34 +- d2/d42/tcp__full__duplex__server_8c__incl.map | 13 + d2/d42/tcp__full__duplex__server_8c__incl.md5 | 1 + d2/d42/tcp__full__duplex__server_8c__incl.svg | 261 +++ ...tcp__full__duplex__server_8c__incl_org.svg | 173 ++ d2/d6a/struct_graph_rep.html | 39 +- d2/d6a/struct_graph_rep.js | 6 - d2/d6d/bubble__sort__2_8c.html | 163 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 16 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 16 +- d2/d71/struct_a_v_lnode.html | 43 +- d2/d71/struct_a_v_lnode.js | 7 - d2/d83/merge__sort_8c.html | 93 +- ...40291bc02cba5474a4cb46a9b9566fe_cgraph.map | 6 + ...40291bc02cba5474a4cb46a9b9566fe_cgraph.md5 | 1 + ...40291bc02cba5474a4cb46a9b9566fe_cgraph.svg | 73 + d2/d93/problem__8_2sol2_8c.html | 197 +- d2/d97/palindrome_8c__incl.map | 6 +- d2/d97/palindrome_8c__incl.svg | 32 +- ...floyd__cycle__detection__algorithm_8c.html | 279 +++ .../floyd__cycle__detection__algorithm_8c.js | 6 + ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 4 + ...8dca7b867074164d5f45b0f3851269d_cgraph.md5 | 1 + ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 37 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 5 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 52 + d2/da8/bead__sort_8c.html | 113 +- ...0f2228420376f4db7e1274f2b41667c_cgraph.map | 5 + ...0f2228420376f4db7e1274f2b41667c_cgraph.md5 | 1 + ...0f2228420376f4db7e1274f2b41667c_cgraph.svg | 52 + d2/daa/structadaline.html | 47 +- d2/dae/problem__1_2sol2_8c.html | 85 +- d2/dbc/problem__3_2sol2_8c.html | 97 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 4 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 37 + d2/dc3/carray_8h_source.html | 201 +- d2/dd8/problem__3_2sol1_8c__incl.map | 6 +- d2/dd8/problem__3_2sol1_8c__incl.svg | 30 +- d2/ddd/malloc__dbg_8h.html | 353 ++-- d2/ddd/malloc__dbg_8h.js | 4 +- ...0238aaeea60178d31fbb74347e941aa_cgraph.md5 | 1 - ...0238aaeea60178d31fbb74347e941aa_cgraph.svg | 82 - ...914d05ba1fe8848aa1b48cda719422_cgraph.map} | 10 +- ...7914d05ba1fe8848aa1b48cda719422_cgraph.md5 | 1 + ...7914d05ba1fe8848aa1b48cda719422_cgraph.svg | 82 + ...7f946b77155ca78d0e14e231a99f5d_cgraph.map} | 6 +- ...07f946b77155ca78d0e14e231a99f5d_cgraph.md5 | 1 + ...07f946b77155ca78d0e14e231a99f5d_cgraph.svg | 30 +- ...c6b5ee323e5338f23a1ce6fe9974f25_cgraph.md5 | 1 - d2/ddd/malloc__dbg_8h_source.html | 107 +- d2/ddf/struct_l__coll__graph.svg | 2 +- d2/de8/structeuler__.html | 53 +- d2/de9/realtime__stats_8c__incl.map | 2 +- d2/de9/realtime__stats_8c__incl.svg | 6 +- d2/df6/kohonen__som__topology_8c.html | 641 +++--- d2/df6/kohonen__som__topology_8c.js | 2 +- ...283886819c7c140a023582b7269e2d0_cgraph.map | 18 +- ...283886819c7c140a023582b7269e2d0_cgraph.md5 | 2 +- ...283886819c7c140a023582b7269e2d0_cgraph.svg | 88 +- ...440a7779ac56f47a3f355ce4a8c7da0_cgraph.map | 18 +- ...440a7779ac56f47a3f355ce4a8c7da0_cgraph.md5 | 2 +- ...440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg | 72 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.map | 17 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 | 1 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.svg | 410 ++++ ...38a5bfe5d72780bb7e82a18e627_cgraph_org.svg | 322 +++ ...bb02a8322d717ead1b11182c5f02a3a_cgraph.map | 4 +- ...bb02a8322d717ead1b11182c5f02a3a_cgraph.svg | 20 +- ...d0455dd5c30adda100e95f0423c786e_cgraph.map | 18 +- ...d0455dd5c30adda100e95f0423c786e_cgraph.md5 | 2 +- ...d0455dd5c30adda100e95f0423c786e_cgraph.svg | 88 +- ...9e25202bb8b481461f932668f249dbc_cgraph.map | 4 +- ...9e25202bb8b481461f932668f249dbc_cgraph.svg | 20 +- ...b5ded007be1fd666fab9affe6764018_cgraph.map | 2 +- ...b5ded007be1fd666fab9affe6764018_cgraph.svg | 16 +- d3/d01/problem__21_2sol1_8c__incl.map | 2 +- d3/d01/problem__21_2sol1_8c__incl.svg | 6 +- d3/d39/hash__adler32_8c.html | 78 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 5 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 52 + d3/d47/modified__binary__search_8c.html | 234 ++- ...df9a198e30cded6229d79bef7591f8f_cgraph.map | 4 +- ...df9a198e30cded6229d79bef7591f8f_cgraph.svg | 20 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 5 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 52 + .../selection__sort__recursive_8c__incl.map | 2 +- .../selection__sort__recursive_8c__incl.svg | 6 +- d3/d5a/struct__large__num.html | 43 +- d3/d60/union__find_8c__incl.map | 2 +- d3/d60/union__find_8c__incl.svg | 4 +- d3/d61/problem__1_2sol1_8c__incl.map | 4 +- d3/d61/problem__1_2sol1_8c__incl.svg | 20 +- d3/d78/words__alphabetical_8c.html | 759 +++++++ d3/d78/words__alphabetical_8c.js | 14 + ...ac11529daf94e98f7114a6e938679a9_cgraph.map | 6 + ...ac11529daf94e98f7114a6e938679a9_cgraph.md5 | 1 + ...ac11529daf94e98f7114a6e938679a9_cgraph.svg | 79 + ...51b2c78ae821d0495faf936a1c2530f_cgraph.map | 7 + ...51b2c78ae821d0495faf936a1c2530f_cgraph.md5 | 1 + ...51b2c78ae821d0495faf936a1c2530f_cgraph.svg | 182 ++ ...c78ae821d0495faf936a1c2530f_cgraph_org.svg | 94 + ...e5ad8401396df36ab585d79f3309fd9_cgraph.map | 4 + ...e5ad8401396df36ab585d79f3309fd9_cgraph.md5 | 1 + ...e5ad8401396df36ab585d79f3309fd9_cgraph.svg | 37 + ...2516c70583c9fa78e4edffb063836cc_cgraph.map | 3 + ...2516c70583c9fa78e4edffb063836cc_cgraph.md5 | 1 + ...2516c70583c9fa78e4edffb063836cc_cgraph.svg | 28 + ...40902ada0e956eb01b529be178748cc_cgraph.map | 3 + ...40902ada0e956eb01b529be178748cc_cgraph.md5 | 1 + ...40902ada0e956eb01b529be178748cc_cgraph.svg | 28 + ...e3cab68cf6557024f0073f674a307a1_cgraph.map | 4 + ...e3cab68cf6557024f0073f674a307a1_cgraph.md5 | 1 + ...e3cab68cf6557024f0073f674a307a1_cgraph.svg | 37 + ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 11 + ...8dca7b867074164d5f45b0f3851269d_cgraph.md5 | 1 + ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 260 +++ ...7b867074164d5f45b0f3851269d_cgraph_org.svg | 172 ++ ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 12 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 275 +++ ...b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg | 187 ++ ...1f9b6eb320d872ba0766dc8bd070075_cgraph.map | 4 + ...1f9b6eb320d872ba0766dc8bd070075_cgraph.md5 | 1 + ...1f9b6eb320d872ba0766dc8bd070075_cgraph.svg | 37 + ...__cycle__detection__algorithm_8c__incl.map | 6 + ...__cycle__detection__algorithm_8c__incl.md5 | 1 + ...__cycle__detection__algorithm_8c__incl.svg | 68 + d3/ddb/bead__sort_8c__incl.map | 2 +- d3/ddb/bead__sort_8c__incl.svg | 4 +- d4/d02/struct_b_s_t_iterator.html | 43 +- d4/d02/struct_b_s_t_iterator.js | 6 - d4/d07/ode__forward__euler_8c.html | 243 ++- ...ddf1224851353fc92bfbff6f499fa97_cgraph.map | 7 + ...ddf1224851353fc92bfbff6f499fa97_cgraph.md5 | 1 + ...ddf1224851353fc92bfbff6f499fa97_cgraph.svg | 82 + ...f88ad8f9f7c39fc38f3f03d6fea9df9_cgraph.map | 6 +- ...f88ad8f9f7c39fc38f3f03d6fea9df9_cgraph.svg | 28 +- ...6c9413953c8d9d4bc9e374b29586350_cgraph.map | 4 +- ...6c9413953c8d9d4bc9e374b29586350_cgraph.svg | 20 +- d4/d15/qr__eigen__values_8c__incl.map | 12 +- d4/d15/qr__eigen__values_8c__incl.svg | 70 +- d4/d22/struct_trie_node__coll__graph.map | 2 +- d4/d22/struct_trie_node__coll__graph.svg | 18 +- d4/d25/hash__sdbm_8c__incl.map | 2 +- d4/d25/hash__sdbm_8c__incl.svg | 4 +- d4/d26/postfix__evaluation_8c__incl.map | 9 + d4/d26/postfix__evaluation_8c__incl.md5 | 1 + d4/d26/postfix__evaluation_8c__incl.svg | 112 ++ d4/d2d/struct_c_array.html | 37 +- d4/d2d/struct_c_array.js | 5 - d4/d3c/words__alphabetical_8c__incl.map | 10 + d4/d3c/words__alphabetical_8c__incl.md5 | 1 + d4/d3c/words__alphabetical_8c__incl.svg | 128 ++ d4/d4c/md__c_o_d_e__o_f__c_o_n_d_u_c_t.html | 53 +- d4/d5b/selection__sort_8c__incl.svg | 4 +- d4/d64/bubble__sort__2_8c__incl.map | 4 +- d4/d64/bubble__sort__2_8c__incl.svg | 18 +- d4/d68/qr__decompose_8h.html | 297 ++- d4/d68/qr__decompose_8h.js | 4 +- ...d4977f38642dca8b10c16a823c740b_cgraph.map} | 4 +- ...d4977f38642dca8b10c16a823c740b_cgraph.md5} | 0 ...d4977f38642dca8b10c16a823c740b_cgraph.svg} | 20 +- ...5c7640d9d22c89c11beb1f567843c56_cgraph.map | 10 +- ...5c7640d9d22c89c11beb1f567843c56_cgraph.md5 | 2 +- ...5c7640d9d22c89c11beb1f567843c56_cgraph.svg | 58 +- ...eec1f78a7a7e7251687e75340331212_cgraph.map | 4 +- ...eec1f78a7a7e7251687e75340331212_cgraph.svg | 20 +- d4/d68/qr__decompose_8h_source.html | 437 ++--- d4/d69/group__dual__quats.html | 41 +- d4/d69/group__dual__quats.map | 2 +- d4/d69/group__dual__quats.svg | 16 +- ...t_m_e_m_o_r_y___i_n_f_o_r_m_a_t_i_o_n.html | 67 +- d4/d7b/problem__6_2sol_8c.html | 78 +- d4/d83/problem__401_2sol1_8c.html | 305 ++- d4/d83/problem__401_2sol1_8c.js | 1 - ...36548478af932f1115a71f601a68788_cgraph.map | 6 +- ...36548478af932f1115a71f601a68788_cgraph.svg | 28 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.map | 7 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 | 1 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.svg | 82 + ...380e14d595d560007b02ce516b6b215_cgraph.map | 4 +- ...380e14d595d560007b02ce516b6b215_cgraph.svg | 20 +- ...f964739be92adc2f500e7da11e3f6be_cgraph.map | 6 + ...f964739be92adc2f500e7da11e3f6be_cgraph.md5 | 1 + ...f964739be92adc2f500e7da11e3f6be_cgraph.svg | 67 + d4/d89/problem__23_2sol1_8c__incl.map | 2 +- d4/d89/problem__23_2sol1_8c__incl.svg | 6 +- d4/d8a/quaternions_8c__incl.map | 4 +- d4/d8a/quaternions_8c__incl.svg | 18 +- d4/d99/fibonacci__fast_8c.html | 184 +- ...ddf1224851353fc92bfbff6f499fa97_cgraph.map | 4 + ...ddf1224851353fc92bfbff6f499fa97_cgraph.md5 | 1 + ...ddf1224851353fc92bfbff6f499fa97_cgraph.svg | 43 + ...a3d55bd19854075cba2eed6b63cb2d3_cgraph.map | 3 + ...a3d55bd19854075cba2eed6b63cb2d3_cgraph.md5 | 1 + ...a3d55bd19854075cba2eed6b63cb2d3_cgraph.svg | 28 + d4/d99/ode__semi__implicit__euler_8c.html | 257 ++- ...ddf1224851353fc92bfbff6f499fa97_cgraph.map | 7 + ...ddf1224851353fc92bfbff6f499fa97_cgraph.md5 | 1 + ...ddf1224851353fc92bfbff6f499fa97_cgraph.svg | 82 + ...20b7e995d2bbc615f94a2c7dbcf84eb_cgraph.map | 4 +- ...20b7e995d2bbc615f94a2c7dbcf84eb_cgraph.svg | 20 +- ...80059877222f885b549f2d0a3dc6b55_cgraph.map | 6 +- ...80059877222f885b549f2d0a3dc6b55_cgraph.svg | 28 +- d4/dbd/problem__23_2sol2_8c.html | 349 +++- ...ab61b5a1c4f2288625d160aa0ea8478_cgraph.map | 6 +- ...ab61b5a1c4f2288625d160aa0ea8478_cgraph.svg | 32 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.map | 7 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 | 1 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.svg | 88 + ...5d600bf3077f4188afc4c5cd2c40eaf_cgraph.map | 4 + ...5d600bf3077f4188afc4c5cd2c40eaf_cgraph.md5 | 1 + ...5d600bf3077f4188afc4c5cd2c40eaf_cgraph.svg | 37 + d4/dcb/md_hash__r_e_a_d_m_e.html | 33 +- d4/dcc/strong__number_8c.html | 103 +- ...1a3968e7947464bee7714f6d43b7002_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d4/dce/tcp__full__duplex__client_8c__incl.map | 13 + d4/dce/tcp__full__duplex__client_8c__incl.md5 | 1 + d4/dce/tcp__full__duplex__client_8c__incl.svg | 261 +++ ...tcp__full__duplex__client_8c__incl_org.svg | 173 ++ d4/dd4/struct_graph.html | 55 +- d4/dd4/struct_graph.js | 13 - d4/ddb/jump__search_8c__incl.map | 2 +- d4/ddb/jump__search_8c__incl.svg | 4 +- d4/de3/hash__djb2_8c.html | 78 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 5 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 52 + d4/dea/problem__14_2sol1_8c.html | 165 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.map | 4 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 | 1 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.svg | 37 + d4/dee/modified__binary__search_8c__incl.map | 2 +- d4/dee/modified__binary__search_8c__incl.svg | 6 +- d4/dfe/struct_dict.html | 37 +- d4/dfe/struct_dict.js | 5 - d5/d23/qr__decomposition_8c.html | 141 +- ...40291bc02cba5474a4cb46a9b9566fe_cgraph.map | 9 + ...40291bc02cba5474a4cb46a9b9566fe_cgraph.md5 | 1 + ...40291bc02cba5474a4cb46a9b9566fe_cgraph.svg | 124 ++ d5/d38/bubble__sort__recursion_8c.html | 180 +- ...8989f6c9bfd1f040854fa18b180114f_cgraph.map | 4 +- ...8989f6c9bfd1f040854fa18b180114f_cgraph.md5 | 2 +- ...8989f6c9bfd1f040854fa18b180114f_cgraph.svg | 30 +- ...1a3968e7947464bee7714f6d43b7002_cgraph.map | 5 + ...1a3968e7947464bee7714f6d43b7002_cgraph.md5 | 1 + ...1a3968e7947464bee7714f6d43b7002_cgraph.svg | 58 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 6 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 73 + d5/d3d/problem__5_2sol2_8c.html | 95 +- ...40291bc02cba5474a4cb46a9b9566fe_cgraph.map | 2 +- ...40291bc02cba5474a4cb46a9b9566fe_cgraph.svg | 16 +- d5/d3e/problem__3_2sol2_8c__incl.map | 4 +- d5/d3e/problem__3_2sol2_8c__incl.svg | 20 +- d5/d4c/group__sorting.html | 397 ++-- ...8666b73777e308fb06a3c489ce25359_cgraph.map | 3 + ...8666b73777e308fb06a3c489ce25359_cgraph.md5 | 1 + ...8666b73777e308fb06a3c489ce25359_cgraph.svg | 28 + ...99b8a397bdd0bf2903d66c22ba4ba43_cgraph.map | 6 +- ...99b8a397bdd0bf2903d66c22ba4ba43_cgraph.md5 | 2 +- ...99b8a397bdd0bf2903d66c22ba4ba43_cgraph.svg | 36 +- d5/d51/problem__25_2sol1_8c__incl.map | 2 +- d5/d51/problem__25_2sol1_8c__incl.svg | 6 +- d5/d5c/test__min__printf_8c.html | 179 ++ d5/d5c/test__min__printf_8c.js | 4 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 11 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 148 ++ d5/d7c/problem__5_2sol3_8c.html | 117 +- ...40291bc02cba5474a4cb46a9b9566fe_cgraph.map | 2 +- ...40291bc02cba5474a4cb46a9b9566fe_cgraph.svg | 16 +- ...9606f1867e9921867d6572f51377b4c_cgraph.map | 2 +- ...9606f1867e9921867d6572f51377b4c_cgraph.svg | 16 +- d5/d7e/struct_t.html | 37 +- d5/d7e/struct_t.js | 5 - d5/d88/md__d_i_r_e_c_t_o_r_y.html | 746 +++---- d5/da1/structnode.html | 83 +- d5/da1/structnode.js | 13 +- d5/db4/struct_edge.html | 45 +- d5/db4/struct_edge.js | 9 - d5/db4/structvec__3d__.html | 47 +- d5/db6/hash__crc32_8c__incl.map | 2 +- d5/db6/hash__crc32_8c__incl.svg | 4 +- d5/db8/vectors__3d_8c.html | 123 +- d5/db8/vectors__3d_8c.js | 3 +- ...40291bc02cba5474a4cb46a9b9566fe_cgraph.map | 11 +- ...40291bc02cba5474a4cb46a9b9566fe_cgraph.md5 | 2 +- ...40291bc02cba5474a4cb46a9b9566fe_cgraph.svg | 83 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 9 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.md5 | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 75 +- d5/dc5/test__min__printf_8c__incl.map | 8 + d5/dc5/test__min__printf_8c__incl.md5 | 1 + d5/dc5/test__min__printf_8c__incl.svg | 98 + d5/ddd/octal__to__hexadecimal_8c__incl.map | 2 +- d5/ddd/octal__to__hexadecimal_8c__incl.svg | 6 +- d5/de2/sentinel__linear__search_8c.html | 281 +++ d5/de2/sentinel__linear__search_8c.js | 6 + ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 4 + ...8dca7b867074164d5f45b0f3851269d_cgraph.md5 | 1 + ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 37 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 5 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 52 + d5/df1/k__means__clustering_8c__incl.map | 2 +- d5/df1/k__means__clustering_8c__incl.svg | 6 +- d5/df4/group__sudoku.html | 269 ++- ...a0ec150ac9d0cb6b28279d36d95d72f_cgraph.svg | 2 +- ...fe0ed5085b4775d8fa00b434cc0fdfc_cgraph.map | 10 +- ...fe0ed5085b4775d8fa00b434cc0fdfc_cgraph.md5 | 2 +- ...fe0ed5085b4775d8fa00b434cc0fdfc_cgraph.svg | 58 +- d6/d1b/sol4_8c.html | 91 +- d6/d2b/tcp__half__duplex__server_8c.html | 385 ++++ d6/d2b/tcp__half__duplex__server_8c.js | 6 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 4 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 37 + d6/d2e/cartesian__to__polar_8c.html | 254 ++- ...1a3968e7947464bee7714f6d43b7002_cgraph.map | 5 + ...1a3968e7947464bee7714f6d43b7002_cgraph.md5 | 1 + ...1a3968e7947464bee7714f6d43b7002_cgraph.svg | 52 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 6 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 67 + d6/d3d/factorial__large__number_8c.html | 247 ++- d6/d3d/factorial__large__number_8c.js | 2 +- ...ddf1224851353fc92bfbff6f499fa97_cgraph.map | 7 + ...ddf1224851353fc92bfbff6f499fa97_cgraph.md5 | 1 + ...ddf1224851353fc92bfbff6f499fa97_cgraph.svg | 88 + ...398ddbd594ca69a5e6dfc894925341e_cgraph.map | 5 + ...398ddbd594ca69a5e6dfc894925341e_cgraph.md5 | 1 + ...398ddbd594ca69a5e6dfc894925341e_cgraph.svg | 52 + ...2869d36c22a2b8f93d3166a84e124b3_cgraph.map | 4 +- ...2869d36c22a2b8f93d3166a84e124b3_cgraph.svg | 20 +- d6/d42/problem__22_2sol1_8c__incl.map | 2 +- d6/d42/problem__22_2sol1_8c__incl.svg | 6 +- d6/d42/structdynamic__array.html | 39 +- d6/d42/structdynamic__array.js | 6 - d6/d48/isogram_8h_source.html | 47 +- d6/d64/problem__7_2sol2_8c.html | 95 +- d6/d6d/struct_graph__coll__graph.map | 6 +- d6/d6d/struct_graph__coll__graph.md5 | 2 +- d6/d6d/struct_graph__coll__graph.svg | 68 +- d6/d76/k__means__clustering_8c.html | 321 ++- d6/d76/k__means__clustering_8c.js | 5 +- ...283886819c7c140a023582b7269e2d0_cgraph.map | 6 +- ...283886819c7c140a023582b7269e2d0_cgraph.md5 | 2 +- ...283886819c7c140a023582b7269e2d0_cgraph.svg | 32 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 6 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.md5 | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 32 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 6 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 32 +- d6/d7b/jump__search_8c.html | 187 +- ...1a3968e7947464bee7714f6d43b7002_cgraph.map | 4 + ...1a3968e7947464bee7714f6d43b7002_cgraph.md5 | 1 + ...1a3968e7947464bee7714f6d43b7002_cgraph.svg | 37 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 5 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 52 + d6/d88/problem__16_2sol1_8c.html | 129 +- d6/d92/odd__even__sort_8c__incl.map | 9 + d6/d92/odd__even__sort_8c__incl.md5 | 1 + d6/d92/odd__even__sort_8c__incl.svg | 112 ++ d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html | 428 ++-- d6/ddc/segment__tree_8c__incl.map | 2 +- d6/ddc/segment__tree_8c__incl.svg | 6 +- d6/ded/shell__sort2_8c.html | 125 +- ...ddf1224851353fc92bfbff6f499fa97_cgraph.map | 5 + ...ddf1224851353fc92bfbff6f499fa97_cgraph.md5 | 1 + ...ddf1224851353fc92bfbff6f499fa97_cgraph.svg | 52 + d6/df3/graph_8h_source.html | 121 +- d6/df6/hash__djb2_8c__incl.map | 2 +- d6/df6/hash__djb2_8c__incl.svg | 4 +- d7/d0a/fibonacci__fast_8c__incl.map | 8 +- d7/d0a/fibonacci__fast_8c__incl.svg | 36 +- d7/d0c/hash__sdbm_8c.html | 78 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 5 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 52 + d7/d1f/problem__12_2sol1_8c.html | 129 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.map | 4 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 | 1 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.svg | 37 + d7/d3b/group__hash.html | 269 ++- ...9d4c16427acbf8bbe744f6d8ed61dc0_cgraph.map | 4 +- ...9d4c16427acbf8bbe744f6d8ed61dc0_cgraph.svg | 20 +- ...94ea8b243b6c0fbef734551ec5765dd_cgraph.map | 4 +- ...94ea8b243b6c0fbef734551ec5765dd_cgraph.svg | 20 +- ...f76001544014905468dc812336110d5_cgraph.map | 4 +- ...f76001544014905468dc812336110d5_cgraph.svg | 20 +- ...87679863646255178427a56dc33e453_cgraph.map | 4 +- ...87679863646255178427a56dc33e453_cgraph.svg | 20 +- ...451622bbdca271edfa8e0d98ca422f2_cgraph.map | 4 +- ...451622bbdca271edfa8e0d98ca422f2_cgraph.svg | 20 +- d7/d50/qr__eigen__values_8c.html | 615 +++--- d7/d50/qr__eigen__values_8c.js | 2 +- ...283886819c7c140a023582b7269e2d0_cgraph.map | 16 +- ...283886819c7c140a023582b7269e2d0_cgraph.md5 | 2 +- ...283886819c7c140a023582b7269e2d0_cgraph.svg | 86 +- ...d8ed79786d17df48396b333c09d05bb_cgraph.map | 16 +- ...d8ed79786d17df48396b333c09d05bb_cgraph.md5 | 2 +- ...d8ed79786d17df48396b333c09d05bb_cgraph.svg | 82 +- ...440a7779ac56f47a3f355ce4a8c7da0_cgraph.map | 16 +- ...440a7779ac56f47a3f355ce4a8c7da0_cgraph.md5 | 2 +- ...440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg | 86 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.map | 14 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 | 1 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.svg | 305 +++ ...38a5bfe5d72780bb7e82a18e627_cgraph_org.svg | 217 ++ d7/d6d/client_8c__incl.map | 10 +- d7/d6d/client_8c__incl.svg | 56 +- d7/d70/malloc__dbg_8c__incl.map | 4 +- d7/d70/malloc__dbg_8c__incl.svg | 20 +- d7/d86/struct__big__int__coll__graph.map | 2 +- d7/d86/struct__big__int__coll__graph.svg | 20 +- d7/d90/rna__transcription_8h_source.html | 45 +- d7/d91/problem__15_2sol1_8c.html | 116 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.map | 4 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 | 1 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.svg | 37 + d7/d98/spirograph_8c.html | 202 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.map | 13 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 | 1 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.svg | 272 +++ ...38a5bfe5d72780bb7e82a18e627_cgraph_org.svg | 184 ++ ...08a4c1a4d0c4acc4c447310dd4db27f_cgraph.map | 4 + ...08a4c1a4d0c4acc4c447310dd4db27f_cgraph.md5 | 1 + ...08a4c1a4d0c4acc4c447310dd4db27f_cgraph.svg | 37 + d7/dac/problem__9_2sol1_8c__incl.map | 4 +- d7/dac/problem__9_2sol1_8c__incl.svg | 20 +- d7/daf/vectors__3d_8c__incl.map | 4 +- d7/daf/vectors__3d_8c__incl.svg | 18 +- d7/db5/md_exercism__r_e_a_d_m_e.html | 41 +- d7/dd3/problem__3_2sol1_8c.html | 164 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 4 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 37 + d7/dd8/c__atoi__str__to__integer_8c.html | 187 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.svg | 2 +- ...c66c03637e48e375b80b5d7791e57be_cgraph.map | 4 + ...c66c03637e48e375b80b5d7791e57be_cgraph.md5 | 1 + ...c66c03637e48e375b80b5d7791e57be_cgraph.svg | 37 + d7/ddb/problem__23_2sol1_8c.html | 291 ++- ...ab61b5a1c4f2288625d160aa0ea8478_cgraph.map | 8 +- ...ab61b5a1c4f2288625d160aa0ea8478_cgraph.svg | 130 +- ...b5a1c4f2288625d160aa0ea8478_cgraph_org.svg | 73 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.map | 7 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 | 1 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.svg | 176 ++ ...38a5bfe5d72780bb7e82a18e627_cgraph_org.svg | 88 + ...f128410e6582fe26488e2316cc96e17_cgraph.map | 4 + ...f128410e6582fe26488e2316cc96e17_cgraph.md5 | 1 + ...f128410e6582fe26488e2316cc96e17_cgraph.svg | 37 + ...5d600bf3077f4188afc4c5cd2c40eaf_cgraph.map | 5 + ...5d600bf3077f4188afc4c5cd2c40eaf_cgraph.md5 | 1 + ...5d600bf3077f4188afc4c5cd2c40eaf_cgraph.svg | 52 + d7/de0/stack_8h_source.html | 115 +- d7/ded/problem__10_2sol2_8c__incl.map | 2 +- d7/ded/problem__10_2sol2_8c__incl.svg | 6 +- ...y___i_n_f_o_r_m_a_t_i_o_n__coll__graph.map | 2 +- ...y___i_n_f_o_r_m_a_t_i_o_n__coll__graph.svg | 14 +- d7/dfd/structdual__quat__.html | 45 +- d8/d10/structlist.html | 45 +- d8/d10/structlist.js | 1 - d8/d11/newton__raphson__root_8c__incl.map | 2 +- d8/d11/newton__raphson__root_8c__incl.svg | 6 +- d8/d18/problem__1_2sol3_8c__incl.map | 4 +- d8/d18/problem__1_2sol3_8c__incl.svg | 20 +- d8/d1c/binary__search__tree_8c__incl.map | 6 +- d8/d1c/binary__search__tree_8c__incl.svg | 28 +- d8/d26/decimal__to__any__base_8c__incl.map | 9 + d8/d26/decimal__to__any__base_8c__incl.md5 | 1 + d8/d26/decimal__to__any__base_8c__incl.svg | 113 ++ d8/d30/decimal__to__binary__recursion_8c.html | 137 +- d8/d30/decimal__to__binary__recursion_8c.js | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 4 + ...8dca7b867074164d5f45b0f3851269d_cgraph.md5 | 1 + ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 43 + ...bbe6358ec95b3201865a72b2ac522c8_cgraph.map | 3 + ...bbe6358ec95b3201865a72b2ac522c8_cgraph.md5 | 1 + ...bbe6358ec95b3201865a72b2ac522c8_cgraph.svg | 28 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 5 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 58 + d8/d32/problem__25_2sol1_8c.html | 288 ++- ...ddf1224851353fc92bfbff6f499fa97_cgraph.map | 5 + ...ddf1224851353fc92bfbff6f499fa97_cgraph.md5 | 1 + ...ddf1224851353fc92bfbff6f499fa97_cgraph.svg | 52 + d8/d38/queue_8h_source.html | 97 +- d8/d48/problem__10_2sol1_8c__incl.map | 2 +- d8/d48/problem__10_2sol1_8c__incl.svg | 6 +- d8/d56/strong__number_8c__incl.map | 6 +- d8/d56/strong__number_8c__incl.svg | 32 +- d8/d68/problem__5_2sol2_8c__incl.map | 6 +- d8/d68/problem__5_2sol2_8c__incl.svg | 28 +- d8/d6a/problem__8_2sol1_8c__incl.map | 6 +- d8/d6a/problem__8_2sol1_8c__incl.svg | 28 +- d8/d71/group__k__means.html | 289 ++- d8/d71/group__k__means.js | 2 +- d8/d71/group__k__means.map | 4 +- d8/d71/group__k__means.svg | 22 +- ...259432561e794dea0e060f482d15e2_cgraph.map} | 6 +- ...259432561e794dea0e060f482d15e2_cgraph.md5} | 0 ...259432561e794dea0e060f482d15e2_cgraph.svg} | 28 +- d8/d7a/structtnode.html | 43 +- d8/d7a/structtnode.js | 7 - d8/d7c/cartesian__to__polar_8c__incl.map | 2 +- d8/d7c/cartesian__to__polar_8c__incl.svg | 4 +- d8/d7c/dict_8h_source.html | 161 +- d8/d81/md_project_euler__r_e_a_d_m_e.html | 41 +- d8/d9e/problem__5_2sol3_8c__incl.map | 4 +- d8/d9e/problem__5_2sol3_8c__incl.svg | 20 +- d8/da2/dynamic__array_8h_source.html | 85 +- d8/db5/sudoku__solver_8c__incl.map | 10 +- d8/db5/sudoku__solver_8c__incl.svg | 36 +- d8/db8/structkohonen__array__3d.html | 51 +- d8/dc1/udp__client_8c__incl.map | 20 +- d8/dc1/udp__client_8c__incl.svg | 82 +- d8/dc1/udp__client_8c__incl_org.svg | 84 +- d8/dca/udp__server_8c.html | 134 +- d8/dcc/min__printf_8h__incl.map | 6 + d8/dcc/min__printf_8h__incl.md5 | 1 + d8/dcc/min__printf_8h__incl.svg | 68 + d8/de0/problem__9_2sol2_8c.html | 91 +- d8/dfc/hexadecimal__to__octal2_8c__incl.map | 6 +- d8/dfc/hexadecimal__to__octal2_8c__incl.svg | 28 +- ...md_data_structures_array__r_e_a_d_m_e.html | 41 +- d9/d5c/struct_queue_rep__coll__graph.map | 4 +- d9/d5c/struct_queue_rep__coll__graph.svg | 44 +- d9/d66/group__machine__learning.html | 35 +- d9/d66/group__machine__learning.map | 10 +- d9/d66/group__machine__learning.md5 | 2 +- d9/d66/group__machine__learning.svg | 76 +- d9/d75/problem__15_2sol1_8c__incl.map | 2 +- d9/d75/problem__15_2sol1_8c__incl.svg | 6 +- d9/d7e/problem__20_2sol1_8c__incl.map | 2 +- d9/d7e/problem__20_2sol1_8c__incl.svg | 6 +- .../ode__semi__implicit__euler_8c__incl.map | 2 +- .../ode__semi__implicit__euler_8c__incl.svg | 6 +- d9/d8b/structmat__3x3__.html | 49 +- d9/d8b/structmat__3x3__.js | 5 +- d9/da7/problem__10_2sol2_8c.html | 124 +- d9/dc9/hash__crc32_8c.html | 78 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 5 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 52 + d9/dcc/adaline__learning_8c__incl.map | 10 +- d9/dcc/adaline__learning_8c__incl.svg | 38 +- d9/dcc/prim_8c.html | 530 +++++ d9/dcc/prim_8c.js | 9 + ...bea087eb586c437cf0a667f794c8853_cgraph.map | 4 + ...bea087eb586c437cf0a667f794c8853_cgraph.md5 | 1 + ...bea087eb586c437cf0a667f794c8853_cgraph.svg | 37 + ...f9e6b7e6f15df4b525a2e7705ba3089_cgraph.map | 7 + ...f9e6b7e6f15df4b525a2e7705ba3089_cgraph.md5 | 1 + ...f9e6b7e6f15df4b525a2e7705ba3089_cgraph.svg | 88 + ...f3f4c22009b2aa4e385a76a8a1cdc1c_cgraph.map | 5 + ...f3f4c22009b2aa4e385a76a8a1cdc1c_cgraph.md5 | 1 + ...f3f4c22009b2aa4e385a76a8a1cdc1c_cgraph.svg | 58 + d9/dd7/struct__cantor__set.html | 49 +- d9/deb/min__printf_8h.html | 881 +++++++++ d9/deb/min__printf_8h.js | 18 + ...a848efdf2ee124bba62e056eb9ab824_cgraph.map | 5 + ...a848efdf2ee124bba62e056eb9ab824_cgraph.md5 | 1 + ...a848efdf2ee124bba62e056eb9ab824_cgraph.svg | 52 + ...3e08c05f8c656a0fee465c2e8d2ecf9_cgraph.map | 10 + ...3e08c05f8c656a0fee465c2e8d2ecf9_cgraph.md5 | 1 + ...3e08c05f8c656a0fee465c2e8d2ecf9_cgraph.svg | 133 ++ ...d63203d920bebd6a96f5f4aeccb21e5_cgraph.map | 8 + ...d63203d920bebd6a96f5f4aeccb21e5_cgraph.md5 | 1 + ...d63203d920bebd6a96f5f4aeccb21e5_cgraph.svg | 103 + ...61e2407aab2c75e9837c77cab937d03_cgraph.map | 5 + ...61e2407aab2c75e9837c77cab937d03_cgraph.md5 | 1 + ...61e2407aab2c75e9837c77cab937d03_cgraph.svg | 52 + ...569209570eca8bc6770fb7d9dc873e6_cgraph.map | 4 + ...569209570eca8bc6770fb7d9dc873e6_cgraph.md5 | 1 + ...569209570eca8bc6770fb7d9dc873e6_cgraph.svg | 37 + d9/deb/min__printf_8h_source.html | 475 +++++ da/d02/binary__search__tree_8c.html | 583 +++--- da/d02/binary__search__tree_8c.js | 8 +- ...1151353aa2d9688934ed39208133241_cgraph.map | 3 + ...1151353aa2d9688934ed39208133241_cgraph.md5 | 1 + ...1151353aa2d9688934ed39208133241_cgraph.svg | 28 + ...1cc98830742bca57c0da81a0fb779f_cgraph.map} | 4 +- ...31cc98830742bca57c0da81a0fb779f_cgraph.md5 | 1 + ...1cc98830742bca57c0da81a0fb779f_cgraph.svg} | 28 +- ...f18adaaca5ecc410cfa16dd2a3684dc_cgraph.map | 3 + ...f18adaaca5ecc410cfa16dd2a3684dc_cgraph.md5 | 1 + ...f18adaaca5ecc410cfa16dd2a3684dc_cgraph.svg | 28 + ...83e8a91a3d25d7d000807f18ba2748_cgraph.map} | 4 +- ...983e8a91a3d25d7d000807f18ba2748_cgraph.md5 | 1 + ...983e8a91a3d25d7d000807f18ba2748_cgraph.svg | 43 + ...3152b9ccb4aa5cd4c1bacd4188bb2de_cgraph.md5 | 1 - ...48f3966920e2fd197906be1e151b127_cgraph.md5 | 1 - ...48f3966920e2fd197906be1e151b127_cgraph.svg | 37 - ...50f3debc5323bb7b71933effb64f30f_cgraph.map | 3 + ...50f3debc5323bb7b71933effb64f30f_cgraph.md5 | 1 + ...50f3debc5323bb7b71933effb64f30f_cgraph.svg | 28 + ...ff4c6248834a9944a1fb03a20230c9c_cgraph.map | 3 + ...ff4c6248834a9944a1fb03a20230c9c_cgraph.md5 | 1 + ...ff4c6248834a9944a1fb03a20230c9c_cgraph.svg | 28 + ...4a66d8b0c2b0d626aea45977e358c83_cgraph.map | 3 + ...4a66d8b0c2b0d626aea45977e358c83_cgraph.md5 | 1 + ...4a66d8b0c2b0d626aea45977e358c83_cgraph.svg | 28 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 9 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 142 ++ da/d07/tcp__half__duplex__client_8c.html | 351 ++++ da/d07/tcp__half__duplex__client_8c.js | 6 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 4 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 37 + da/d0b/alaw_8c__incl.map | 6 + da/d0b/alaw_8c__incl.md5 | 1 + da/d0b/alaw_8c__incl.svg | 67 + da/d23/list_8h_source.html | 79 +- da/d2a/group__adaline.html | 283 ++- da/d2a/group__adaline.js | 2 +- da/d2a/group__adaline.map | 4 +- da/d2a/group__adaline.svg | 20 +- ...0d3642e0a87f36fdb7bf91b023cd166_cgraph.map | 6 +- ...0d3642e0a87f36fdb7bf91b023cd166_cgraph.svg | 28 +- ...52120912e32d2893fe1c6d78da5befd_cgraph.map | 10 +- ...52120912e32d2893fe1c6d78da5befd_cgraph.md5 | 2 +- ...52120912e32d2893fe1c6d78da5befd_cgraph.svg | 46 +- ...70b578aee679005fd336073969c3d94_cgraph.map | 4 +- ...70b578aee679005fd336073969c3d94_cgraph.svg | 20 +- da/d31/exponential__search_8c__incl.map | 5 + da/d31/exponential__search_8c__incl.md5 | 1 + da/d31/exponential__search_8c__incl.svg | 53 + da/d35/problem__1_2sol1_8c.html | 92 +- da/d38/durand__kerner__roots_8c.html | 433 ++-- da/d38/durand__kerner__roots_8c.js | 2 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.map | 6 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 | 2 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.svg | 34 +- da/d56/problem__1_2sol3_8c.html | 112 +- da/d6c/exponential__search_8c.html | 387 ++++ da/d6c/exponential__search_8c.js | 8 + ...2d4de0907b9601a376febf50955bacd_cgraph.map | 4 + ...2d4de0907b9601a376febf50955bacd_cgraph.md5 | 1 + ...2d4de0907b9601a376febf50955bacd_cgraph.svg | 43 + ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 5 + ...8dca7b867074164d5f45b0f3851269d_cgraph.md5 | 1 + ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 58 + ...e97ef76c065e91c188f1f8c8076869a_cgraph.map | 3 + ...e97ef76c065e91c188f1f8c8076869a_cgraph.md5 | 1 + ...e97ef76c065e91c188f1f8c8076869a_cgraph.svg | 28 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 6 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 73 + da/d81/prime_8c__incl.map | 4 +- da/d81/prime_8c__incl.svg | 18 +- .../stack__linked__list_2stack_8h_source.html | 61 +- da/d93/prime_8c.html | 131 +- ...1a3968e7947464bee7714f6d43b7002_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- da/d96/infix__to__postfix2_8c.html | 501 +++++ da/d96/infix__to__postfix2_8c.js | 13 + ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 9 + ...8dca7b867074164d5f45b0f3851269d_cgraph.md5 | 1 + ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 112 ++ ...363a3863a8bfbf40e7a95c2b9dbe71b_cgraph.map | 8 + ...363a3863a8bfbf40e7a95c2b9dbe71b_cgraph.md5 | 1 + ...363a3863a8bfbf40e7a95c2b9dbe71b_cgraph.svg | 97 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 10 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 133 ++ da/d9b/struct_trie_node.html | 41 +- da/d9b/struct_trie_node.js | 6 - da/da0/segment__tree_8c.html | 287 ++- da/da0/segment__tree_8c.js | 2 +- ...13a2b7c3f1d15aa3d019af1f834cde_cgraph.map} | 4 +- ...13a2b7c3f1d15aa3d019af1f834cde_cgraph.md5} | 0 ...13a2b7c3f1d15aa3d019af1f834cde_cgraph.svg} | 20 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 14 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.md5 | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 66 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 14 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 66 +- da/dd5/spirograph_8c__incl.map | 10 +- da/dd5/spirograph_8c__incl.svg | 46 +- da/de2/shell__sort2_8c__incl.map | 2 +- da/de2/shell__sort2_8c__incl.svg | 4 +- da/de6/udp__client_8c.html | 127 +- da/dfd/kohonen__som__trace_8c__incl.map | 2 +- da/dfd/kohonen__som__trace_8c__incl.svg | 6 +- db/d01/problem__13_2sol1_8c.html | 339 +++- ...40291bc02cba5474a4cb46a9b9566fe_cgraph.map | 7 + ...40291bc02cba5474a4cb46a9b9566fe_cgraph.md5 | 1 + ...40291bc02cba5474a4cb46a9b9566fe_cgraph.svg | 82 + db/d0c/infix__to__postfix_8c.html | 351 ++-- ...2af69ffc1e1f965ebce6a44672e96b1_cgraph.map | 10 +- ...2af69ffc1e1f965ebce6a44672e96b1_cgraph.svg | 48 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 10 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 48 +- db/d17/structtnode__coll__graph.map | 2 +- db/d17/structtnode__coll__graph.svg | 22 +- db/d28/struct_t__coll__graph.svg | 4 +- db/d37/int__to__string_8c__incl.map | 2 +- db/d37/int__to__string_8c__incl.svg | 6 +- db/d45/qr__decomposition_8c__incl.map | 10 +- db/d45/qr__decomposition_8c__incl.svg | 60 +- db/d50/problem__4_2sol_8c__incl.map | 4 +- db/d50/problem__4_2sol_8c__incl.svg | 20 +- db/d74/problem__13_2sol1_8c__incl.map | 2 +- db/d74/problem__13_2sol1_8c__incl.svg | 6 +- db/d80/problem__20_2sol1_8c.html | 314 ++- db/d80/problem__20_2sol1_8c.js | 2 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.map | 5 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 | 1 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.svg | 58 + ...4a02c4b963fdb16f24959e0137763f1_cgraph.map | 3 + ...4a02c4b963fdb16f24959e0137763f1_cgraph.md5 | 1 + ...4a02c4b963fdb16f24959e0137763f1_cgraph.svg | 28 + db/d83/problem__12_2sol1_8c__incl.map | 2 +- db/d83/problem__12_2sol1_8c__incl.svg | 6 +- db/d84/malloc__dbg_8c.html | 479 +++-- db/d84/malloc__dbg_8c.js | 6 +- ...0238aaeea60178d31fbb74347e941aa_cgraph.md5 | 1 - ...0238aaeea60178d31fbb74347e941aa_cgraph.svg | 82 - ...914d05ba1fe8848aa1b48cda719422_cgraph.map} | 10 +- ...7914d05ba1fe8848aa1b48cda719422_cgraph.md5 | 1 + ...7914d05ba1fe8848aa1b48cda719422_cgraph.svg | 82 + ...7f946b77155ca78d0e14e231a99f5d_cgraph.map} | 6 +- ...07f946b77155ca78d0e14e231a99f5d_cgraph.md5 | 1 + ...07f946b77155ca78d0e14e231a99f5d_cgraph.svg | 30 +- ...c6b5ee323e5338f23a1ce6fe9974f25_cgraph.md5 | 1 - db/d8b/struct_node.html | 71 +- db/d8b/struct_node.js | 7 +- db/dd4/structlist__coll__graph.svg | 2 +- db/dd5/prime__seive_8c.html | 45 +- db/dd8/problem__26_2sol1_8c__incl.map | 2 +- db/dd8/problem__26_2sol1_8c__incl.svg | 6 +- db/ddb/hello__world_8h_source.html | 43 +- db/ddf/insertion__sort_8c.html | 143 +- db/ddf/insertion__sort_8c.js | 1 - ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 16 +- db/de2/naval__battle_8c.html | 1745 ++++++++--------- ...f7d3dc5931fba6164e73057859094d9_cgraph.map | 6 +- ...f7d3dc5931fba6164e73057859094d9_cgraph.svg | 28 +- ...c84d83e31ca6a320b6ea8081402686a_cgraph.map | 4 +- ...c84d83e31ca6a320b6ea8081402686a_cgraph.svg | 20 +- ...527fa96e729742a231c4535e112526a_cgraph.map | 4 +- ...527fa96e729742a231c4535e112526a_cgraph.svg | 20 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 22 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 104 +- ...ecimal__to__binary__recursion_8c__incl.map | 4 +- ...ecimal__to__binary__recursion_8c__incl.svg | 20 +- db/dff/durand__kerner__roots_8c__incl.map | 2 +- db/dff/durand__kerner__roots_8c__incl.svg | 6 +- dc/d18/structsudoku.html | 47 +- dc/d23/problem__23_2sol2_8c__incl.map | 2 +- dc/d23/problem__23_2sol2_8c__incl.svg | 6 +- dc/d2e/lu__decompose_8c.html | 266 ++- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.map | 5 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 | 1 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.svg | 52 + dc/d32/problem__5_2sol1_8c.html | 93 +- ...40291bc02cba5474a4cb46a9b9566fe_cgraph.map | 2 +- ...40291bc02cba5474a4cb46a9b9566fe_cgraph.svg | 16 +- dc/d39/selection__sort__recursive_8c.html | 191 +- ...f04d850b94a34dcaaed0e7bc7475241_cgraph.map | 6 +- ...f04d850b94a34dcaaed0e7bc7475241_cgraph.md5 | 2 +- ...f04d850b94a34dcaaed0e7bc7475241_cgraph.svg | 40 +- ...2bc8bdd2e8ce289a6b8ef528fd1a534_cgraph.map | 3 + ...2bc8bdd2e8ce289a6b8ef528fd1a534_cgraph.md5 | 1 + ...2bc8bdd2e8ce289a6b8ef528fd1a534_cgraph.svg | 28 + ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 8 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.md5 | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 40 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 10 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 40 +- dc/d41/geometry__datatypes_8h__dep__incl.map | 6 +- dc/d41/geometry__datatypes_8h__dep__incl.svg | 28 +- dc/d47/realtime__stats_8c.html | 293 +-- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.map | 6 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 | 1 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.svg | 79 + ...54c915581fcc495489175a4386d59fd_cgraph.map | 4 +- ...54c915581fcc495489175a4386d59fd_cgraph.svg | 24 +- dc/d52/problem__16_2sol1_8c__incl.map | 2 +- dc/d52/problem__16_2sol1_8c__incl.svg | 6 +- dc/d55/problem__14_2sol1_8c__incl.map | 6 +- dc/d55/problem__14_2sol1_8c__incl.svg | 28 +- dc/d5f/qr__decompose_8h__dep__incl.map | 6 +- dc/d5f/qr__decompose_8h__dep__incl.svg | 32 +- dc/d63/problem__8_2sol1_8c.html | 227 ++- ...ddf1224851353fc92bfbff6f499fa97_cgraph.map | 5 + ...ddf1224851353fc92bfbff6f499fa97_cgraph.md5 | 1 + ...ddf1224851353fc92bfbff6f499fa97_cgraph.svg | 52 + ...ffc8845f17b01a353767a40a3adf7bd_cgraph.map | 4 +- ...ffc8845f17b01a353767a40a3adf7bd_cgraph.svg | 20 +- dc/d64/md__coding_guidelines.html | 39 +- dc/d77/struct__big__int.html | 49 +- dc/d80/cantor__set_8c.html | 246 ++- ...f156d2b53b80305bd2fa3ff5fdf3c97_cgraph.map | 4 +- ...f156d2b53b80305bd2fa3ff5fdf3c97_cgraph.md5 | 2 +- ...f156d2b53b80305bd2fa3ff5fdf3c97_cgraph.svg | 30 +- ...5df3c64a683100ac6246e1e034df43d_cgraph.map | 3 + ...5df3c64a683100ac6246e1e034df43d_cgraph.md5 | 1 + ...5df3c64a683100ac6246e1e034df43d_cgraph.svg | 28 + ...f9e6b7e6f15df4b525a2e7705ba3089_cgraph.map | 7 + ...f9e6b7e6f15df4b525a2e7705ba3089_cgraph.md5 | 1 + ...f9e6b7e6f15df4b525a2e7705ba3089_cgraph.svg | 94 + dc/d80/collatz_8c.html | 100 +- dc/d9a/group__quats.html | 179 +- dc/d9a/group__quats.js | 3 - dc/d9a/group__quats.map | 4 +- dc/d9a/group__quats.md5 | 2 +- dc/d9a/group__quats.svg | 34 +- dc/db4/md__r_e_v_i_e_w_e_r__c_o_d_e.html | 35 +- dc/dbe/poly__add_8c__incl.svg | 2 +- dc/dc7/sentinel__linear__search_8c__incl.map | 5 + dc/dc7/sentinel__linear__search_8c__incl.md5 | 1 + dc/dc7/sentinel__linear__search_8c__incl.svg | 53 + dc/dc9/bubble__sort__recursion_8c__incl.map | 10 +- dc/dc9/bubble__sort__recursion_8c__incl.svg | 50 +- dc/dc9/infix__to__postfix_8c__incl.svg | 2 +- dc/dd4/kohonen__som__topology_8c__incl.map | 2 +- dc/dd4/kohonen__som__topology_8c__incl.svg | 6 +- dc/dd5/problem__7_2sol2_8c__incl.map | 4 +- dc/dd5/problem__7_2sol2_8c__incl.svg | 20 +- dc/de3/hash__set_8h_source.html | 97 +- dc/de5/structsubset.html | 37 +- dc/de5/structsubset.js | 5 - dd/d06/structsegment__tree.html | 55 +- dd/d06/structterm__coll__graph.svg | 2 +- dd/d08/newton__raphson__root_8c.html | 144 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.map | 5 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 | 1 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.svg | 52 + dd/d10/struct_stack.html | 67 +- dd/d10/struct_stack.js | 4 +- dd/d11/test__malloc__dbg_8c.html | 63 +- dd/d24/problem__19_2sol1_8c__incl.map | 4 +- dd/d24/problem__19_2sol1_8c__incl.svg | 20 +- dd/d29/doubly__linked__list_8c.html | 423 ++-- ...4ac29c396dc8335a5827927183c9918_cgraph.svg | 2 +- ...fadec32fc369a8dcfbcd766e166efa0_cgraph.map | 3 + ...fadec32fc369a8dcfbcd766e166efa0_cgraph.md5 | 1 + ...fadec32fc369a8dcfbcd766e166efa0_cgraph.svg | 28 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 12 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 72 +- ...dd04074dbc6af0de89051f97209311b_cgraph.map | 3 + ...dd04074dbc6af0de89051f97209311b_cgraph.md5 | 1 + ...dd04074dbc6af0de89051f97209311b_cgraph.svg | 28 + ...a2b50f4716fc3b42221a72e676e1422_cgraph.map | 10 +- ...a2b50f4716fc3b42221a72e676e1422_cgraph.md5 | 2 +- ...a2b50f4716fc3b42221a72e676e1422_cgraph.svg | 64 +- dd/d2f/udp__server_8c__incl.map | 20 +- dd/d2f/udp__server_8c__incl.svg | 82 +- dd/d2f/udp__server_8c__incl_org.svg | 84 +- dd/d3d/tcp__half__duplex__server_8c__incl.map | 12 + dd/d3d/tcp__half__duplex__server_8c__incl.md5 | 1 + dd/d3d/tcp__half__duplex__server_8c__incl.svg | 246 +++ ...tcp__half__duplex__server_8c__incl_org.svg | 158 ++ dd/d53/int__to__string_8c.html | 179 +- dd/d53/int__to__string_8c.js | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.md5 | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 18 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 5 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 52 + dd/d75/structqueue__coll__graph.map | 4 +- dd/d75/structqueue__coll__graph.svg | 44 +- dd/d77/so1_8c__incl.map | 4 +- dd/d77/so1_8c__incl.svg | 20 +- dd/d7a/group__matrix.html | 41 +- dd/d7a/group__matrix.js | 5 +- dd/d7a/group__matrix.map | 2 +- dd/d7a/group__matrix.svg | 16 +- dd/d85/hash__adler32_8c__incl.map | 2 +- dd/d85/hash__adler32_8c__incl.svg | 4 +- dd/d8b/problem__22_2sol1_8c.html | 290 ++- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.map | 5 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 | 1 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.svg | 52 + dd/d8c/adaline__learning_8c.html | 434 ++-- dd/d8c/adaline__learning_8c.js | 2 +- ...5cc9a0acb524fde727a4d7b4a747ee6_cgraph.map | 14 +- ...5cc9a0acb524fde727a4d7b4a747ee6_cgraph.md5 | 2 +- ...5cc9a0acb524fde727a4d7b4a747ee6_cgraph.svg | 74 +- ...a0acb524fde727a4d7b4a747ee6_cgraph_org.svg | 74 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.map | 13 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 | 1 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.svg | 332 ++++ ...38a5bfe5d72780bb7e82a18e627_cgraph_org.svg | 244 +++ ...f37b9f073f7e57fd0b39d70718af1b1_cgraph.map | 14 +- ...f37b9f073f7e57fd0b39d70718af1b1_cgraph.md5 | 2 +- ...f37b9f073f7e57fd0b39d70718af1b1_cgraph.svg | 74 +- ...9f073f7e57fd0b39d70718af1b1_cgraph_org.svg | 74 +- ...4ecb3accf5d9e0263087e7265bbe3a9_cgraph.map | 14 +- ...4ecb3accf5d9e0263087e7265bbe3a9_cgraph.md5 | 2 +- ...4ecb3accf5d9e0263087e7265bbe3a9_cgraph.svg | 74 +- ...3accf5d9e0263087e7265bbe3a9_cgraph_org.svg | 74 +- dd/d93/client_8c.html | 191 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 4 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 37 + dd/d95/word__count_8h_source.html | 87 +- dd/d99/heap__sort__2_8c__incl.map | 8 + dd/d99/heap__sort__2_8c__incl.md5 | 1 + dd/d99/heap__sort__2_8c__incl.svg | 97 + dd/da2/structbuffer.html | 128 ++ dd/db8/test__malloc__dbg_8c__incl.map | 4 +- dd/db8/test__malloc__dbg_8c__incl.svg | 20 +- dd/dd7/malloc__dbg_8h__dep__incl.map | 6 +- dd/dd7/malloc__dbg_8h__dep__incl.svg | 32 +- dd/de4/bubble__sort_8c.html | 213 +- ...8989f6c9bfd1f040854fa18b180114f_cgraph.map | 4 +- ...8989f6c9bfd1f040854fa18b180114f_cgraph.svg | 20 +- ...0f2228420376f4db7e1274f2b41667c_cgraph.map | 6 + ...0f2228420376f4db7e1274f2b41667c_cgraph.md5 | 1 + ...0f2228420376f4db7e1274f2b41667c_cgraph.svg | 67 + ...1a3968e7947464bee7714f6d43b7002_cgraph.map | 5 + ...1a3968e7947464bee7714f6d43b7002_cgraph.md5 | 1 + ...1a3968e7947464bee7714f6d43b7002_cgraph.svg | 52 + dd/deb/structquaternion____coll__graph.map | 4 +- dd/deb/structquaternion____coll__graph.svg | 22 +- dd/deb/tcp__half__duplex__client_8c__incl.map | 12 + dd/deb/tcp__half__duplex__client_8c__incl.md5 | 1 + dd/deb/tcp__half__duplex__client_8c__incl.svg | 246 +++ ...tcp__half__duplex__client_8c__incl_org.svg | 158 ++ dd/df0/problem__19_2sol1_8c.html | 194 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.map | 5 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 | 1 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.svg | 52 + dd/df2/problem__1_2sol2_8c__incl.map | 4 +- dd/df2/problem__1_2sol2_8c__incl.svg | 20 +- de/d0c/insertion__sort__recursive_8c.html | 89 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 4 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.md5 | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 24 +- ...0f2228420376f4db7e1274f2b41667c_cgraph.map | 6 +- ...0f2228420376f4db7e1274f2b41667c_cgraph.md5 | 2 +- ...0f2228420376f4db7e1274f2b41667c_cgraph.svg | 24 +- de/d0e/hash__xor8_8c__incl.map | 2 +- de/d0e/hash__xor8_8c__incl.svg | 4 +- de/d16/server_8c__incl.map | 10 +- de/d16/server_8c__incl.svg | 56 +- de/d1c/prim_8c__incl.map | 7 + de/d1c/prim_8c__incl.md5 | 1 + de/d1c/prim_8c__incl.svg | 82 + ...ta_structures_dictionary__r_e_a_d_m_e.html | 39 +- de/d4e/lu__decompose_8c__incl.map | 2 +- de/d4e/lu__decompose_8c__incl.svg | 6 +- de/d50/min__printf_8h__dep__incl.map | 4 + de/d50/min__printf_8h__dep__incl.md5 | 1 + de/d50/min__printf_8h__dep__incl.svg | 39 + de/d58/structquaternion__.html | 49 +- de/d58/structquaternion__.js | 3 - de/d5a/group__quaternions.html | 43 +- de/d5a/group__quaternions.js | 5 - de/d5a/group__quaternions.map | 10 +- de/d5a/group__quaternions.md5 | 2 +- de/d5a/group__quaternions.svg | 100 +- de/d5e/bubble__sort_8c__incl.map | 10 +- de/d5e/bubble__sort_8c__incl.svg | 48 +- de/d7b/group__vec__3d.html | 315 +-- de/d7b/group__vec__3d.js | 3 +- de/d7b/group__vec__3d.map | 4 +- de/d7b/group__vec__3d.md5 | 2 +- de/d7b/group__vec__3d.svg | 34 +- ...cdfd8378a0b115563ea6c561bb46b7e_cgraph.map | 6 +- ...cdfd8378a0b115563ea6c561bb46b7e_cgraph.svg | 28 +- ...5be1d766c8a824b35d97e79744834d8_cgraph.map | 5 + ...5be1d766c8a824b35d97e79744834d8_cgraph.md5 | 1 + ...5be1d766c8a824b35d97e79744834d8_cgraph.svg | 58 + ...4805165d037d111d7d7c0df99e3a5de_cgraph.map | 4 +- ...4805165d037d111d7d7c0df99e3a5de_cgraph.svg | 20 +- de/dac/sudoku__solver_8c.html | 147 +- de/dac/sudoku__solver_8c.js | 3 +- de/dce/structmin__heap.html | 39 +- de/dce/structmin__heap.js | 6 - de/dd7/prime__seive_8c__incl.map | 2 +- de/dd7/prime__seive_8c__incl.svg | 4 +- de/dff/heap__sort__2_8c.html | 471 +++++ de/dff/heap__sort__2_8c.js | 9 + ...0cd944b33a5fe5972111ded9b49793c_cgraph.map | 4 + ...0cd944b33a5fe5972111ded9b49793c_cgraph.md5 | 1 + ...0cd944b33a5fe5972111ded9b49793c_cgraph.svg | 37 + ...19753b978f962aa2337e1fdb4e59e33_cgraph.map | 4 + ...19753b978f962aa2337e1fdb4e59e33_cgraph.md5 | 1 + ...19753b978f962aa2337e1fdb4e59e33_cgraph.svg | 37 + ...72a47d865e7fa18f1ff23001ef4a485_cgraph.map | 6 + ...72a47d865e7fa18f1ff23001ef4a485_cgraph.md5 | 1 + ...72a47d865e7fa18f1ff23001ef4a485_cgraph.svg | 79 + ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 7 + ...8dca7b867074164d5f45b0f3851269d_cgraph.md5 | 1 + ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 94 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 8 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 109 + df/d16/palindrome_8c.html | 102 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 4 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 37 + df/d1a/problem__21_2sol1_8c.html | 188 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.map | 4 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 | 1 + ...c04138a5bfe5d72780bb7e82a18e627_cgraph.svg | 37 + df/d23/struct__cantor__set__coll__graph.map | 2 +- df/d23/struct__cantor__set__coll__graph.svg | 18 +- df/d27/alaw_8c.html | 519 +++++ df/d27/alaw_8c.js | 8 + ...ddf1224851353fc92bfbff6f499fa97_cgraph.map | 4 + ...ddf1224851353fc92bfbff6f499fa97_cgraph.md5 | 1 + ...ddf1224851353fc92bfbff6f499fa97_cgraph.svg | 37 + df/d29/problem__7_2sol_8c__incl.map | 6 +- df/d29/problem__7_2sol_8c__incl.svg | 28 +- df/d3b/binary__search_8c.html | 232 ++- ...0855c608ca64048d04cff6526f0a582_cgraph.map | 3 + ...0855c608ca64048d04cff6526f0a582_cgraph.md5 | 1 + ...0855c608ca64048d04cff6526f0a582_cgraph.svg | 28 + ...40291bc02cba5474a4cb46a9b9566fe_cgraph.map | 6 + ...40291bc02cba5474a4cb46a9b9566fe_cgraph.md5 | 1 + ...40291bc02cba5474a4cb46a9b9566fe_cgraph.svg | 73 + ...1a3968e7947464bee7714f6d43b7002_cgraph.map | 5 + ...1a3968e7947464bee7714f6d43b7002_cgraph.md5 | 1 + ...1a3968e7947464bee7714f6d43b7002_cgraph.svg | 58 + df/d3c/threaded__binary__trees_8c.html | 569 ++++-- df/d3c/threaded__binary__trees_8c.js | 2 +- ...c1e06b5f0876ec9c1bd6817f3b7eda7_cgraph.map | 3 + ...c1e06b5f0876ec9c1bd6817f3b7eda7_cgraph.md5 | 1 + ...c1e06b5f0876ec9c1bd6817f3b7eda7_cgraph.svg | 28 + ...a82ae0ee13788be51ca4ba6cddb0719_cgraph.map | 3 + ...a82ae0ee13788be51ca4ba6cddb0719_cgraph.md5 | 1 + ...a82ae0ee13788be51ca4ba6cddb0719_cgraph.svg | 28 + ...169ba0dfd5b8183672e444d1434bf9c_cgraph.map | 3 + ...169ba0dfd5b8183672e444d1434bf9c_cgraph.md5 | 1 + ...169ba0dfd5b8183672e444d1434bf9c_cgraph.svg | 28 + ...23432888332fc9f0aa6072cff28c3bb_cgraph.map | 4 + ...23432888332fc9f0aa6072cff28c3bb_cgraph.md5 | 1 + ...23432888332fc9f0aa6072cff28c3bb_cgraph.svg | 37 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 10 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 145 ++ df/d43/postfix__evaluation_8c.html | 393 ++++ df/d43/postfix__evaluation_8c.js | 10 + ...494492c8fc2509f602acc8228a3b623_cgraph.map | 5 + ...494492c8fc2509f602acc8228a3b623_cgraph.md5 | 1 + ...494492c8fc2509f602acc8228a3b623_cgraph.svg | 52 + ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 6 + ...8dca7b867074164d5f45b0f3851269d_cgraph.md5 | 1 + ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 67 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 7 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 82 + df/d58/md_leetcode__r_e_a_d_m_e.html | 205 +- df/d83/selection__sort_8c.html | 167 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...0f2228420376f4db7e1274f2b41667c_cgraph.map | 6 + ...0f2228420376f4db7e1274f2b41667c_cgraph.md5 | 1 + ...0f2228420376f4db7e1274f2b41667c_cgraph.svg | 67 + ...afe7419cfceaeccaf49f22842d9a617_cgraph.svg | 2 +- df/d86/structterm.html | 47 +- df/d98/quaternions_8c.html | 121 +- df/d98/quaternions_8c.js | 4 +- df/da5/problem__9_2sol1_8c.html | 85 +- df/da6/naval__battle_8c__incl.map | 4 +- df/da6/naval__battle_8c__incl.svg | 20 +- df/db0/factorial__large__number_8c__incl.map | 2 +- df/db0/factorial__large__number_8c__incl.svg | 6 +- df/db3/struct_l.html | 37 +- df/db3/struct_l.js | 5 - df/dbc/problem__6_2sol_8c__incl.map | 4 +- df/dbc/problem__6_2sol_8c__incl.svg | 20 +- df/dc6/acronym_8h_source.html | 43 +- df/dda/ode__midpoint__euler_8c__incl.map | 2 +- df/dda/ode__midpoint__euler_8c__incl.svg | 6 +- df/ddb/structword__count__word.html | 37 +- df/ddb/structword__count__word.js | 5 - df/ddc/cantor__set_8c__incl.map | 2 +- df/ddc/cantor__set_8c__incl.svg | 4 +- df/ddc/struct_node__coll__graph.map | 2 +- df/ddc/struct_node__coll__graph.md5 | 2 +- df/ddc/struct_node__coll__graph.svg | 26 +- df/ddf/structmat__3x3____coll__graph.map | 4 +- df/ddf/structmat__3x3____coll__graph.svg | 20 +- df/dea/structdata.html | 37 +- df/dea/structdata.js | 5 - df/df3/union__find_8c.html | 169 +- ...e13b69cce5a1b25ae034798092f3d86_cgraph.map | 3 + ...e13b69cce5a1b25ae034798092f3d86_cgraph.md5 | 1 + ...e13b69cce5a1b25ae034798092f3d86_cgraph.svg | 28 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 5 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 64 + ...2f3ff6d98641f7d3be11f071c97908a_cgraph.map | 4 +- ...2f3ff6d98641f7d3be11f071c97908a_cgraph.md5 | 2 +- ...2f3ff6d98641f7d3be11f071c97908a_cgraph.svg | 24 +- dir_03902f230b9e9b7c999f936617a23997.html | 33 +- dir_0472225043064b54f3dfff9011a9fae0.html | 31 +- dir_079e1f799fb08a8a0b98cb030ab15687.html | 37 +- dir_0bc3e2a5baf077fa21dadc079776fcac.html | 37 +- dir_167af11096b7752ff31b3d4bec489317.html | 37 +- dir_16b947d8e9a05fe119d0675493324331.html | 41 +- dir_16e00c78ef36d1842d0d8a4afc46b852.html | 37 +- dir_1833eb69ceee7a265ffba4c38c8243d2.html | 37 +- dir_18cba55772148686552805a354a79093.html | 37 +- dir_2176ba3565d8b1fe2a106d18679cc7bf.html | 33 +- dir_261dd1200fad5b2fe1eca9af8320656e.html | 37 +- dir_2abe2c0880d3fb0dba0f784bee3fc9e0.html | 37 +- dir_2b14f32f14b51065d3a322bea21da3c0.html | 37 +- dir_2e746e9d06bf2d8ff842208bcc6ebcfc.html | 33 +- dir_2e746e9d06bf2d8ff842208bcc6ebcfc.js | 1 + dir_2f070f19f76dfadabbc24fe483d7e98d.html | 37 +- dir_2fede762f95c9c526850a639b984c56b.html | 31 +- dir_32e2b2b829773774d6890224447e777d.html | 31 +- dir_3343723ae086de42ee4ca9774da3a13f.html | 47 +- dir_3c8f35d77556eca8a7a90921c2c197ad.html | 31 +- dir_4500de955d1eddb82f69331d96e39ed9.html | 31 +- dir_475f56e0a4ef6254f5610544d8d68aa3.html | 31 +- dir_48bf5503321d91c557399989fed5dabd.html | 33 +- dir_4991c92e00761dd3d764efa2906b4318.html | 37 +- dir_4a15c8553efb9e59e3f1091cc0d3a27d.html | 41 +- dir_4b6f782e158b0b98da980a0e11a23a15.html | 37 +- dir_4bae997a2671812c2140d5abfb6305a4.html | 41 +- dir_607f15d36c772334f988bb9ef82d102c.html | 45 +- dir_614f310c248f2b9541b559085cafcb40.html | 31 +- dir_72aaf47615111200018c039a56ef48be.html | 53 +- dir_7445e5a68245b48f3c03982b6d501815.html | 31 +- dir_76784a7b04633629b9ecb5543b9ad889.html | 31 +- dir_81f43aa0067826ea5befe80cd7aefcc5.html | 31 +- dir_8c6743d405e8ed13cc39f42e382307fd.html | 49 +- dir_955029374964e51cf770754b424e7d39.html | 31 +- dir_9babc524d57e25f3d9f4179cabc3599e.html | 53 +- dir_9babc524d57e25f3d9f4179cabc3599e.js | 2 + dir_9c6faab82c22511b50177aa2e38e2780.html | 69 +- dir_a4300992e825aa9b9238bf43160a241e.html | 38 +- dir_a4300992e825aa9b9238bf43160a241e.js | 4 + dir_a52f4d3d586a58b02f3a4ddf0a992157.html | 74 +- dir_a52f4d3d586a58b02f3a4ddf0a992157.js | 1 + dir_a5f32cf82ad289a7dac212f63f40f55b.html | 113 ++ dir_a5f32cf82ad289a7dac212f63f40f55b.js | 4 + dir_aba97bf327db94061e830e9bc18e925d.html | 37 +- dir_abf1a26ece768c4076e73592705ae077.html | 45 +- dir_abf1a26ece768c4076e73592705ae077.js | 4 +- dir_b2dbfa46230fd9f775c32c1836ed3764.html | 41 +- dir_b3d331eabd4234f247030c297aaf021c.html | 33 +- dir_b6018f60d424a2ef7e4c942ac681e38b.html | 31 +- dir_bb1b521853a9c46347182a9d10420771.html | 79 +- dir_bb1b521853a9c46347182a9d10420771.js | 2 + dir_bd4a7dd282074645ef41b1ea31ac813a.html | 31 +- dir_c7ef0fcb2f2095a74f0a3a1634dfc798.html | 31 +- dir_d20ad0b8de644c123692ba5582cc7a7b.html | 53 +- dir_d20ad0b8de644c123692ba5582cc7a7b.js | 4 + dir_d4c35186c199e728d69dee6bf5b2473c.html | 41 +- dir_d9112ab06cf4d4e5a25d385a268d1949.html | 37 +- dir_d9e100c82ada2163abea49688a71e81c.html | 37 +- dir_da574daf9ce9c05b45556bdc871ed1e3.html | 56 +- dir_da574daf9ce9c05b45556bdc871ed1e3.js | 5 +- dir_e3380d2178455503f266746fb14246a5.html | 39 +- dir_e39df94f82619fa5256f1786519937be.html | 42 +- dir_e39df94f82619fa5256f1786519937be.js | 3 +- dir_e79632891301b850df87e9c0030293fa.html | 37 +- dir_eeeea13e3a5e5edad3499183767ce312.html | 37 +- dir_f75ccd45e00436eafed446b9b2682984.html | 41 +- dir_f7d3c03fcac84aef1b0c66cc497ed1ea.html | 37 +- dir_fb09f588f9daea69f78b63a0310e98cc.html | 106 + dir_fb09f588f9daea69f78b63a0310e98cc.js | 4 + dir_fbc6c771d18f1a35ad2bd30260ea0fc8.html | 31 +- dir_fe5d69ed7d90cb356556070c2a2e5478.html | 31 +- doxygen.css | 40 +- files.html | 386 ++-- files_dup.js | 2 + functions.html | 304 +-- functions_vars.html | 304 +-- globals.html | 42 +- globals_a.html | 86 +- globals_b.html | 65 +- globals_c.html | 123 +- globals_d.html | 84 +- globals_defs.html | 174 +- globals_dup.js | 1 + globals_e.html | 67 +- globals_f.html | 75 +- globals_func.html | 35 +- globals_func.js | 1 + globals_func_a.html | 69 +- globals_func_b.html | 56 +- globals_func_c.html | 111 +- globals_func_d.html | 76 +- globals_func_e.html | 57 +- globals_func_f.html | 71 +- globals_func_g.html | 98 +- globals_func_h.html | 41 +- globals_func_i.html | 111 +- globals_func_j.html | 38 +- globals_func_k.html | 55 +- globals_func_l.html | 42 +- globals_func_m.html | 153 +- globals_func_n.html | 46 +- globals_func_o.html | 55 +- globals_func_p.html | 130 +- globals_func_q.html | 42 +- globals_func_r.html | 40 +- globals_func_s.html | 142 +- globals_func_t.html | 134 +- globals_func_u.html | 36 +- globals_func_v.html | 67 +- globals_func_w.html | 107 + globals_func_x.html | 34 +- globals_g.html | 98 +- globals_h.html | 41 +- globals_i.html | 112 +- globals_j.html | 38 +- globals_k.html | 55 +- globals_l.html | 55 +- globals_m.html | 228 +-- globals_n.html | 51 +- globals_o.html | 61 +- globals_p.html | 137 +- globals_q.html | 46 +- globals_r.html | 40 +- globals_s.html | 152 +- globals_t.html | 134 +- globals_type.html | 82 +- globals_u.html | 36 +- globals_v.html | 71 +- globals_vars.html | 49 +- globals_w.html | 107 + globals_x.html | 34 +- graph_legend.html | 39 +- graph_legend.svg | 80 +- index.html | 63 +- jquery.js | 4 +- menu.js | 86 +- menudata.js | 3 + modules.html | 31 +- navtree.css | 1 + navtree.js | 11 +- navtreedata.js | 54 +- navtreeindex0.js | 402 ++-- navtreeindex1.js | 368 ++-- navtreeindex2.js | 456 ++--- navtreeindex3.js | 404 ++-- pages.html | 33 +- resize.js | 20 +- search/all_0.html | 6 +- search/all_1.html | 6 +- search/all_1.js | 10 +- search/all_10.html | 6 +- search/all_10.js | 26 +- search/all_11.html | 6 +- search/all_11.js | 79 +- search/all_12.html | 6 +- search/all_12.js | 24 +- search/all_13.html | 6 +- search/all_13.js | 24 +- search/all_14.html | 6 +- search/all_14.js | 104 +- search/all_15.html | 6 +- search/all_15.js | 59 +- search/all_16.html | 6 +- search/all_16.js | 10 +- search/all_17.html | 6 +- search/all_17.js | 26 +- search/all_18.html | 6 +- search/all_18.js | 9 +- search/all_19.html | 6 +- search/all_19.js | 4 +- search/all_1a.html | 6 +- search/all_1a.js | 4 +- search/all_1b.html | 6 +- search/all_1b.js | 2 +- search/all_2.html | 6 +- search/all_2.js | 41 +- search/all_3.html | 6 +- search/all_3.js | 37 +- search/all_4.html | 6 +- search/all_4.js | 71 +- search/all_5.html | 6 +- search/all_5.js | 54 +- search/all_6.html | 6 +- search/all_6.js | 35 +- search/all_7.html | 6 +- search/all_7.js | 31 +- search/all_8.html | 6 +- search/all_8.js | 45 +- search/all_9.html | 6 +- search/all_9.js | 26 +- search/all_a.html | 6 +- search/all_a.js | 52 +- search/all_b.html | 6 +- search/all_b.js | 6 +- search/all_c.html | 6 +- search/all_c.js | 26 +- search/all_d.html | 6 +- search/all_d.js | 33 +- search/all_e.html | 6 +- search/all_e.js | 78 +- search/all_f.html | 6 +- search/all_f.js | 30 +- search/classes_0.html | 6 +- search/classes_0.js | 6 +- search/classes_1.html | 6 +- search/classes_1.js | 4 +- search/classes_10.html | 6 +- search/classes_10.js | 8 +- search/classes_11.html | 6 +- search/classes_11.js | 2 +- search/classes_12.html | 6 +- search/classes_12.js | 2 +- search/classes_2.html | 6 +- search/classes_2.js | 3 +- search/classes_3.html | 6 +- search/classes_3.js | 4 +- search/classes_4.html | 6 +- search/classes_4.js | 8 +- search/classes_5.html | 6 +- search/classes_5.js | 6 +- search/classes_6.html | 6 +- search/classes_6.js | 4 +- search/classes_7.html | 6 +- search/classes_7.js | 2 +- search/classes_8.html | 6 +- search/classes_8.js | 2 +- search/classes_9.html | 6 +- search/classes_9.js | 4 +- search/classes_a.html | 6 +- search/classes_a.js | 8 +- search/classes_b.html | 6 +- search/classes_b.js | 4 +- search/classes_c.html | 6 +- search/classes_c.js | 2 +- search/classes_d.html | 6 +- search/classes_d.js | 2 +- search/classes_e.html | 6 +- search/classes_e.js | 6 +- search/classes_f.html | 6 +- search/classes_f.js | 8 +- search/defines_0.html | 6 +- search/defines_0.js | 2 +- search/defines_1.html | 6 +- search/defines_1.js | 2 +- search/defines_2.html | 6 +- search/defines_2.js | 2 +- search/defines_3.html | 6 +- search/defines_3.js | 3 +- search/defines_4.html | 6 +- search/defines_4.js | 2 +- search/defines_5.html | 6 +- search/defines_5.js | 2 +- search/defines_6.html | 6 +- search/defines_6.js | 14 +- search/defines_7.html | 6 +- search/defines_7.js | 13 +- search/defines_8.html | 6 +- search/defines_8.js | 2 +- search/defines_9.html | 6 +- search/defines_9.js | 2 +- search/defines_a.html | 37 + search/defines_a.js | 4 + search/files_0.html | 6 +- search/files_0.js | 3 +- search/files_1.html | 6 +- search/files_1.js | 12 +- search/files_10.html | 6 +- search/files_10.js | 5 +- search/files_11.html | 6 +- search/files_11.js | 15 +- search/files_12.html | 6 +- search/files_12.js | 17 +- search/files_13.html | 6 +- search/files_13.js | 10 +- search/files_14.html | 6 +- search/files_14.js | 4 +- search/files_15.html | 37 + search/files_15.js | 4 + search/files_16.html | 37 + search/files_16.js | 4 + search/files_2.html | 6 +- search/files_2.js | 10 +- search/files_3.html | 6 +- search/files_3.js | 7 +- search/files_4.html | 6 +- search/files_4.js | 3 +- search/files_5.html | 6 +- search/files_5.js | 4 +- search/files_6.html | 6 +- search/files_6.js | 7 +- search/files_7.html | 6 +- search/files_7.js | 11 +- search/files_8.html | 6 +- search/files_8.js | 6 +- search/files_9.html | 6 +- search/files_9.js | 4 +- search/files_a.html | 6 +- search/files_a.js | 4 +- search/files_b.html | 6 +- search/files_b.js | 5 +- search/files_c.html | 6 +- search/files_c.js | 7 +- search/files_d.html | 6 +- search/files_d.js | 6 +- search/files_e.html | 6 +- search/files_e.js | 9 +- search/files_f.html | 6 +- search/files_f.js | 10 +- search/functions_0.html | 6 +- search/functions_0.js | 2 +- search/functions_1.html | 6 +- search/functions_1.js | 20 +- search/functions_10.html | 6 +- search/functions_10.js | 51 +- search/functions_11.html | 6 +- search/functions_11.js | 6 +- search/functions_12.html | 6 +- search/functions_12.js | 6 +- search/functions_13.html | 6 +- search/functions_13.js | 53 +- search/functions_14.html | 6 +- search/functions_14.js | 37 +- search/functions_15.html | 6 +- search/functions_15.js | 4 +- search/functions_16.html | 6 +- search/functions_16.js | 18 +- search/functions_17.html | 6 +- search/functions_17.js | 2 +- search/functions_18.html | 37 + search/functions_18.js | 4 + search/functions_2.html | 6 +- search/functions_2.js | 13 +- search/functions_3.html | 6 +- search/functions_3.js | 41 +- search/functions_4.html | 6 +- search/functions_4.js | 23 +- search/functions_5.html | 6 +- search/functions_5.js | 15 +- search/functions_6.html | 6 +- search/functions_6.js | 19 +- search/functions_7.html | 6 +- search/functions_7.js | 35 +- search/functions_8.html | 6 +- search/functions_8.js | 7 +- search/functions_9.html | 6 +- search/functions_9.js | 40 +- search/functions_a.html | 6 +- search/functions_a.js | 4 +- search/functions_b.html | 6 +- search/functions_b.js | 12 +- search/functions_c.html | 6 +- search/functions_c.js | 6 +- search/functions_d.html | 6 +- search/functions_d.js | 21 +- search/functions_e.html | 6 +- search/functions_e.js | 8 +- search/functions_f.html | 6 +- search/functions_f.js | 13 +- search/groups_0.html | 6 +- search/groups_0.js | 6 +- search/groups_1.html | 6 +- search/groups_1.js | 2 +- search/groups_2.html | 6 +- search/groups_2.js | 2 +- search/groups_3.html | 6 +- search/groups_3.js | 6 +- search/groups_4.html | 6 +- search/groups_4.js | 2 +- search/groups_5.html | 6 +- search/groups_5.js | 6 +- search/groups_6.html | 6 +- search/groups_6.js | 4 +- 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 | 2 +- search/pages_5.html | 6 +- search/pages_5.js | 4 +- search/pages_6.html | 6 +- search/pages_6.js | 2 +- search/pages_7.html | 6 +- search/pages_7.js | 4 +- search/pages_8.html | 6 +- search/pages_8.js | 2 +- search/search.css | 12 +- search/search.js | 66 +- search/searchdata.js | 6 +- search/typedefs_0.html | 6 +- search/typedefs_0.js | 3 +- search/typedefs_1.html | 6 +- search/typedefs_1.js | 4 +- search/typedefs_2.html | 6 +- search/typedefs_2.js | 2 +- search/typedefs_3.html | 6 +- search/typedefs_3.js | 2 +- search/typedefs_4.html | 6 +- search/typedefs_4.js | 4 +- search/typedefs_5.html | 6 +- search/typedefs_5.js | 4 +- search/typedefs_6.html | 6 +- search/typedefs_6.js | 2 +- search/typedefs_7.html | 6 +- search/typedefs_7.js | 2 +- search/typedefs_8.html | 6 +- search/typedefs_8.js | 2 +- search/typedefs_9.html | 6 +- search/typedefs_9.js | 2 +- search/variables_0.html | 6 +- search/variables_0.js | 6 +- search/variables_1.html | 6 +- search/variables_1.js | 4 +- search/variables_10.html | 6 +- search/variables_10.js | 3 +- search/variables_11.html | 6 +- search/variables_11.js | 2 +- search/variables_12.html | 6 +- search/variables_12.js | 5 +- search/variables_13.html | 6 +- search/variables_13.js | 2 +- search/variables_14.html | 6 +- search/variables_14.js | 4 +- search/variables_15.html | 6 +- search/variables_15.js | 2 +- search/variables_2.html | 6 +- search/variables_2.js | 6 +- search/variables_3.html | 6 +- search/variables_3.js | 14 +- search/variables_4.html | 6 +- search/variables_4.js | 8 +- search/variables_5.html | 6 +- search/variables_5.js | 5 +- search/variables_6.html | 6 +- search/variables_6.js | 2 +- search/variables_7.html | 6 +- search/variables_7.js | 2 +- search/variables_8.html | 6 +- search/variables_8.js | 2 +- search/variables_9.html | 6 +- search/variables_9.js | 8 +- search/variables_a.html | 6 +- search/variables_a.js | 4 +- search/variables_b.html | 6 +- search/variables_b.js | 12 +- search/variables_c.html | 6 +- search/variables_c.js | 12 +- search/variables_d.html | 6 +- search/variables_d.js | 2 +- search/variables_e.html | 6 +- search/variables_e.js | 16 +- search/variables_f.html | 6 +- search/variables_f.js | 4 +- tabs.css | 2 +- 1765 files changed, 53878 insertions(+), 23606 deletions(-) delete mode 100644 d0/d10/struct_queue_rep.js delete mode 100644 d0/d43/structpid.js create mode 100644 d0/d46/kohonen__som__trace_8c_a0283886819c7c140a023582b7269e2d0_cgraph_org.svg create mode 100644 d0/d46/kohonen__som__trace_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph_org.svg create mode 100644 d0/d46/kohonen__som__trace_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map create mode 100644 d0/d46/kohonen__som__trace_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 create mode 100644 d0/d46/kohonen__som__trace_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg create mode 100644 d0/d46/kohonen__som__trace_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph_org.svg create mode 100644 d0/d46/kohonen__som__trace_8c_a6d0455dd5c30adda100e95f0423c786e_cgraph_org.svg create mode 100644 d0/d57/hash__xor8_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 d0/d57/hash__xor8_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 d0/d57/hash__xor8_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg delete mode 100644 d0/d6b/structelem.js create mode 100644 d0/d6c/problem__4_2sol_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map create mode 100644 d0/d6c/problem__4_2sol_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.md5 create mode 100644 d0/d6c/problem__4_2sol_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg create mode 100644 d0/d6d/problem__10_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map create mode 100644 d0/d6d/problem__10_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 create mode 100644 d0/d6d/problem__10_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg create mode 100644 d0/d6d/problem__10_2sol1_8c_ae3d987cb2ad0ddb0c3caa4c2506a20e5_cgraph.map create mode 100644 d0/d6d/problem__10_2sol1_8c_ae3d987cb2ad0ddb0c3caa4c2506a20e5_cgraph.md5 create mode 100644 d0/d6d/problem__10_2sol1_8c_ae3d987cb2ad0ddb0c3caa4c2506a20e5_cgraph.svg rename d0/d8a/{octal__to__hexadecimal_8c_a042035b4ba7b92974f0edf6eb1b0cbe1_cgraph.map => octal__to__hexadecimal_8c_a823ef5170955cfef40e07d9a4d2e87e2_cgraph.map} (75%) rename d0/d8a/{octal__to__hexadecimal_8c_a042035b4ba7b92974f0edf6eb1b0cbe1_cgraph.md5 => octal__to__hexadecimal_8c_a823ef5170955cfef40e07d9a4d2e87e2_cgraph.md5} (100%) rename d0/d8a/{octal__to__hexadecimal_8c_a042035b4ba7b92974f0edf6eb1b0cbe1_cgraph.svg => octal__to__hexadecimal_8c_a823ef5170955cfef40e07d9a4d2e87e2_cgraph.svg} (62%) delete mode 100644 d0/d8a/structmax__heap.js delete mode 100644 d0/df1/structhash__set__t.js create mode 100644 d1/d20/server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 d1/d20/server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 d1/d20/server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg create mode 100644 d1/d6b/tcp__full__duplex__server_8c.html create mode 100644 d1/d6b/tcp__full__duplex__server_8c.js create mode 100644 d1/d6b/tcp__full__duplex__server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 d1/d6b/tcp__full__duplex__server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 d1/d6b/tcp__full__duplex__server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg create mode 100644 d1/d94/odd__even__sort_8c.html create mode 100644 d1/d94/odd__even__sort_8c.js create mode 100644 d1/d94/odd__even__sort_8c_a17761a0788916faded6e2ca1f478ad33_cgraph.map create mode 100644 d1/d94/odd__even__sort_8c_a17761a0788916faded6e2ca1f478ad33_cgraph.md5 create mode 100644 d1/d94/odd__even__sort_8c_a17761a0788916faded6e2ca1f478ad33_cgraph.svg create mode 100644 d1/d94/odd__even__sort_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map create mode 100644 d1/d94/odd__even__sort_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 create mode 100644 d1/d94/odd__even__sort_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg create mode 100644 d1/d94/odd__even__sort_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 d1/d94/odd__even__sort_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 d1/d94/odd__even__sort_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg create mode 100644 d1/d98/tcp__full__duplex__client_8c.html create mode 100644 d1/d98/tcp__full__duplex__client_8c.js create mode 100644 d1/d98/tcp__full__duplex__client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 d1/d98/tcp__full__duplex__client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 d1/d98/tcp__full__duplex__client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg create mode 100644 d1/dba/decimal__to__any__base_8c.html create mode 100644 d1/dba/decimal__to__any__base_8c.js create mode 100644 d1/dba/decimal__to__any__base_8c_a0c5ccb926a23bc0050f213ba3408e18d_cgraph.map create mode 100644 d1/dba/decimal__to__any__base_8c_a0c5ccb926a23bc0050f213ba3408e18d_cgraph.md5 create mode 100644 d1/dba/decimal__to__any__base_8c_a0c5ccb926a23bc0050f213ba3408e18d_cgraph.svg create mode 100644 d1/dba/decimal__to__any__base_8c_a3e4a7cfc97a528faa4d6e5741461109c_cgraph.map create mode 100644 d1/dba/decimal__to__any__base_8c_a3e4a7cfc97a528faa4d6e5741461109c_cgraph.md5 create mode 100644 d1/dba/decimal__to__any__base_8c_a3e4a7cfc97a528faa4d6e5741461109c_cgraph.svg create mode 100644 d1/dba/decimal__to__any__base_8c_a899b3a7e0f1fac5a465eac0d4b10d711_cgraph.map create mode 100644 d1/dba/decimal__to__any__base_8c_a899b3a7e0f1fac5a465eac0d4b10d711_cgraph.md5 create mode 100644 d1/dba/decimal__to__any__base_8c_a899b3a7e0f1fac5a465eac0d4b10d711_cgraph.svg create mode 100644 d1/dba/decimal__to__any__base_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map create mode 100644 d1/dba/decimal__to__any__base_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 create mode 100644 d1/dba/decimal__to__any__base_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg create mode 100644 d1/dba/decimal__to__any__base_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 d1/dba/decimal__to__any__base_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 d1/dba/decimal__to__any__base_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg create mode 100644 d1/dbe/include_8h_source.html create mode 100644 d1/dc2/ode__midpoint__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map create mode 100644 d1/dc2/ode__midpoint__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 create mode 100644 d1/dc2/ode__midpoint__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg create mode 100644 d1/de4/infix__to__postfix2_8c__incl.map create mode 100644 d1/de4/infix__to__postfix2_8c__incl.md5 create mode 100644 d1/de4/infix__to__postfix2_8c__incl.svg create mode 100644 d1/df9/problem__26_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map create mode 100644 d1/df9/problem__26_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 create mode 100644 d1/df9/problem__26_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg delete mode 100644 d2/d36/structqueue.js create mode 100644 d2/d42/tcp__full__duplex__server_8c__incl.map create mode 100644 d2/d42/tcp__full__duplex__server_8c__incl.md5 create mode 100644 d2/d42/tcp__full__duplex__server_8c__incl.svg create mode 100644 d2/d42/tcp__full__duplex__server_8c__incl_org.svg delete mode 100644 d2/d6a/struct_graph_rep.js delete mode 100644 d2/d71/struct_a_v_lnode.js create mode 100644 d2/d83/merge__sort_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map create mode 100644 d2/d83/merge__sort_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.md5 create mode 100644 d2/d83/merge__sort_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg create mode 100644 d2/d9b/floyd__cycle__detection__algorithm_8c.html create mode 100644 d2/d9b/floyd__cycle__detection__algorithm_8c.js create mode 100644 d2/d9b/floyd__cycle__detection__algorithm_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map create mode 100644 d2/d9b/floyd__cycle__detection__algorithm_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 create mode 100644 d2/d9b/floyd__cycle__detection__algorithm_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg create mode 100644 d2/d9b/floyd__cycle__detection__algorithm_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 d2/d9b/floyd__cycle__detection__algorithm_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 d2/d9b/floyd__cycle__detection__algorithm_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg create mode 100644 d2/da8/bead__sort_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.map create mode 100644 d2/da8/bead__sort_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.md5 create mode 100644 d2/da8/bead__sort_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.svg create mode 100644 d2/dbc/problem__3_2sol2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 d2/dbc/problem__3_2sol2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 d2/dbc/problem__3_2sol2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg delete mode 100644 d2/ddd/malloc__dbg_8h_a10238aaeea60178d31fbb74347e941aa_cgraph.md5 delete mode 100644 d2/ddd/malloc__dbg_8h_a10238aaeea60178d31fbb74347e941aa_cgraph.svg rename d2/ddd/{malloc__dbg_8h_a10238aaeea60178d31fbb74347e941aa_cgraph.map => malloc__dbg_8h_a37914d05ba1fe8848aa1b48cda719422_cgraph.map} (75%) create mode 100644 d2/ddd/malloc__dbg_8h_a37914d05ba1fe8848aa1b48cda719422_cgraph.md5 create mode 100644 d2/ddd/malloc__dbg_8h_a37914d05ba1fe8848aa1b48cda719422_cgraph.svg rename d2/ddd/{malloc__dbg_8h_aec6b5ee323e5338f23a1ce6fe9974f25_cgraph.map => malloc__dbg_8h_ab07f946b77155ca78d0e14e231a99f5d_cgraph.map} (64%) create mode 100644 d2/ddd/malloc__dbg_8h_ab07f946b77155ca78d0e14e231a99f5d_cgraph.md5 rename db/d84/malloc__dbg_8c_aec6b5ee323e5338f23a1ce6fe9974f25_cgraph.svg => d2/ddd/malloc__dbg_8h_ab07f946b77155ca78d0e14e231a99f5d_cgraph.svg (51%) delete mode 100644 d2/ddd/malloc__dbg_8h_aec6b5ee323e5338f23a1ce6fe9974f25_cgraph.md5 create mode 100644 d2/df6/kohonen__som__topology_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map create mode 100644 d2/df6/kohonen__som__topology_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 create mode 100644 d2/df6/kohonen__som__topology_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg create mode 100644 d2/df6/kohonen__som__topology_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph_org.svg create mode 100644 d3/d39/hash__adler32_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 d3/d39/hash__adler32_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 d3/d39/hash__adler32_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg create mode 100644 d3/d47/modified__binary__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 d3/d47/modified__binary__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 d3/d47/modified__binary__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg create mode 100644 d3/d78/words__alphabetical_8c.html create mode 100644 d3/d78/words__alphabetical_8c.js create mode 100644 d3/d78/words__alphabetical_8c_a0ac11529daf94e98f7114a6e938679a9_cgraph.map create mode 100644 d3/d78/words__alphabetical_8c_a0ac11529daf94e98f7114a6e938679a9_cgraph.md5 create mode 100644 d3/d78/words__alphabetical_8c_a0ac11529daf94e98f7114a6e938679a9_cgraph.svg create mode 100644 d3/d78/words__alphabetical_8c_a151b2c78ae821d0495faf936a1c2530f_cgraph.map create mode 100644 d3/d78/words__alphabetical_8c_a151b2c78ae821d0495faf936a1c2530f_cgraph.md5 create mode 100644 d3/d78/words__alphabetical_8c_a151b2c78ae821d0495faf936a1c2530f_cgraph.svg create mode 100644 d3/d78/words__alphabetical_8c_a151b2c78ae821d0495faf936a1c2530f_cgraph_org.svg create mode 100644 d3/d78/words__alphabetical_8c_a1e5ad8401396df36ab585d79f3309fd9_cgraph.map create mode 100644 d3/d78/words__alphabetical_8c_a1e5ad8401396df36ab585d79f3309fd9_cgraph.md5 create mode 100644 d3/d78/words__alphabetical_8c_a1e5ad8401396df36ab585d79f3309fd9_cgraph.svg create mode 100644 d3/d78/words__alphabetical_8c_a22516c70583c9fa78e4edffb063836cc_cgraph.map create mode 100644 d3/d78/words__alphabetical_8c_a22516c70583c9fa78e4edffb063836cc_cgraph.md5 create mode 100644 d3/d78/words__alphabetical_8c_a22516c70583c9fa78e4edffb063836cc_cgraph.svg create mode 100644 d3/d78/words__alphabetical_8c_a840902ada0e956eb01b529be178748cc_cgraph.map create mode 100644 d3/d78/words__alphabetical_8c_a840902ada0e956eb01b529be178748cc_cgraph.md5 create mode 100644 d3/d78/words__alphabetical_8c_a840902ada0e956eb01b529be178748cc_cgraph.svg create mode 100644 d3/d78/words__alphabetical_8c_a9e3cab68cf6557024f0073f674a307a1_cgraph.map create mode 100644 d3/d78/words__alphabetical_8c_a9e3cab68cf6557024f0073f674a307a1_cgraph.md5 create mode 100644 d3/d78/words__alphabetical_8c_a9e3cab68cf6557024f0073f674a307a1_cgraph.svg create mode 100644 d3/d78/words__alphabetical_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map create mode 100644 d3/d78/words__alphabetical_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 create mode 100644 d3/d78/words__alphabetical_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg create mode 100644 d3/d78/words__alphabetical_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph_org.svg create mode 100644 d3/d78/words__alphabetical_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 d3/d78/words__alphabetical_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 d3/d78/words__alphabetical_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg create mode 100644 d3/d78/words__alphabetical_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg create mode 100644 d3/d78/words__alphabetical_8c_af1f9b6eb320d872ba0766dc8bd070075_cgraph.map create mode 100644 d3/d78/words__alphabetical_8c_af1f9b6eb320d872ba0766dc8bd070075_cgraph.md5 create mode 100644 d3/d78/words__alphabetical_8c_af1f9b6eb320d872ba0766dc8bd070075_cgraph.svg create mode 100644 d3/d79/floyd__cycle__detection__algorithm_8c__incl.map create mode 100644 d3/d79/floyd__cycle__detection__algorithm_8c__incl.md5 create mode 100644 d3/d79/floyd__cycle__detection__algorithm_8c__incl.svg delete mode 100644 d4/d02/struct_b_s_t_iterator.js create mode 100644 d4/d07/ode__forward__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map create mode 100644 d4/d07/ode__forward__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 create mode 100644 d4/d07/ode__forward__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg create mode 100644 d4/d26/postfix__evaluation_8c__incl.map create mode 100644 d4/d26/postfix__evaluation_8c__incl.md5 create mode 100644 d4/d26/postfix__evaluation_8c__incl.svg delete mode 100644 d4/d2d/struct_c_array.js create mode 100644 d4/d3c/words__alphabetical_8c__incl.map create mode 100644 d4/d3c/words__alphabetical_8c__incl.md5 create mode 100644 d4/d3c/words__alphabetical_8c__incl.svg rename d4/d68/{qr__decompose_8h_a82b20e027437df768d7e994cf4cae29f_cgraph.map => qr__decompose_8h_a2ed4977f38642dca8b10c16a823c740b_cgraph.map} (66%) rename d4/d68/{qr__decompose_8h_a82b20e027437df768d7e994cf4cae29f_cgraph.md5 => qr__decompose_8h_a2ed4977f38642dca8b10c16a823c740b_cgraph.md5} (100%) rename d4/d68/{qr__decompose_8h_a82b20e027437df768d7e994cf4cae29f_cgraph.svg => qr__decompose_8h_a2ed4977f38642dca8b10c16a823c740b_cgraph.svg} (54%) create mode 100644 d4/d83/problem__401_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map create mode 100644 d4/d83/problem__401_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 create mode 100644 d4/d83/problem__401_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg create mode 100644 d4/d83/problem__401_2sol1_8c_aaf964739be92adc2f500e7da11e3f6be_cgraph.map create mode 100644 d4/d83/problem__401_2sol1_8c_aaf964739be92adc2f500e7da11e3f6be_cgraph.md5 create mode 100644 d4/d83/problem__401_2sol1_8c_aaf964739be92adc2f500e7da11e3f6be_cgraph.svg create mode 100644 d4/d99/fibonacci__fast_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map create mode 100644 d4/d99/fibonacci__fast_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 create mode 100644 d4/d99/fibonacci__fast_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg create mode 100644 d4/d99/fibonacci__fast_8c_a7a3d55bd19854075cba2eed6b63cb2d3_cgraph.map create mode 100644 d4/d99/fibonacci__fast_8c_a7a3d55bd19854075cba2eed6b63cb2d3_cgraph.md5 create mode 100644 d4/d99/fibonacci__fast_8c_a7a3d55bd19854075cba2eed6b63cb2d3_cgraph.svg create mode 100644 d4/d99/ode__semi__implicit__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map create mode 100644 d4/d99/ode__semi__implicit__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 create mode 100644 d4/d99/ode__semi__implicit__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg create mode 100644 d4/dbd/problem__23_2sol2_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map create mode 100644 d4/dbd/problem__23_2sol2_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 create mode 100644 d4/dbd/problem__23_2sol2_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg create mode 100644 d4/dbd/problem__23_2sol2_8c_ac5d600bf3077f4188afc4c5cd2c40eaf_cgraph.map create mode 100644 d4/dbd/problem__23_2sol2_8c_ac5d600bf3077f4188afc4c5cd2c40eaf_cgraph.md5 create mode 100644 d4/dbd/problem__23_2sol2_8c_ac5d600bf3077f4188afc4c5cd2c40eaf_cgraph.svg create mode 100644 d4/dce/tcp__full__duplex__client_8c__incl.map create mode 100644 d4/dce/tcp__full__duplex__client_8c__incl.md5 create mode 100644 d4/dce/tcp__full__duplex__client_8c__incl.svg create mode 100644 d4/dce/tcp__full__duplex__client_8c__incl_org.svg delete mode 100644 d4/dd4/struct_graph.js create mode 100644 d4/de3/hash__djb2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 d4/de3/hash__djb2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 d4/de3/hash__djb2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg create mode 100644 d4/dea/problem__14_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map create mode 100644 d4/dea/problem__14_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 create mode 100644 d4/dea/problem__14_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg delete mode 100644 d4/dfe/struct_dict.js create mode 100644 d5/d23/qr__decomposition_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map create mode 100644 d5/d23/qr__decomposition_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.md5 create mode 100644 d5/d23/qr__decomposition_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg create mode 100644 d5/d38/bubble__sort__recursion_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.map create mode 100644 d5/d38/bubble__sort__recursion_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.md5 create mode 100644 d5/d38/bubble__sort__recursion_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg create mode 100644 d5/d38/bubble__sort__recursion_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 d5/d38/bubble__sort__recursion_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 d5/d38/bubble__sort__recursion_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg create mode 100644 d5/d4c/group__sorting_ga98666b73777e308fb06a3c489ce25359_cgraph.map create mode 100644 d5/d4c/group__sorting_ga98666b73777e308fb06a3c489ce25359_cgraph.md5 create mode 100644 d5/d4c/group__sorting_ga98666b73777e308fb06a3c489ce25359_cgraph.svg create mode 100644 d5/d5c/test__min__printf_8c.html create mode 100644 d5/d5c/test__min__printf_8c.js create mode 100644 d5/d5c/test__min__printf_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 d5/d5c/test__min__printf_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 d5/d5c/test__min__printf_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg delete mode 100644 d5/d7e/struct_t.js delete mode 100644 d5/db4/struct_edge.js create mode 100644 d5/dc5/test__min__printf_8c__incl.map create mode 100644 d5/dc5/test__min__printf_8c__incl.md5 create mode 100644 d5/dc5/test__min__printf_8c__incl.svg create mode 100644 d5/de2/sentinel__linear__search_8c.html create mode 100644 d5/de2/sentinel__linear__search_8c.js create mode 100644 d5/de2/sentinel__linear__search_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map create mode 100644 d5/de2/sentinel__linear__search_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 create mode 100644 d5/de2/sentinel__linear__search_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg create mode 100644 d5/de2/sentinel__linear__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 d5/de2/sentinel__linear__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 d5/de2/sentinel__linear__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg create mode 100644 d6/d2b/tcp__half__duplex__server_8c.html create mode 100644 d6/d2b/tcp__half__duplex__server_8c.js create mode 100644 d6/d2b/tcp__half__duplex__server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 d6/d2b/tcp__half__duplex__server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 d6/d2b/tcp__half__duplex__server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg create mode 100644 d6/d2e/cartesian__to__polar_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.map create mode 100644 d6/d2e/cartesian__to__polar_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.md5 create mode 100644 d6/d2e/cartesian__to__polar_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg create mode 100644 d6/d2e/cartesian__to__polar_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 d6/d2e/cartesian__to__polar_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 d6/d2e/cartesian__to__polar_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg create mode 100644 d6/d3d/factorial__large__number_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map create mode 100644 d6/d3d/factorial__large__number_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 create mode 100644 d6/d3d/factorial__large__number_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg create mode 100644 d6/d3d/factorial__large__number_8c_ad398ddbd594ca69a5e6dfc894925341e_cgraph.map create mode 100644 d6/d3d/factorial__large__number_8c_ad398ddbd594ca69a5e6dfc894925341e_cgraph.md5 create mode 100644 d6/d3d/factorial__large__number_8c_ad398ddbd594ca69a5e6dfc894925341e_cgraph.svg delete mode 100644 d6/d42/structdynamic__array.js create mode 100644 d6/d7b/jump__search_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.map create mode 100644 d6/d7b/jump__search_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.md5 create mode 100644 d6/d7b/jump__search_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg create mode 100644 d6/d7b/jump__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 d6/d7b/jump__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 d6/d7b/jump__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg create mode 100644 d6/d92/odd__even__sort_8c__incl.map create mode 100644 d6/d92/odd__even__sort_8c__incl.md5 create mode 100644 d6/d92/odd__even__sort_8c__incl.svg create mode 100644 d6/ded/shell__sort2_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map create mode 100644 d6/ded/shell__sort2_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 create mode 100644 d6/ded/shell__sort2_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg create mode 100644 d7/d0c/hash__sdbm_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 d7/d0c/hash__sdbm_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 d7/d0c/hash__sdbm_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg create mode 100644 d7/d1f/problem__12_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map create mode 100644 d7/d1f/problem__12_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 create mode 100644 d7/d1f/problem__12_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg create mode 100644 d7/d50/qr__eigen__values_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map create mode 100644 d7/d50/qr__eigen__values_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 create mode 100644 d7/d50/qr__eigen__values_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg create mode 100644 d7/d50/qr__eigen__values_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph_org.svg create mode 100644 d7/d91/problem__15_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map create mode 100644 d7/d91/problem__15_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 create mode 100644 d7/d91/problem__15_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg create mode 100644 d7/d98/spirograph_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map create mode 100644 d7/d98/spirograph_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 create mode 100644 d7/d98/spirograph_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg create mode 100644 d7/d98/spirograph_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph_org.svg create mode 100644 d7/d98/spirograph_8c_a708a4c1a4d0c4acc4c447310dd4db27f_cgraph.map create mode 100644 d7/d98/spirograph_8c_a708a4c1a4d0c4acc4c447310dd4db27f_cgraph.md5 create mode 100644 d7/d98/spirograph_8c_a708a4c1a4d0c4acc4c447310dd4db27f_cgraph.svg create mode 100644 d7/dd3/problem__3_2sol1_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 d7/dd3/problem__3_2sol1_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 d7/dd3/problem__3_2sol1_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg create mode 100644 d7/dd8/c__atoi__str__to__integer_8c_a8c66c03637e48e375b80b5d7791e57be_cgraph.map create mode 100644 d7/dd8/c__atoi__str__to__integer_8c_a8c66c03637e48e375b80b5d7791e57be_cgraph.md5 create mode 100644 d7/dd8/c__atoi__str__to__integer_8c_a8c66c03637e48e375b80b5d7791e57be_cgraph.svg create mode 100644 d7/ddb/problem__23_2sol1_8c_a3ab61b5a1c4f2288625d160aa0ea8478_cgraph_org.svg create mode 100644 d7/ddb/problem__23_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map create mode 100644 d7/ddb/problem__23_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 create mode 100644 d7/ddb/problem__23_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg create mode 100644 d7/ddb/problem__23_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph_org.svg create mode 100644 d7/ddb/problem__23_2sol1_8c_a4f128410e6582fe26488e2316cc96e17_cgraph.map create mode 100644 d7/ddb/problem__23_2sol1_8c_a4f128410e6582fe26488e2316cc96e17_cgraph.md5 create mode 100644 d7/ddb/problem__23_2sol1_8c_a4f128410e6582fe26488e2316cc96e17_cgraph.svg create mode 100644 d7/ddb/problem__23_2sol1_8c_ac5d600bf3077f4188afc4c5cd2c40eaf_cgraph.map create mode 100644 d7/ddb/problem__23_2sol1_8c_ac5d600bf3077f4188afc4c5cd2c40eaf_cgraph.md5 create mode 100644 d7/ddb/problem__23_2sol1_8c_ac5d600bf3077f4188afc4c5cd2c40eaf_cgraph.svg create mode 100644 d8/d26/decimal__to__any__base_8c__incl.map create mode 100644 d8/d26/decimal__to__any__base_8c__incl.md5 create mode 100644 d8/d26/decimal__to__any__base_8c__incl.svg create mode 100644 d8/d30/decimal__to__binary__recursion_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map create mode 100644 d8/d30/decimal__to__binary__recursion_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 create mode 100644 d8/d30/decimal__to__binary__recursion_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg create mode 100644 d8/d30/decimal__to__binary__recursion_8c_acbbe6358ec95b3201865a72b2ac522c8_cgraph.map create mode 100644 d8/d30/decimal__to__binary__recursion_8c_acbbe6358ec95b3201865a72b2ac522c8_cgraph.md5 create mode 100644 d8/d30/decimal__to__binary__recursion_8c_acbbe6358ec95b3201865a72b2ac522c8_cgraph.svg create mode 100644 d8/d30/decimal__to__binary__recursion_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 d8/d30/decimal__to__binary__recursion_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 d8/d30/decimal__to__binary__recursion_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg create mode 100644 d8/d32/problem__25_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map create mode 100644 d8/d32/problem__25_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 create mode 100644 d8/d32/problem__25_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg rename d8/d71/{group__k__means_gad229b1dc406cb5ea510f26a373ed8bfd_cgraph.map => group__k__means_gaf6259432561e794dea0e060f482d15e2_cgraph.map} (76%) rename d8/d71/{group__k__means_gad229b1dc406cb5ea510f26a373ed8bfd_cgraph.md5 => group__k__means_gaf6259432561e794dea0e060f482d15e2_cgraph.md5} (100%) rename d8/d71/{group__k__means_gad229b1dc406cb5ea510f26a373ed8bfd_cgraph.svg => group__k__means_gaf6259432561e794dea0e060f482d15e2_cgraph.svg} (55%) delete mode 100644 d8/d7a/structtnode.js create mode 100644 d8/dcc/min__printf_8h__incl.map create mode 100644 d8/dcc/min__printf_8h__incl.md5 create mode 100644 d8/dcc/min__printf_8h__incl.svg create mode 100644 d9/dc9/hash__crc32_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 d9/dc9/hash__crc32_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 d9/dc9/hash__crc32_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg create mode 100644 d9/dcc/prim_8c.html create mode 100644 d9/dcc/prim_8c.js create mode 100644 d9/dcc/prim_8c_a0bea087eb586c437cf0a667f794c8853_cgraph.map create mode 100644 d9/dcc/prim_8c_a0bea087eb586c437cf0a667f794c8853_cgraph.md5 create mode 100644 d9/dcc/prim_8c_a0bea087eb586c437cf0a667f794c8853_cgraph.svg create mode 100644 d9/dcc/prim_8c_abf9e6b7e6f15df4b525a2e7705ba3089_cgraph.map create mode 100644 d9/dcc/prim_8c_abf9e6b7e6f15df4b525a2e7705ba3089_cgraph.md5 create mode 100644 d9/dcc/prim_8c_abf9e6b7e6f15df4b525a2e7705ba3089_cgraph.svg create mode 100644 d9/dcc/prim_8c_aff3f4c22009b2aa4e385a76a8a1cdc1c_cgraph.map create mode 100644 d9/dcc/prim_8c_aff3f4c22009b2aa4e385a76a8a1cdc1c_cgraph.md5 create mode 100644 d9/dcc/prim_8c_aff3f4c22009b2aa4e385a76a8a1cdc1c_cgraph.svg create mode 100644 d9/deb/min__printf_8h.html create mode 100644 d9/deb/min__printf_8h.js create mode 100644 d9/deb/min__printf_8h_a0a848efdf2ee124bba62e056eb9ab824_cgraph.map create mode 100644 d9/deb/min__printf_8h_a0a848efdf2ee124bba62e056eb9ab824_cgraph.md5 create mode 100644 d9/deb/min__printf_8h_a0a848efdf2ee124bba62e056eb9ab824_cgraph.svg create mode 100644 d9/deb/min__printf_8h_a33e08c05f8c656a0fee465c2e8d2ecf9_cgraph.map create mode 100644 d9/deb/min__printf_8h_a33e08c05f8c656a0fee465c2e8d2ecf9_cgraph.md5 create mode 100644 d9/deb/min__printf_8h_a33e08c05f8c656a0fee465c2e8d2ecf9_cgraph.svg create mode 100644 d9/deb/min__printf_8h_a4d63203d920bebd6a96f5f4aeccb21e5_cgraph.map create mode 100644 d9/deb/min__printf_8h_a4d63203d920bebd6a96f5f4aeccb21e5_cgraph.md5 create mode 100644 d9/deb/min__printf_8h_a4d63203d920bebd6a96f5f4aeccb21e5_cgraph.svg create mode 100644 d9/deb/min__printf_8h_aa61e2407aab2c75e9837c77cab937d03_cgraph.map create mode 100644 d9/deb/min__printf_8h_aa61e2407aab2c75e9837c77cab937d03_cgraph.md5 create mode 100644 d9/deb/min__printf_8h_aa61e2407aab2c75e9837c77cab937d03_cgraph.svg create mode 100644 d9/deb/min__printf_8h_af569209570eca8bc6770fb7d9dc873e6_cgraph.map create mode 100644 d9/deb/min__printf_8h_af569209570eca8bc6770fb7d9dc873e6_cgraph.md5 create mode 100644 d9/deb/min__printf_8h_af569209570eca8bc6770fb7d9dc873e6_cgraph.svg create mode 100644 d9/deb/min__printf_8h_source.html create mode 100644 da/d02/binary__search__tree_8c_a01151353aa2d9688934ed39208133241_cgraph.map create mode 100644 da/d02/binary__search__tree_8c_a01151353aa2d9688934ed39208133241_cgraph.md5 create mode 100644 da/d02/binary__search__tree_8c_a01151353aa2d9688934ed39208133241_cgraph.svg rename da/d02/{binary__search__tree_8c_a73152b9ccb4aa5cd4c1bacd4188bb2de_cgraph.map => binary__search__tree_8c_a031cc98830742bca57c0da81a0fb779f_cgraph.map} (71%) create mode 100644 da/d02/binary__search__tree_8c_a031cc98830742bca57c0da81a0fb779f_cgraph.md5 rename da/d02/{binary__search__tree_8c_a73152b9ccb4aa5cd4c1bacd4188bb2de_cgraph.svg => binary__search__tree_8c_a031cc98830742bca57c0da81a0fb779f_cgraph.svg} (53%) create mode 100644 da/d02/binary__search__tree_8c_a0f18adaaca5ecc410cfa16dd2a3684dc_cgraph.map create mode 100644 da/d02/binary__search__tree_8c_a0f18adaaca5ecc410cfa16dd2a3684dc_cgraph.md5 create mode 100644 da/d02/binary__search__tree_8c_a0f18adaaca5ecc410cfa16dd2a3684dc_cgraph.svg rename da/d02/{binary__search__tree_8c_a748f3966920e2fd197906be1e151b127_cgraph.map => binary__search__tree_8c_a6983e8a91a3d25d7d000807f18ba2748_cgraph.map} (71%) create mode 100644 da/d02/binary__search__tree_8c_a6983e8a91a3d25d7d000807f18ba2748_cgraph.md5 create mode 100644 da/d02/binary__search__tree_8c_a6983e8a91a3d25d7d000807f18ba2748_cgraph.svg delete mode 100644 da/d02/binary__search__tree_8c_a73152b9ccb4aa5cd4c1bacd4188bb2de_cgraph.md5 delete mode 100644 da/d02/binary__search__tree_8c_a748f3966920e2fd197906be1e151b127_cgraph.md5 delete mode 100644 da/d02/binary__search__tree_8c_a748f3966920e2fd197906be1e151b127_cgraph.svg create mode 100644 da/d02/binary__search__tree_8c_ad50f3debc5323bb7b71933effb64f30f_cgraph.map create mode 100644 da/d02/binary__search__tree_8c_ad50f3debc5323bb7b71933effb64f30f_cgraph.md5 create mode 100644 da/d02/binary__search__tree_8c_ad50f3debc5323bb7b71933effb64f30f_cgraph.svg create mode 100644 da/d02/binary__search__tree_8c_adff4c6248834a9944a1fb03a20230c9c_cgraph.map create mode 100644 da/d02/binary__search__tree_8c_adff4c6248834a9944a1fb03a20230c9c_cgraph.md5 create mode 100644 da/d02/binary__search__tree_8c_adff4c6248834a9944a1fb03a20230c9c_cgraph.svg create mode 100644 da/d02/binary__search__tree_8c_ae4a66d8b0c2b0d626aea45977e358c83_cgraph.map create mode 100644 da/d02/binary__search__tree_8c_ae4a66d8b0c2b0d626aea45977e358c83_cgraph.md5 create mode 100644 da/d02/binary__search__tree_8c_ae4a66d8b0c2b0d626aea45977e358c83_cgraph.svg create mode 100644 da/d02/binary__search__tree_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 da/d02/binary__search__tree_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 da/d02/binary__search__tree_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg create mode 100644 da/d07/tcp__half__duplex__client_8c.html create mode 100644 da/d07/tcp__half__duplex__client_8c.js create mode 100644 da/d07/tcp__half__duplex__client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 da/d07/tcp__half__duplex__client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 da/d07/tcp__half__duplex__client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg create mode 100644 da/d0b/alaw_8c__incl.map create mode 100644 da/d0b/alaw_8c__incl.md5 create mode 100644 da/d0b/alaw_8c__incl.svg create mode 100644 da/d31/exponential__search_8c__incl.map create mode 100644 da/d31/exponential__search_8c__incl.md5 create mode 100644 da/d31/exponential__search_8c__incl.svg create mode 100644 da/d6c/exponential__search_8c.html create mode 100644 da/d6c/exponential__search_8c.js create mode 100644 da/d6c/exponential__search_8c_a82d4de0907b9601a376febf50955bacd_cgraph.map create mode 100644 da/d6c/exponential__search_8c_a82d4de0907b9601a376febf50955bacd_cgraph.md5 create mode 100644 da/d6c/exponential__search_8c_a82d4de0907b9601a376febf50955bacd_cgraph.svg create mode 100644 da/d6c/exponential__search_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map create mode 100644 da/d6c/exponential__search_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 create mode 100644 da/d6c/exponential__search_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg create mode 100644 da/d6c/exponential__search_8c_aae97ef76c065e91c188f1f8c8076869a_cgraph.map create mode 100644 da/d6c/exponential__search_8c_aae97ef76c065e91c188f1f8c8076869a_cgraph.md5 create mode 100644 da/d6c/exponential__search_8c_aae97ef76c065e91c188f1f8c8076869a_cgraph.svg create mode 100644 da/d6c/exponential__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 da/d6c/exponential__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 da/d6c/exponential__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg create mode 100644 da/d96/infix__to__postfix2_8c.html create mode 100644 da/d96/infix__to__postfix2_8c.js create mode 100644 da/d96/infix__to__postfix2_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map create mode 100644 da/d96/infix__to__postfix2_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 create mode 100644 da/d96/infix__to__postfix2_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg create mode 100644 da/d96/infix__to__postfix2_8c_ae363a3863a8bfbf40e7a95c2b9dbe71b_cgraph.map create mode 100644 da/d96/infix__to__postfix2_8c_ae363a3863a8bfbf40e7a95c2b9dbe71b_cgraph.md5 create mode 100644 da/d96/infix__to__postfix2_8c_ae363a3863a8bfbf40e7a95c2b9dbe71b_cgraph.svg create mode 100644 da/d96/infix__to__postfix2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 da/d96/infix__to__postfix2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 da/d96/infix__to__postfix2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg delete mode 100644 da/d9b/struct_trie_node.js rename da/da0/{segment__tree_8c_acecc34fd89923ab41dcee3a779622816_cgraph.map => segment__tree_8c_a3513a2b7c3f1d15aa3d019af1f834cde_cgraph.map} (75%) rename da/da0/{segment__tree_8c_acecc34fd89923ab41dcee3a779622816_cgraph.md5 => segment__tree_8c_a3513a2b7c3f1d15aa3d019af1f834cde_cgraph.md5} (100%) rename da/da0/{segment__tree_8c_acecc34fd89923ab41dcee3a779622816_cgraph.svg => segment__tree_8c_a3513a2b7c3f1d15aa3d019af1f834cde_cgraph.svg} (61%) create mode 100644 db/d01/problem__13_2sol1_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map create mode 100644 db/d01/problem__13_2sol1_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.md5 create mode 100644 db/d01/problem__13_2sol1_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg create mode 100644 db/d80/problem__20_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map create mode 100644 db/d80/problem__20_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 create mode 100644 db/d80/problem__20_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg create mode 100644 db/d80/problem__20_2sol1_8c_a54a02c4b963fdb16f24959e0137763f1_cgraph.map create mode 100644 db/d80/problem__20_2sol1_8c_a54a02c4b963fdb16f24959e0137763f1_cgraph.md5 create mode 100644 db/d80/problem__20_2sol1_8c_a54a02c4b963fdb16f24959e0137763f1_cgraph.svg delete mode 100644 db/d84/malloc__dbg_8c_a10238aaeea60178d31fbb74347e941aa_cgraph.md5 delete mode 100644 db/d84/malloc__dbg_8c_a10238aaeea60178d31fbb74347e941aa_cgraph.svg rename db/d84/{malloc__dbg_8c_a10238aaeea60178d31fbb74347e941aa_cgraph.map => malloc__dbg_8c_a37914d05ba1fe8848aa1b48cda719422_cgraph.map} (75%) create mode 100644 db/d84/malloc__dbg_8c_a37914d05ba1fe8848aa1b48cda719422_cgraph.md5 create mode 100644 db/d84/malloc__dbg_8c_a37914d05ba1fe8848aa1b48cda719422_cgraph.svg rename db/d84/{malloc__dbg_8c_aec6b5ee323e5338f23a1ce6fe9974f25_cgraph.map => malloc__dbg_8c_ab07f946b77155ca78d0e14e231a99f5d_cgraph.map} (64%) create mode 100644 db/d84/malloc__dbg_8c_ab07f946b77155ca78d0e14e231a99f5d_cgraph.md5 rename d2/ddd/malloc__dbg_8h_aec6b5ee323e5338f23a1ce6fe9974f25_cgraph.svg => db/d84/malloc__dbg_8c_ab07f946b77155ca78d0e14e231a99f5d_cgraph.svg (51%) delete mode 100644 db/d84/malloc__dbg_8c_aec6b5ee323e5338f23a1ce6fe9974f25_cgraph.md5 create mode 100644 dc/d2e/lu__decompose_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map create mode 100644 dc/d2e/lu__decompose_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 create mode 100644 dc/d2e/lu__decompose_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg create mode 100644 dc/d39/selection__sort__recursive_8c_aa2bc8bdd2e8ce289a6b8ef528fd1a534_cgraph.map create mode 100644 dc/d39/selection__sort__recursive_8c_aa2bc8bdd2e8ce289a6b8ef528fd1a534_cgraph.md5 create mode 100644 dc/d39/selection__sort__recursive_8c_aa2bc8bdd2e8ce289a6b8ef528fd1a534_cgraph.svg create mode 100644 dc/d47/realtime__stats_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map create mode 100644 dc/d47/realtime__stats_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 create mode 100644 dc/d47/realtime__stats_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg create mode 100644 dc/d63/problem__8_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map create mode 100644 dc/d63/problem__8_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 create mode 100644 dc/d63/problem__8_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg create mode 100644 dc/d80/cantor__set_8c_a85df3c64a683100ac6246e1e034df43d_cgraph.map create mode 100644 dc/d80/cantor__set_8c_a85df3c64a683100ac6246e1e034df43d_cgraph.md5 create mode 100644 dc/d80/cantor__set_8c_a85df3c64a683100ac6246e1e034df43d_cgraph.svg create mode 100644 dc/d80/cantor__set_8c_abf9e6b7e6f15df4b525a2e7705ba3089_cgraph.map create mode 100644 dc/d80/cantor__set_8c_abf9e6b7e6f15df4b525a2e7705ba3089_cgraph.md5 create mode 100644 dc/d80/cantor__set_8c_abf9e6b7e6f15df4b525a2e7705ba3089_cgraph.svg create mode 100644 dc/dc7/sentinel__linear__search_8c__incl.map create mode 100644 dc/dc7/sentinel__linear__search_8c__incl.md5 create mode 100644 dc/dc7/sentinel__linear__search_8c__incl.svg delete mode 100644 dc/de5/structsubset.js create mode 100644 dd/d08/newton__raphson__root_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map create mode 100644 dd/d08/newton__raphson__root_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 create mode 100644 dd/d08/newton__raphson__root_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg create mode 100644 dd/d29/doubly__linked__list_8c_a1fadec32fc369a8dcfbcd766e166efa0_cgraph.map create mode 100644 dd/d29/doubly__linked__list_8c_a1fadec32fc369a8dcfbcd766e166efa0_cgraph.md5 create mode 100644 dd/d29/doubly__linked__list_8c_a1fadec32fc369a8dcfbcd766e166efa0_cgraph.svg create mode 100644 dd/d29/doubly__linked__list_8c_aedd04074dbc6af0de89051f97209311b_cgraph.map create mode 100644 dd/d29/doubly__linked__list_8c_aedd04074dbc6af0de89051f97209311b_cgraph.md5 create mode 100644 dd/d29/doubly__linked__list_8c_aedd04074dbc6af0de89051f97209311b_cgraph.svg create mode 100644 dd/d3d/tcp__half__duplex__server_8c__incl.map create mode 100644 dd/d3d/tcp__half__duplex__server_8c__incl.md5 create mode 100644 dd/d3d/tcp__half__duplex__server_8c__incl.svg create mode 100644 dd/d3d/tcp__half__duplex__server_8c__incl_org.svg create mode 100644 dd/d53/int__to__string_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 dd/d53/int__to__string_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 dd/d53/int__to__string_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg create mode 100644 dd/d8b/problem__22_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map create mode 100644 dd/d8b/problem__22_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 create mode 100644 dd/d8b/problem__22_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg create mode 100644 dd/d8c/adaline__learning_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map create mode 100644 dd/d8c/adaline__learning_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 create mode 100644 dd/d8c/adaline__learning_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg create mode 100644 dd/d8c/adaline__learning_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph_org.svg create mode 100644 dd/d93/client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 dd/d93/client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 dd/d93/client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg create mode 100644 dd/d99/heap__sort__2_8c__incl.map create mode 100644 dd/d99/heap__sort__2_8c__incl.md5 create mode 100644 dd/d99/heap__sort__2_8c__incl.svg create mode 100644 dd/da2/structbuffer.html create mode 100644 dd/de4/bubble__sort_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.map create mode 100644 dd/de4/bubble__sort_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.md5 create mode 100644 dd/de4/bubble__sort_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.svg create mode 100644 dd/de4/bubble__sort_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.map create mode 100644 dd/de4/bubble__sort_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.md5 create mode 100644 dd/de4/bubble__sort_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg create mode 100644 dd/deb/tcp__half__duplex__client_8c__incl.map create mode 100644 dd/deb/tcp__half__duplex__client_8c__incl.md5 create mode 100644 dd/deb/tcp__half__duplex__client_8c__incl.svg create mode 100644 dd/deb/tcp__half__duplex__client_8c__incl_org.svg create mode 100644 dd/df0/problem__19_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map create mode 100644 dd/df0/problem__19_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 create mode 100644 dd/df0/problem__19_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg create mode 100644 de/d1c/prim_8c__incl.map create mode 100644 de/d1c/prim_8c__incl.md5 create mode 100644 de/d1c/prim_8c__incl.svg create mode 100644 de/d50/min__printf_8h__dep__incl.map create mode 100644 de/d50/min__printf_8h__dep__incl.md5 create mode 100644 de/d50/min__printf_8h__dep__incl.svg create mode 100644 de/d7b/group__vec__3d_ga55be1d766c8a824b35d97e79744834d8_cgraph.map create mode 100644 de/d7b/group__vec__3d_ga55be1d766c8a824b35d97e79744834d8_cgraph.md5 create mode 100644 de/d7b/group__vec__3d_ga55be1d766c8a824b35d97e79744834d8_cgraph.svg delete mode 100644 de/dce/structmin__heap.js create mode 100644 de/dff/heap__sort__2_8c.html create mode 100644 de/dff/heap__sort__2_8c.js create mode 100644 de/dff/heap__sort__2_8c_a00cd944b33a5fe5972111ded9b49793c_cgraph.map create mode 100644 de/dff/heap__sort__2_8c_a00cd944b33a5fe5972111ded9b49793c_cgraph.md5 create mode 100644 de/dff/heap__sort__2_8c_a00cd944b33a5fe5972111ded9b49793c_cgraph.svg create mode 100644 de/dff/heap__sort__2_8c_a619753b978f962aa2337e1fdb4e59e33_cgraph.map create mode 100644 de/dff/heap__sort__2_8c_a619753b978f962aa2337e1fdb4e59e33_cgraph.md5 create mode 100644 de/dff/heap__sort__2_8c_a619753b978f962aa2337e1fdb4e59e33_cgraph.svg create mode 100644 de/dff/heap__sort__2_8c_a672a47d865e7fa18f1ff23001ef4a485_cgraph.map create mode 100644 de/dff/heap__sort__2_8c_a672a47d865e7fa18f1ff23001ef4a485_cgraph.md5 create mode 100644 de/dff/heap__sort__2_8c_a672a47d865e7fa18f1ff23001ef4a485_cgraph.svg create mode 100644 de/dff/heap__sort__2_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map create mode 100644 de/dff/heap__sort__2_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 create mode 100644 de/dff/heap__sort__2_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg create mode 100644 de/dff/heap__sort__2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 de/dff/heap__sort__2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 de/dff/heap__sort__2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg create mode 100644 df/d16/palindrome_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 df/d16/palindrome_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 df/d16/palindrome_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg create mode 100644 df/d1a/problem__21_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map create mode 100644 df/d1a/problem__21_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 create mode 100644 df/d1a/problem__21_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg create mode 100644 df/d27/alaw_8c.html create mode 100644 df/d27/alaw_8c.js create mode 100644 df/d27/alaw_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map create mode 100644 df/d27/alaw_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 create mode 100644 df/d27/alaw_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg create mode 100644 df/d3b/binary__search_8c_a40855c608ca64048d04cff6526f0a582_cgraph.map create mode 100644 df/d3b/binary__search_8c_a40855c608ca64048d04cff6526f0a582_cgraph.md5 create mode 100644 df/d3b/binary__search_8c_a40855c608ca64048d04cff6526f0a582_cgraph.svg create mode 100644 df/d3b/binary__search_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map create mode 100644 df/d3b/binary__search_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.md5 create mode 100644 df/d3b/binary__search_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg create mode 100644 df/d3b/binary__search_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.map create mode 100644 df/d3b/binary__search_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.md5 create mode 100644 df/d3b/binary__search_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg create mode 100644 df/d3c/threaded__binary__trees_8c_a4c1e06b5f0876ec9c1bd6817f3b7eda7_cgraph.map create mode 100644 df/d3c/threaded__binary__trees_8c_a4c1e06b5f0876ec9c1bd6817f3b7eda7_cgraph.md5 create mode 100644 df/d3c/threaded__binary__trees_8c_a4c1e06b5f0876ec9c1bd6817f3b7eda7_cgraph.svg create mode 100644 df/d3c/threaded__binary__trees_8c_a5a82ae0ee13788be51ca4ba6cddb0719_cgraph.map create mode 100644 df/d3c/threaded__binary__trees_8c_a5a82ae0ee13788be51ca4ba6cddb0719_cgraph.md5 create mode 100644 df/d3c/threaded__binary__trees_8c_a5a82ae0ee13788be51ca4ba6cddb0719_cgraph.svg create mode 100644 df/d3c/threaded__binary__trees_8c_a8169ba0dfd5b8183672e444d1434bf9c_cgraph.map create mode 100644 df/d3c/threaded__binary__trees_8c_a8169ba0dfd5b8183672e444d1434bf9c_cgraph.md5 create mode 100644 df/d3c/threaded__binary__trees_8c_a8169ba0dfd5b8183672e444d1434bf9c_cgraph.svg create mode 100644 df/d3c/threaded__binary__trees_8c_a823432888332fc9f0aa6072cff28c3bb_cgraph.map create mode 100644 df/d3c/threaded__binary__trees_8c_a823432888332fc9f0aa6072cff28c3bb_cgraph.md5 create mode 100644 df/d3c/threaded__binary__trees_8c_a823432888332fc9f0aa6072cff28c3bb_cgraph.svg create mode 100644 df/d3c/threaded__binary__trees_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 df/d3c/threaded__binary__trees_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 df/d3c/threaded__binary__trees_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg create mode 100644 df/d43/postfix__evaluation_8c.html create mode 100644 df/d43/postfix__evaluation_8c.js create mode 100644 df/d43/postfix__evaluation_8c_a4494492c8fc2509f602acc8228a3b623_cgraph.map create mode 100644 df/d43/postfix__evaluation_8c_a4494492c8fc2509f602acc8228a3b623_cgraph.md5 create mode 100644 df/d43/postfix__evaluation_8c_a4494492c8fc2509f602acc8228a3b623_cgraph.svg create mode 100644 df/d43/postfix__evaluation_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map create mode 100644 df/d43/postfix__evaluation_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 create mode 100644 df/d43/postfix__evaluation_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg create mode 100644 df/d43/postfix__evaluation_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 df/d43/postfix__evaluation_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 df/d43/postfix__evaluation_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg create mode 100644 df/d83/selection__sort_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.map create mode 100644 df/d83/selection__sort_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.md5 create mode 100644 df/d83/selection__sort_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.svg delete mode 100644 df/db3/struct_l.js delete mode 100644 df/ddb/structword__count__word.js delete mode 100644 df/dea/structdata.js create mode 100644 df/df3/union__find_8c_a3e13b69cce5a1b25ae034798092f3d86_cgraph.map create mode 100644 df/df3/union__find_8c_a3e13b69cce5a1b25ae034798092f3d86_cgraph.md5 create mode 100644 df/df3/union__find_8c_a3e13b69cce5a1b25ae034798092f3d86_cgraph.svg create mode 100644 df/df3/union__find_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 df/df3/union__find_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 df/df3/union__find_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg create mode 100644 dir_a4300992e825aa9b9238bf43160a241e.js create mode 100644 dir_a5f32cf82ad289a7dac212f63f40f55b.html create mode 100644 dir_a5f32cf82ad289a7dac212f63f40f55b.js create mode 100644 dir_fb09f588f9daea69f78b63a0310e98cc.html create mode 100644 dir_fb09f588f9daea69f78b63a0310e98cc.js create mode 100644 globals_func_w.html create mode 100644 globals_w.html create mode 100644 search/defines_a.html create mode 100644 search/defines_a.js create mode 100644 search/files_15.html create mode 100644 search/files_15.js create mode 100644 search/files_16.html create mode 100644 search/files_16.js create mode 100644 search/functions_18.html create mode 100644 search/functions_18.js diff --git a/annotated.html b/annotated.html index d612ffc71..8d1443cb9 100644 --- a/annotated.html +++ b/annotated.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Data Structures @@ -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('annotated.html',''); initResizable();
-
-
Data Structures
+
Data Structures
Here are the data structures with brief descriptions:
@@ -102,42 +101,43 @@ $(document).ready(function(){initNavTree('annotated.html',''); initResizable();  CadalineStructure to hold adaline model parameters  CAVLnode  CBSTIteratorDefinition for a binary tree node - CCArray - Ccluster - Cdata - CDict - Cdual_quat_Dual quaternion type - Cdynamic_array - CEdge - Celem - Ceuler_3D Euler or Tait-Bryan angles (in radian) - CGraph - CGraphRep - Chash_set_t - Ckohonen_array_3dTo store info regarding 3D arrays - CL - ClistDoubly linked list struct - Cmat_3x3_A 3x3 Matrix type definition - Cmax_heap - CMEMORY_INFORMATIONFor the malloc, calloc and free functions - Cmin_heap - CnodeNode, the basic data structure in the tree - CNodeNode, the basic data structure of the tree - Cobservation - CpidPID Controller - Cquaternion_Quaternion type represented using a scalar \(w\) or \(q_0\) and a 3D vector \(\left(q_1,q_2,q_3\right)\) - Cqueue - CQueueRep - Csegment_treeThis structures holds all the data that is required by a segment tree - CStackFor printf() and scanf() - Csubset - CsudokuStructure to hold the matrix and dimensions - CT - CtermIdentifier for single-variable polynomial coefficients as a linked list - Ctnode - CTrieNode - Cvec_3d_3D vector type - Cword_count_word + CbufferStruct used to store character in certain times + CCArray + Ccluster + Cdata + CDict + Cdual_quat_Dual quaternion type + Cdynamic_array + CEdge + Celem + Ceuler_3D Euler or Tait-Bryan angles (in radian) + CGraph + CGraphRep + Chash_set_t + Ckohonen_array_3dTo store info regarding 3D arrays + CL + ClistDoubly linked list struct + Cmat_3x3_A 3x3 Matrix type definition + Cmax_heapFor INT_MIN + CMEMORY_INFORMATIONFor the malloc, calloc and free functions + Cmin_heap + CnodeNode, the basic data structure in the tree + CNodeNode, the basic data structure of the tree + Cobservation + CpidPID Controller + Cquaternion_Quaternion type represented using a scalar \(w\) or \(q_0\) and a 3D vector \(\left(q_1,q_2,q_3\right)\) + Cqueue + CQueueRep + Csegment_treeThis structures holds all the data that is required by a segment tree + CStackFor printf() and scanf() + Csubset + CsudokuStructure to hold the matrix and dimensions + CT + CtermIdentifier for single-variable polynomial coefficients as a linked list + Ctnode + CTrieNode + Cvec_3d_3D vector type + Cword_count_word
@@ -145,7 +145,7 @@ $(document).ready(function(){initNavTree('annotated.html',''); initResizable(); diff --git a/annotated_dup.js b/annotated_dup.js index bf86da19b..6a80af30e 100644 --- a/annotated_dup.js +++ b/annotated_dup.js @@ -4,42 +4,43 @@ var annotated_dup = [ "_cantor_set", "d9/dd7/struct__cantor__set.html", "d9/dd7/struct__cantor__set" ], [ "_large_num", "d3/d5a/struct__large__num.html", "d3/d5a/struct__large__num" ], [ "adaline", "d2/daa/structadaline.html", "d2/daa/structadaline" ], - [ "AVLnode", "d2/d71/struct_a_v_lnode.html", "d2/d71/struct_a_v_lnode" ], - [ "BSTIterator", "d4/d02/struct_b_s_t_iterator.html", "d4/d02/struct_b_s_t_iterator" ], - [ "CArray", "d4/d2d/struct_c_array.html", "d4/d2d/struct_c_array" ], + [ "AVLnode", "d2/d71/struct_a_v_lnode.html", null ], + [ "BSTIterator", "d4/d02/struct_b_s_t_iterator.html", null ], + [ "buffer", "dd/da2/structbuffer.html", null ], + [ "CArray", "d4/d2d/struct_c_array.html", null ], [ "cluster", "d1/d99/structcluster.html", "d1/d99/structcluster" ], - [ "data", "df/dea/structdata.html", "df/dea/structdata" ], - [ "Dict", "d4/dfe/struct_dict.html", "d4/dfe/struct_dict" ], + [ "data", "df/dea/structdata.html", null ], + [ "Dict", "d4/dfe/struct_dict.html", null ], [ "dual_quat_", "d7/dfd/structdual__quat__.html", "d7/dfd/structdual__quat__" ], - [ "dynamic_array", "d6/d42/structdynamic__array.html", "d6/d42/structdynamic__array" ], - [ "Edge", "d5/db4/struct_edge.html", "d5/db4/struct_edge" ], - [ "elem", "d0/d6b/structelem.html", "d0/d6b/structelem" ], + [ "dynamic_array", "d6/d42/structdynamic__array.html", null ], + [ "Edge", "d5/db4/struct_edge.html", null ], + [ "elem", "d0/d6b/structelem.html", null ], [ "euler_", "d2/de8/structeuler__.html", "d2/de8/structeuler__" ], - [ "Graph", "d4/dd4/struct_graph.html", "d4/dd4/struct_graph" ], - [ "GraphRep", "d2/d6a/struct_graph_rep.html", "d2/d6a/struct_graph_rep" ], - [ "hash_set_t", "d0/df1/structhash__set__t.html", "d0/df1/structhash__set__t" ], + [ "Graph", "d4/dd4/struct_graph.html", null ], + [ "GraphRep", "d2/d6a/struct_graph_rep.html", null ], + [ "hash_set_t", "d0/df1/structhash__set__t.html", null ], [ "kohonen_array_3d", "d8/db8/structkohonen__array__3d.html", "d8/db8/structkohonen__array__3d" ], - [ "L", "df/db3/struct_l.html", "df/db3/struct_l" ], + [ "L", "df/db3/struct_l.html", null ], [ "list", "d8/d10/structlist.html", "d8/d10/structlist" ], [ "mat_3x3_", "d9/d8b/structmat__3x3__.html", "d9/d8b/structmat__3x3__" ], - [ "max_heap", "d0/d8a/structmax__heap.html", "d0/d8a/structmax__heap" ], + [ "max_heap", "d0/d8a/structmax__heap.html", null ], [ "MEMORY_INFORMATION", "d4/d73/struct_m_e_m_o_r_y___i_n_f_o_r_m_a_t_i_o_n.html", "d4/d73/struct_m_e_m_o_r_y___i_n_f_o_r_m_a_t_i_o_n" ], - [ "min_heap", "de/dce/structmin__heap.html", "de/dce/structmin__heap" ], + [ "min_heap", "de/dce/structmin__heap.html", null ], [ "node", "d5/da1/structnode.html", "d5/da1/structnode" ], [ "Node", "db/d8b/struct_node.html", "db/d8b/struct_node" ], [ "observation", "d1/d5e/structobservation.html", "d1/d5e/structobservation" ], - [ "pid", "d0/d43/structpid.html", "d0/d43/structpid" ], + [ "pid", "d0/d43/structpid.html", null ], [ "quaternion_", "de/d58/structquaternion__.html", "de/d58/structquaternion__" ], - [ "queue", "d2/d36/structqueue.html", "d2/d36/structqueue" ], - [ "QueueRep", "d0/d10/struct_queue_rep.html", "d0/d10/struct_queue_rep" ], + [ "queue", "d2/d36/structqueue.html", null ], + [ "QueueRep", "d0/d10/struct_queue_rep.html", null ], [ "segment_tree", "dd/d06/structsegment__tree.html", "dd/d06/structsegment__tree" ], [ "Stack", "dd/d10/struct_stack.html", "dd/d10/struct_stack" ], - [ "subset", "dc/de5/structsubset.html", "dc/de5/structsubset" ], + [ "subset", "dc/de5/structsubset.html", null ], [ "sudoku", "dc/d18/structsudoku.html", "dc/d18/structsudoku" ], - [ "T", "d5/d7e/struct_t.html", "d5/d7e/struct_t" ], + [ "T", "d5/d7e/struct_t.html", null ], [ "term", "df/d86/structterm.html", "df/d86/structterm" ], - [ "tnode", "d8/d7a/structtnode.html", "d8/d7a/structtnode" ], - [ "TrieNode", "da/d9b/struct_trie_node.html", "da/d9b/struct_trie_node" ], + [ "tnode", "d8/d7a/structtnode.html", null ], + [ "TrieNode", "da/d9b/struct_trie_node.html", null ], [ "vec_3d_", "d5/db4/structvec__3d__.html", "d5/db4/structvec__3d__" ], - [ "word_count_word", "df/ddb/structword__count__word.html", "df/ddb/structword__count__word" ] + [ "word_count_word", "df/ddb/structword__count__word.html", null ] ]; \ No newline at end of file diff --git a/classes.html b/classes.html index 43f60058f..c4df828f4 100644 --- a/classes.html +++ b/classes.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Data Structure Index @@ -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,68 +90,67 @@ $(document).ready(function(){initNavTree('classes.html',''); initResizable(); })
-
-
Data Structure Index
+
Data Structure Index
A | B | C | D | E | G | H | K | L | M | N | O | P | Q | S | T | V | W | _
-
A
+
A
adaline
AVLnode
-
B
-
BSTIterator
+
B
+
BSTIterator
buffer
-
C
+
C
CArray
cluster
-
D
+
D
data
Dict
dual_quat_
dynamic_array
-
E
+
E
Edge
elem
euler_
-
G
+
G
Graph
GraphRep
-
H
+
H
hash_set_t
-
K
+
K
kohonen_array_3d
-
L
+
L
L
list
-
M
+
M
mat_3x3_
max_heap
MEMORY_INFORMATION
min_heap
-
N
+
N
node
Node
-
O
+
O
observation
-
P
+
P
pid
-
Q
+
Q
quaternion_
queue
QueueRep
-
S
+
S
segment_tree
Stack
subset
sudoku
-
T
+
T
T
term
tnode
TrieNode
-
V
+
V
vec_3d_
-
W
+
W
word_count_word
-
_
+
_
_big_int
_cantor_set
_large_num
@@ -159,7 +158,7 @@ $(document).ready(function(){initNavTree('classes.html',''); initResizable(); }) diff --git a/d0/d04/qr__decompose_8h__incl.map b/d0/d04/qr__decompose_8h__incl.map index 323b11591..8cebc3004 100644 --- a/d0/d04/qr__decompose_8h__incl.map +++ b/d0/d04/qr__decompose_8h__incl.map @@ -1,5 +1,5 @@ - + diff --git a/d0/d04/qr__decompose_8h__incl.svg b/d0/d04/qr__decompose_8h__incl.svg index 9e1e7fcdd..01be00823 100644 --- a/d0/d04/qr__decompose_8h__incl.svg +++ b/d0/d04/qr__decompose_8h__incl.svg @@ -1,7 +1,7 @@ - Node1 - -numerical_methods/qr + +numerical_methods/qr _decompose.h diff --git a/d0/d10/struct_queue_rep.html b/d0/d10/struct_queue_rep.html index f0f596581..677077f46 100644 --- a/d0/d10/struct_queue_rep.html +++ b/d0/d10/struct_queue_rep.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: QueueRep 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() {
@@ -92,26 +92,25 @@ $(document).ready(function(){initNavTree('d0/d10/struct_queue_rep.html','../../'
-
-
QueueRep Struct Reference
+
QueueRep Struct Reference
Collaboration diagram for QueueRep:
-
+
[legend]
- - - -

+

Data Fields

+
int length
 
+
NodeT * head
 
+
NodeT * tail
 
@@ -124,7 +123,7 @@ int length diff --git a/d0/d10/struct_queue_rep.js b/d0/d10/struct_queue_rep.js deleted file mode 100644 index 80bfe1866..000000000 --- a/d0/d10/struct_queue_rep.js +++ /dev/null @@ -1,6 +0,0 @@ -var struct_queue_rep = -[ - [ "head", "d0/d10/struct_queue_rep.html#ad4f9f3b0f81ea8c768d4c45548a590de", null ], - [ "length", "d0/d10/struct_queue_rep.html#aad9e10b8e2e0a821d374a154240e22c6", null ], - [ "tail", "d0/d10/struct_queue_rep.html#a5ca79e0a97550d8938331d90ce585a35", null ] -]; \ No newline at end of file diff --git a/d0/d1f/structnode__coll__graph.map b/d0/d1f/structnode__coll__graph.map index 3892cb18b..a5d310373 100644 --- a/d0/d1f/structnode__coll__graph.map +++ b/d0/d1f/structnode__coll__graph.map @@ -1,3 +1,3 @@ - + diff --git a/d0/d1f/structnode__coll__graph.svg b/d0/d1f/structnode__coll__graph.svg index 1c4dd4a82..6af88bfc8 100644 --- a/d0/d1f/structnode__coll__graph.svg +++ b/d0/d1f/structnode__coll__graph.svg @@ -1,36 +1,36 @@ - - + node - + Node1 - -node + +node Node1->Node1 - - - left -leftNode -link -next -par -pre -right -rightNode + + + left +leftNode +link +next +par +pre +right +rightNode diff --git a/d0/d3d/insertion__sort_8c__incl.map b/d0/d3d/insertion__sort_8c__incl.map index e09557d9d..028f8a3f5 100644 --- a/d0/d3d/insertion__sort_8c__incl.map +++ b/d0/d3d/insertion__sort_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/d0/d3d/insertion__sort_8c__incl.svg b/d0/d3d/insertion__sort_8c__incl.svg index 1f9bcdb80..e1e926520 100644 --- a/d0/d3d/insertion__sort_8c__incl.svg +++ b/d0/d3d/insertion__sort_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - + sorting/insertion_sort.c diff --git a/d0/d3d/problem__8_2sol2_8c__incl.map b/d0/d3d/problem__8_2sol2_8c__incl.map index 0ae87c433..e4723f201 100644 --- a/d0/d3d/problem__8_2sol2_8c__incl.map +++ b/d0/d3d/problem__8_2sol2_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/d0/d3d/problem__8_2sol2_8c__incl.svg b/d0/d3d/problem__8_2sol2_8c__incl.svg index e459208d7..7161130fc 100644 --- a/d0/d3d/problem__8_2sol2_8c__incl.svg +++ b/d0/d3d/problem__8_2sol2_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - -project_euler/problem + +project_euler/problem _8/sol2.c diff --git a/d0/d43/structpid.html b/d0/d43/structpid.html index 64e792206..acc264a7d 100644 --- a/d0/d43/structpid.html +++ b/d0/d43/structpid.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: pid 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() {
@@ -92,45 +92,44 @@ $(document).ready(function(){initNavTree('d0/d43/structpid.html','../../'); init
-
-
pid Struct Reference
+
pid Struct Reference

PID Controller. More...

- - - - - -

+

Data Fields

+
float kP
 
+
float kI
 
+
float kD
 
+
float lastError
 
+
float integral
 

Detailed Description

-

PID Controller.

-

The PID controller is a linear control algorithm that has three terms:

    +

    PID Controller.

    +

    The PID controller is a linear control algorithm that has three terms:

    • Proportional: A simple scaling of the error value by a gain kP
    • Integral: Integration of the error value over time, then multipled by gain kI
    • Derivative: Rate of change of the error value over time, multiplied by gain kD
    -

    Terms of the controller can be removed by setting their gain to 0, creating a PI (kD = 0) or PD (kI = 0) controller. Depending on the control problem at hand, some terms may not increase the performance of the system, or may have a negative effect.

    -

    For a more mathematical expanation of the PID Controller, see https://en.wikipedia.org/wiki/PID_controller

    -

    Limitations of this implementation:

      -
    • Since this implementation is just for demonstration, the pid_step function takes the dt as a parameter, and it can be provided by the user in main(). This allows deterministic experimentation with the algorithm, rather than using time(NULL) which would make the function non-deterministic.
    • +

      Terms of the controller can be removed by setting their gain to 0, creating a PI (kD = 0) or PD (kI = 0) controller. Depending on the control problem at hand, some terms may not increase the performance of the system, or may have a negative effect.

      +

      For a more mathematical expanation of the PID Controller, see https://en.wikipedia.org/wiki/PID_controller

      +

      Limitations of this implementation:

        +
      • Since this implementation is just for demonstration, the pid_step function takes the dt as a parameter, and it can be provided by the user in main(). This allows deterministic experimentation with the algorithm, rather than using time(NULL) which would make the function non-deterministic.
      -

      Inputs: e(t) - Current error at time t. For example, how far a servo is off the desired angle Output: u(t) - Controller output at time t.

      +

      Inputs: e(t) - Current error at time t. For example, how far a servo is off the desired angle Output: u(t) - Controller output at time t.


    The documentation for this struct was generated from the following file:
    • misc/pid.c
    @@ -140,7 +139,7 @@ float integral
      - +
diff --git a/d0/d43/structpid.js b/d0/d43/structpid.js deleted file mode 100644 index 719bde8ee..000000000 --- a/d0/d43/structpid.js +++ /dev/null @@ -1,8 +0,0 @@ -var structpid = -[ - [ "integral", "d0/d43/structpid.html#a3c54185f7b4867281786eff640443a00", null ], - [ "kD", "d0/d43/structpid.html#a6c721a7983511fb9f91777ae45481473", null ], - [ "kI", "d0/d43/structpid.html#a65e8bc146e02bad2702a0286d37b81bc", null ], - [ "kP", "d0/d43/structpid.html#a5a7b54866748e12568f9b9599b31f8eb", null ], - [ "lastError", "d0/d43/structpid.html#ad661092f21ab1e0e6aa35fbcfcf6f161", null ] -]; \ No newline at end of file diff --git a/d0/d46/kohonen__som__trace_8c.html b/d0/d46/kohonen__som__trace_8c.html index 1dbb5e2e7..6c1293711 100644 --- a/d0/d46/kohonen__som__trace_8c.html +++ b/d0/d46/kohonen__som__trace_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: machine_learning/kohonen_som_trace.c 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/d46/kohonen__som__trace_8c.html','.
Macros | Functions
-
-
kohonen_som_trace.c File Reference
+
kohonen_som_trace.c File Reference
-

Kohonen self organizing map (data tracing) +

Kohonen self organizing map (data tracing) More...

#include <math.h>
#include <stdio.h>
@@ -111,22 +110,22 @@ Include dependency graph for kohonen_som_trace.c:
- - + +#define  +#define 

+

Macros

-#define _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES
 required for MS Visual C
 
-#define max(a, b)   (((a) > (b)) ? (a) : (b))
max(a, b)   (((a) > (b)) ? (a) : (b))
 shorthand for maximum value
 
-#define min(a, b)   (((a) < (b)) ? (a) : (b))
min(a, b)   (((a) < (b)) ? (a) : (b))
 shorthand for minimum value
 
- @@ -150,10 +149,10 @@ Functions - + - + @@ -164,17 +163,16 @@ Functions - - + +

+

Functions

double _random (double a, double b)
 Helper function to generate a random number in a given interval. More...
 Test that creates a random set of points distributed near the circumference of a circle and trains an SOM that finds that circular pattern. More...
 
void test_lamniscate (double *const *data, int N)
 Creates a random set of points distributed near the locus of the Lamniscate of Gerono. More...
 Creates a random set of points distributed near the locus of the Lamniscate of Gerono. More...
 
void test2 ()
 Test that creates a random set of points distributed near the locus of the Lamniscate of Gerono and trains an SOM that finds that circular pattern. More...
 Test that creates a random set of points distributed near the locus of the Lamniscate of Gerono and trains an SOM that finds that circular pattern. More...
 
void test_3d_classes (double *const *data, int N)
 Creates a random set of points distributed in four clusters in 3D space with centroids at the points. More...
double get_clock_diff (clock_t start_t, clock_t end_t)
 Convert clock cycle difference to time in seconds. More...
 
-int main (int argc, char **argv)
 Main function.
int main (int argc, char **argv)
 Main function. More...
 

Detailed Description

-

Kohonen self organizing map (data tracing)

-

This example implements a powerful self organizing map algorithm. The algorithm creates a connected network of weights that closely follows the given data points. This this creates a chain of nodes that resembles the given input shape.

Author
Krishna Vedala
+

Kohonen self organizing map (data tracing)

+

This example implements a powerful self organizing map algorithm. The algorithm creates a connected network of weights that closely follows the given data points. This this creates a chain of nodes that resembles the given input shape.

Author
Krishna Vedala
See also
kohonen_som_topology.c

Function Documentation

- +

◆ get_clock_diff()

@@ -209,13 +207,79 @@ int 
Returns
time difference in seconds
-
512 {
-
513  return (double)(end_t - start_t) / (double)CLOCKS_PER_SEC;
-
514 }
+
512{
+
513 return (double)(end_t - start_t) / (double)CLOCKS_PER_SEC;
+
514}
- + +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char ** argv 
)
+
+ +

Main function.

+
518{
+
519#ifdef _OPENMP
+
520 printf("Using OpenMP based parallelization\n");
+
521#else
+
522 printf("NOT using OpenMP based parallelization\n");
+
523#endif
+
524 clock_t start_clk = clock();
+
525 test1();
+
526 clock_t end_clk = clock();
+
527 printf("Test 1 completed in %.4g sec\n",
+
528 get_clock_diff(start_clk, end_clk));
+
529 start_clk = clock();
+
530 test2();
+
531 end_clk = clock();
+
532 printf("Test 2 completed in %.4g sec\n",
+
533 get_clock_diff(start_clk, end_clk));
+
534 start_clk = clock();
+
535 test3();
+
536 end_clk = clock();
+
537 printf("Test 3 completed in %.4g sec\n",
+
538 get_clock_diff(start_clk, end_clk));
+
539 printf(
+
540 "(Note: Calculated times include: creating test sets, training "
+
541 "model and writing files to disk.)\n\n");
+
542 return 0;
+
543}
+
void test2()
Test that creates a random set of points distributed near the locus of the Lamniscate of Gerono and t...
Definition: kohonen_som_trace.c:358
+
void test1()
Test that creates a random set of points distributed near the circumference of a circle and trains an...
Definition: kohonen_som_trace.c:261
+
double get_clock_diff(clock_t start_t, clock_t end_t)
Convert clock cycle difference to time in seconds.
Definition: kohonen_som_trace.c:511
+
void test3()
Test that creates a random set of points distributed in six clusters in 3D space.
Definition: kohonen_som_trace.c:462
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+

◆ test1()

@@ -231,59 +295,59 @@ int 

Test that creates a random set of points distributed near the circumference of a circle and trains an SOM that finds that circular pattern.

-

The following CSV files are created to validate the execution:

    +

    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
    -

    The outputs can be readily plotted in gnuplot using the following snippet

    set datafile separator ','
    +

    The outputs can be readily plotted in gnuplot using the following snippet

    set datafile separator ','
    plot "test1.csv" title "original", \
    "w11.csv" title "w1", \
    "w12.csv" title "w2"

    Sample execution
 output

    -
    262 {
    -
    263  int j, N = 500;
    -
    264  int features = 2;
    -
    265  int num_out = 50;
    -
    266 
    -
    267  // 2D space, hence size = number of rows * 2
    -
    268  double **X = (double **)malloc(N * sizeof(double *));
    -
    269 
    -
    270  // number of clusters nodes * 2
    -
    271  double **W = (double **)malloc(num_out * sizeof(double *));
    -
    272 
    -
    273  for (int i = 0; i < max(num_out, N); i++) // loop till max(N, num_out)
    -
    274  {
    -
    275  if (i < N) // only add new arrays if i < N
    -
    276  X[i] = (double *)malloc(features * sizeof(double));
    -
    277  if (i < num_out) // only add new arrays if i < num_out
    -
    278  {
    -
    279  W[i] = (double *)malloc(features * sizeof(double));
    -
    280 #ifdef _OPENMP
    -
    281 #pragma omp for
    -
    282 #endif
    -
    283  // preallocate with random initial weights
    -
    284  for (j = 0; j < features; j++) W[i][j] = _random(-1, 1);
    -
    285  }
    -
    286  }
    -
    287 
    -
    288  test_circle(X, N); // create test data around circumference of a circle
    -
    289  save_nd_data("test1.csv", X, N, features); // save test data points
    -
    290  save_nd_data("w11.csv", W, num_out,
    -
    291  features); // save initial random weights
    -
    292  kohonen_som_tracer(X, W, N, features, num_out, 0.1); // train the SOM
    -
    293  save_nd_data("w12.csv", W, num_out,
    -
    294  features); // save the resultant weights
    -
    295 
    -
    296  for (int i = 0; i < max(num_out, N); i++)
    -
    297  {
    -
    298  if (i < N)
    -
    299  free(X[i]);
    -
    300  if (i < num_out)
    -
    301  free(W[i]);
    -
    302  }
    -
    303 }
    +
    262{
    +
    263 int j, N = 500;
    +
    264 int features = 2;
    +
    265 int num_out = 50;
    +
    266
    +
    267 // 2D space, hence size = number of rows * 2
    +
    268 double **X = (double **)malloc(N * sizeof(double *));
    +
    269
    +
    270 // number of clusters nodes * 2
    +
    271 double **W = (double **)malloc(num_out * sizeof(double *));
    +
    272
    +
    273 for (int i = 0; i < max(num_out, N); i++) // loop till max(N, num_out)
    +
    274 {
    +
    275 if (i < N) // only add new arrays if i < N
    +
    276 X[i] = (double *)malloc(features * sizeof(double));
    +
    277 if (i < num_out) // only add new arrays if i < num_out
    +
    278 {
    +
    279 W[i] = (double *)malloc(features * sizeof(double));
    +
    280#ifdef _OPENMP
    +
    281#pragma omp for
    +
    282#endif
    +
    283 // preallocate with random initial weights
    +
    284 for (j = 0; j < features; j++) W[i][j] = _random(-1, 1);
    +
    285 }
    +
    286 }
    +
    287
    +
    288 test_circle(X, N); // create test data around circumference of a circle
    +
    289 save_nd_data("test1.csv", X, N, features); // save test data points
    +
    290 save_nd_data("w11.csv", W, num_out,
    +
    291 features); // save initial random weights
    +
    292 kohonen_som_tracer(X, W, N, features, num_out, 0.1); // train the SOM
    +
    293 save_nd_data("w12.csv", W, num_out,
    +
    294 features); // save the resultant weights
    +
    295
    +
    296 for (int i = 0; i < max(num_out, N); i++)
    +
    297 {
    +
    298 if (i < N)
    +
    299 free(X[i]);
    +
    300 if (i < num_out)
    +
    301 free(W[i]);
    +
    302 }
    +
    303}
    int save_nd_data(const char *fname, double **X, int num_points, int num_features)
    Save a given n-dimensional data martix to file.
    Definition: kohonen_som_trace.c:70
    void kohonen_som_tracer(double **X, double *const *W, int num_samples, int num_features, int num_out, double alpha_min)
    Apply incremental algorithm with updating neighborhood and learning rates on all samples in the given...
    Definition: kohonen_som_trace.c:179
    double _random(double a, double b)
    Helper function to generate a random number in a given interval.
    Definition: kohonen_som_trace.c:54
    @@ -294,13 +358,13 @@ output" style="pointer-events: none;" class="inline"/>

    Here is the call graph for this function:
    -
    +
    - +

    ◆ test2()

    @@ -315,69 +379,69 @@ Here is the call graph for this function:
    -

    Test that creates a random set of points distributed near the locus of the Lamniscate of Gerono 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 near the locus of the Lamniscate of Gerono and trains an SOM that finds that circular 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
      -

      The outputs can be readily plotted in gnuplot using the following snippet

      set datafile separator ','
      +

      The outputs can be readily plotted in gnuplot using the following snippet

      set datafile separator ','
      plot "test2.csv" title "original", \
      "w21.csv" title "w1", \
      "w22.csv" title "w2"

      Sample execution
 output

      -
      359 {
      -
      360  int j, N = 500;
      -
      361  int features = 2;
      -
      362  int num_out = 20;
      -
      363  double **X = (double **)malloc(N * sizeof(double *));
      -
      364  double **W = (double **)malloc(num_out * sizeof(double *));
      -
      365  for (int i = 0; i < max(num_out, N); i++)
      -
      366  {
      -
      367  if (i < N) // only add new arrays if i < N
      -
      368  X[i] = (double *)malloc(features * sizeof(double));
      -
      369  if (i < num_out) // only add new arrays if i < num_out
      -
      370  {
      -
      371  W[i] = (double *)malloc(features * sizeof(double));
      -
      372 
      -
      373 #ifdef _OPENMP
      -
      374 #pragma omp for
      -
      375 #endif
      -
      376  // preallocate with random initial weights
      -
      377  for (j = 0; j < features; j++) W[i][j] = _random(-1, 1);
      -
      378  }
      -
      379  }
      -
      380 
      -
      381  test_lamniscate(X, N); // create test data around the lamniscate
      -
      382  save_nd_data("test2.csv", X, N, features); // save test data points
      -
      383  save_nd_data("w21.csv", W, num_out,
      -
      384  features); // save initial random weights
      -
      385  kohonen_som_tracer(X, W, N, features, num_out, 0.01); // train the SOM
      -
      386  save_nd_data("w22.csv", W, num_out,
      -
      387  features); // save the resultant weights
      -
      388 
      -
      389  for (int i = 0; i < max(num_out, N); i++)
      -
      390  {
      -
      391  if (i < N)
      -
      392  free(X[i]);
      -
      393  if (i < num_out)
      -
      394  free(W[i]);
      -
      395  }
      -
      396  free(X);
      -
      397  free(W);
      -
      398 }
      +
      359{
      +
      360 int j, N = 500;
      +
      361 int features = 2;
      +
      362 int num_out = 20;
      +
      363 double **X = (double **)malloc(N * sizeof(double *));
      +
      364 double **W = (double **)malloc(num_out * sizeof(double *));
      +
      365 for (int i = 0; i < max(num_out, N); i++)
      +
      366 {
      +
      367 if (i < N) // only add new arrays if i < N
      +
      368 X[i] = (double *)malloc(features * sizeof(double));
      +
      369 if (i < num_out) // only add new arrays if i < num_out
      +
      370 {
      +
      371 W[i] = (double *)malloc(features * sizeof(double));
      +
      372
      +
      373#ifdef _OPENMP
      +
      374#pragma omp for
      +
      375#endif
      +
      376 // preallocate with random initial weights
      +
      377 for (j = 0; j < features; j++) W[i][j] = _random(-1, 1);
      +
      378 }
      +
      379 }
      +
      380
      +
      381 test_lamniscate(X, N); // create test data around the lamniscate
      +
      382 save_nd_data("test2.csv", X, N, features); // save test data points
      +
      383 save_nd_data("w21.csv", W, num_out,
      +
      384 features); // save initial random weights
      +
      385 kohonen_som_tracer(X, W, N, features, num_out, 0.01); // train the SOM
      +
      386 save_nd_data("w22.csv", W, num_out,
      +
      387 features); // save the resultant weights
      +
      388
      +
      389 for (int i = 0; i < max(num_out, N); i++)
      +
      390 {
      +
      391 if (i < N)
      +
      392 free(X[i]);
      +
      393 if (i < num_out)
      +
      394 free(W[i]);
      +
      395 }
      +
      396 free(X);
      +
      397 free(W);
      +
      398}
      void test_lamniscate(double *const *data, int N)
      Creates a random set of points distributed near the locus of the Lamniscate of Gerono.
      Definition: kohonen_som_trace.c:319
      Here is the call graph for this function:
      -
      +
      - +

      ◆ test3()

      @@ -393,68 +457,68 @@ Here is the call graph for this function:

      Test that creates a random set of points distributed in six clusters in 3D space.

      -

      The following CSV files are created to validate the execution:

        +

        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
        -

        The outputs can be readily plotted in gnuplot using the following snippet

        set datafile separator ','
        +

        The outputs can be readily plotted in gnuplot using the following snippet

        set datafile separator ','
        plot "test3.csv" title "original", \
        "w31.csv" title "w1", \
        "w32.csv" title "w2"

        Sample execution
 output

        -
        463 {
        -
        464  int j, N = 200;
        -
        465  int features = 3;
        -
        466  int num_out = 20;
        -
        467  double **X = (double **)malloc(N * sizeof(double *));
        -
        468  double **W = (double **)malloc(num_out * sizeof(double *));
        -
        469  for (int i = 0; i < max(num_out, N); i++)
        -
        470  {
        -
        471  if (i < N) // only add new arrays if i < N
        -
        472  X[i] = (double *)malloc(features * sizeof(double));
        -
        473  if (i < num_out) // only add new arrays if i < num_out
        -
        474  {
        -
        475  W[i] = (double *)malloc(features * sizeof(double));
        -
        476 
        -
        477 #ifdef _OPENMP
        -
        478 #pragma omp for
        -
        479 #endif
        -
        480  // preallocate with random initial weights
        -
        481  for (j = 0; j < features; j++) W[i][j] = _random(-1, 1);
        -
        482  }
        -
        483  }
        -
        484 
        -
        485  test_3d_classes(X, N); // create test data around the lamniscate
        -
        486  save_nd_data("test3.csv", X, N, features); // save test data points
        -
        487  save_nd_data("w31.csv", W, num_out,
        -
        488  features); // save initial random weights
        -
        489  kohonen_som_tracer(X, W, N, features, num_out, 0.01); // train the SOM
        -
        490  save_nd_data("w32.csv", W, num_out,
        -
        491  features); // save the resultant weights
        -
        492 
        -
        493  for (int i = 0; i < max(num_out, N); i++)
        -
        494  {
        -
        495  if (i < N)
        -
        496  free(X[i]);
        -
        497  if (i < num_out)
        -
        498  free(W[i]);
        -
        499  }
        -
        500  free(X);
        -
        501  free(W);
        -
        502 }
        +
        463{
        +
        464 int j, N = 200;
        +
        465 int features = 3;
        +
        466 int num_out = 20;
        +
        467 double **X = (double **)malloc(N * sizeof(double *));
        +
        468 double **W = (double **)malloc(num_out * sizeof(double *));
        +
        469 for (int i = 0; i < max(num_out, N); i++)
        +
        470 {
        +
        471 if (i < N) // only add new arrays if i < N
        +
        472 X[i] = (double *)malloc(features * sizeof(double));
        +
        473 if (i < num_out) // only add new arrays if i < num_out
        +
        474 {
        +
        475 W[i] = (double *)malloc(features * sizeof(double));
        +
        476
        +
        477#ifdef _OPENMP
        +
        478#pragma omp for
        +
        479#endif
        +
        480 // preallocate with random initial weights
        +
        481 for (j = 0; j < features; j++) W[i][j] = _random(-1, 1);
        +
        482 }
        +
        483 }
        +
        484
        +
        485 test_3d_classes(X, N); // create test data around the lamniscate
        +
        486 save_nd_data("test3.csv", X, N, features); // save test data points
        +
        487 save_nd_data("w31.csv", W, num_out,
        +
        488 features); // save initial random weights
        +
        489 kohonen_som_tracer(X, W, N, features, num_out, 0.01); // train the SOM
        +
        490 save_nd_data("w32.csv", W, num_out,
        +
        491 features); // save the resultant weights
        +
        492
        +
        493 for (int i = 0; i < max(num_out, N); i++)
        +
        494 {
        +
        495 if (i < N)
        +
        496 free(X[i]);
        +
        497 if (i < num_out)
        +
        498 free(W[i]);
        +
        499 }
        +
        500 free(X);
        +
        501 free(W);
        +
        502}
        void test_3d_classes(double *const *data, int N)
        Creates a random set of points distributed in four clusters in 3D space with centroids at the points.
        Definition: kohonen_som_trace.c:410
        Here is the call graph for this function:
        -
        +
        - +

        ◆ test_3d_classes()

        @@ -494,48 +558,48 @@ Here is the call graph for this function:
        -
        411 {
        -
        412  const double R = 0.1; // radius of cluster
        -
        413  int i;
        -
        414  const int num_classes = 4;
        -
        415  const double centres[][3] = {
        -
        416  // centres of each class cluster
        -
        417  {.5, .5, .5}, // centre of class 1
        -
        418  {.5, -.5, -.5}, // centre of class 2
        -
        419  {-.5, .5, .5}, // centre of class 3
        -
        420  {-.5, -.5 - .5} // centre of class 4
        -
        421  };
        -
        422 
        -
        423 #ifdef _OPENMP
        -
        424 #pragma omp for
        -
        425 #endif
        -
        426  for (i = 0; i < N; i++)
        -
        427  {
        -
        428  int class =
        -
        429  rand() % num_classes; // select a random class for the point
        -
        430 
        -
        431  // create random coordinates (x,y,z) around the centre of the class
        -
        432  data[i][0] = _random(centres[class][0] - R, centres[class][0] + R);
        -
        433  data[i][1] = _random(centres[class][1] - R, centres[class][1] + R);
        -
        434  data[i][2] = _random(centres[class][2] - R, centres[class][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 double R = 0.1; // radius of cluster
        +
        413 int i;
        +
        414 const int num_classes = 4;
        +
        415 const double centres[][3] = {
        +
        416 // centres of each class cluster
        +
        417 {.5, .5, .5}, // centre of class 1
        +
        418 {.5, -.5, -.5}, // centre of class 2
        +
        419 {-.5, .5, .5}, // centre of class 3
        +
        420 {-.5, -.5 - .5} // centre of class 4
        +
        421 };
        +
        422
        +
        423#ifdef _OPENMP
        +
        424#pragma omp for
        +
        425#endif
        +
        426 for (i = 0; i < N; i++)
        +
        427 {
        +
        428 int class =
        +
        429 rand() % num_classes; // select a random class for the point
        +
        430
        +
        431 // create random coordinates (x,y,z) around the centre of the class
        +
        432 data[i][0] = _random(centres[class][0] - R, centres[class][0] + R);
        +
        433 data[i][1] = _random(centres[class][1] - R, centres[class][1] + R);
        +
        434 data[i][2] = _random(centres[class][2] - R, centres[class][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}
        Definition: prime_factoriziation.c:25
        Here is the call graph for this function:
        -
        +
        - +

        ◆ test_circle()

        @@ -562,7 +626,7 @@ Here is the call graph for this function:

        Creates a random set of points distributed near the circumference of a circle and trains an SOM that finds that circular pattern.

        -

        The generating function is

        +

        The generating function is

        \begin{eqnarray*} r &\in& [1-\delta r, 1+\delta r)\\ \theta &\in& [0, 2\pi)\\ x &=& r\cos\theta\\ y &=& r\sin\theta \end{eqnarray*}

        Parameters
        @@ -572,33 +636,33 @@ Here is the call graph for this function:
        -
        224 {
        -
        225  const double R = 0.75, dr = 0.3;
        -
        226  double a_t = 0., b_t = 2.f * M_PI; // theta random between 0 and 2*pi
        -
        227  double a_r = R - dr, b_r = R + dr; // radius random between R-dr and R+dr
        -
        228  int i;
        -
        229 
        -
        230 #ifdef _OPENMP
        -
        231 #pragma omp for
        -
        232 #endif
        -
        233  for (i = 0; i < N; i++)
        -
        234  {
        -
        235  double r = _random(a_r, b_r); // random radius
        -
        236  double theta = _random(a_t, b_t); // random theta
        -
        237  data[i][0] = r * cos(theta); // convert from polar to cartesian
        -
        238  data[i][1] = r * sin(theta);
        -
        239  }
        -
        240 }
        +
        224{
        +
        225 const double R = 0.75, dr = 0.3;
        +
        226 double a_t = 0., b_t = 2.f * M_PI; // theta random between 0 and 2*pi
        +
        227 double a_r = R - dr, b_r = R + dr; // radius random between R-dr and R+dr
        +
        228 int i;
        +
        229
        +
        230#ifdef _OPENMP
        +
        231#pragma omp for
        +
        232#endif
        +
        233 for (i = 0; i < N; i++)
        +
        234 {
        +
        235 double r = _random(a_r, b_r); // random radius
        +
        236 double theta = _random(a_t, b_t); // random theta
        +
        237 data[i][0] = r * cos(theta); // convert from polar to cartesian
        +
        238 data[i][1] = r * sin(theta);
        +
        239 }
        +
        240}
        Here is the call graph for this function:
        -
        +
        - +

        ◆ test_lamniscate()

        @@ -624,7 +688,7 @@ Here is the call graph for this function:
      -

      Creates a random set of points distributed near the locus of the Lamniscate of Gerono.

      +

      Creates a random set of points distributed near the locus of the Lamniscate of Gerono.

      \begin{eqnarray*} \delta r &=& 0.2\\ \delta x &\in& [-\delta r, \delta r)\\ \delta y &\in& [-\delta r, \delta r)\\ \theta &\in& [0, \pi)\\ x &=& \delta x + \cos\theta\\ y &=& \delta y + \frac{\sin(2\theta)}{2} \end{eqnarray*}

      @@ -635,26 +699,26 @@ Here is the call graph for this function:
      -
      320 {
      -
      321  const double dr = 0.2;
      -
      322  int i;
      -
      323 
      -
      324 #ifdef _OPENMP
      -
      325 #pragma omp for
      -
      326 #endif
      -
      327  for (i = 0; i < N; i++)
      -
      328  {
      -
      329  double dx = _random(-dr, dr); // random change in x
      -
      330  double dy = _random(-dr, dr); // random change in y
      -
      331  double theta = _random(0, M_PI); // random theta
      -
      332  data[i][0] = dx + cos(theta); // convert from polar to cartesian
      -
      333  data[i][1] = dy + sin(2. * theta) / 2.f;
      -
      334  }
      -
      335 }
      +
      320{
      +
      321 const double dr = 0.2;
      +
      322 int i;
      +
      323
      +
      324#ifdef _OPENMP
      +
      325#pragma omp for
      +
      326#endif
      +
      327 for (i = 0; i < N; i++)
      +
      328 {
      +
      329 double dx = _random(-dr, dr); // random change in x
      +
      330 double dy = _random(-dr, dr); // random change in y
      +
      331 double theta = _random(0, M_PI); // random theta
      +
      332 data[i][0] = dx + cos(theta); // convert from polar to cartesian
      +
      333 data[i][1] = dy + sin(2. * theta) / 2.f;
      +
      334 }
      +
      335}
      Here is the call graph for this function:
      -
      +
      @@ -666,7 +730,7 @@ Here is the call graph for this function:
      diff --git a/d0/d46/kohonen__som__trace_8c_a0283886819c7c140a023582b7269e2d0_cgraph.map b/d0/d46/kohonen__som__trace_8c_a0283886819c7c140a023582b7269e2d0_cgraph.map index 77d5b4128..f8e78c437 100644 --- a/d0/d46/kohonen__som__trace_8c_a0283886819c7c140a023582b7269e2d0_cgraph.map +++ b/d0/d46/kohonen__som__trace_8c_a0283886819c7c140a023582b7269e2d0_cgraph.map @@ -1,9 +1,9 @@ - - - - - - + + + + + + diff --git a/d0/d46/kohonen__som__trace_8c_a0283886819c7c140a023582b7269e2d0_cgraph.svg b/d0/d46/kohonen__som__trace_8c_a0283886819c7c140a023582b7269e2d0_cgraph.svg index 0495ae4fe..e6ab791a9 100644 --- a/d0/d46/kohonen__som__trace_8c_a0283886819c7c140a023582b7269e2d0_cgraph.svg +++ b/d0/d46/kohonen__som__trace_8c_a0283886819c7c140a023582b7269e2d0_cgraph.svg @@ -1,14 +1,60 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + test2 - + Node1 @@ -22,97 +68,139 @@ Node2 - -_random + +_random Node1->Node2 - - + + Node3 - -kohonen_som_tracer + +kohonen_som_tracer Node1->Node3 - - + + Node6 - -save_nd_data + +save_nd_data Node1->Node6 - - + + Node7 - -test_lamniscate + +test_lamniscate Node1->Node7 - - + + Node4 - -kohonen_update_weights + +kohonen_update_weights Node3->Node4 - - + + Node5 - -kohonen_get_min_1d + +kohonen_get_min_1d Node4->Node5 - - + + Node7->Node2 - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/d0/d46/kohonen__som__trace_8c_a0283886819c7c140a023582b7269e2d0_cgraph_org.svg b/d0/d46/kohonen__som__trace_8c_a0283886819c7c140a023582b7269e2d0_cgraph_org.svg new file mode 100644 index 000000000..097b55183 --- /dev/null +++ b/d0/d46/kohonen__som__trace_8c_a0283886819c7c140a023582b7269e2d0_cgraph_org.svg @@ -0,0 +1,118 @@ + + + + + + +test2 + + + +Node1 + + +test2 + + + + + +Node2 + + +_random + + + + + +Node1->Node2 + + + + + +Node3 + + +kohonen_som_tracer + + + + + +Node1->Node3 + + + + + +Node6 + + +save_nd_data + + + + + +Node1->Node6 + + + + + +Node7 + + +test_lamniscate + + + + + +Node1->Node7 + + + + + +Node4 + + +kohonen_update_weights + + + + + +Node3->Node4 + + + + + +Node5 + + +kohonen_get_min_1d + + + + + +Node4->Node5 + + + + + +Node7->Node2 + + + + + diff --git a/d0/d46/kohonen__som__trace_8c_a107f00650b8041f77767927073ddddb8_cgraph.map b/d0/d46/kohonen__som__trace_8c_a107f00650b8041f77767927073ddddb8_cgraph.map index 6b3943037..a089e69dd 100644 --- a/d0/d46/kohonen__som__trace_8c_a107f00650b8041f77767927073ddddb8_cgraph.map +++ b/d0/d46/kohonen__som__trace_8c_a107f00650b8041f77767927073ddddb8_cgraph.map @@ -1,4 +1,4 @@ - + diff --git a/d0/d46/kohonen__som__trace_8c_a107f00650b8041f77767927073ddddb8_cgraph.svg b/d0/d46/kohonen__som__trace_8c_a107f00650b8041f77767927073ddddb8_cgraph.svg index 24ae8403d..5cc92d486 100644 --- a/d0/d46/kohonen__som__trace_8c_a107f00650b8041f77767927073ddddb8_cgraph.svg +++ b/d0/d46/kohonen__som__trace_8c_a107f00650b8041f77767927073ddddb8_cgraph.svg @@ -1,14 +1,14 @@ - - + test_circle - + Node1 @@ -22,16 +22,16 @@ Node2 - -_random + +_random Node1->Node2 - - + + diff --git a/d0/d46/kohonen__som__trace_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.map b/d0/d46/kohonen__som__trace_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.map index 855e88e0e..0548bd244 100644 --- a/d0/d46/kohonen__som__trace_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.map +++ b/d0/d46/kohonen__som__trace_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.map @@ -1,9 +1,9 @@ - - - - - - + + + + + + diff --git a/d0/d46/kohonen__som__trace_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg b/d0/d46/kohonen__som__trace_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg index 58e77910f..96880e254 100644 --- a/d0/d46/kohonen__som__trace_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg +++ b/d0/d46/kohonen__som__trace_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg @@ -1,14 +1,60 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + test1 - + Node1 @@ -22,97 +68,139 @@ Node2 - -_random + +_random Node1->Node2 - - + + Node3 - -kohonen_som_tracer + +kohonen_som_tracer Node1->Node3 - - + + Node6 - -save_nd_data + +save_nd_data Node1->Node6 - - + + Node7 - -test_circle + +test_circle Node1->Node7 - - + + Node4 - -kohonen_update_weights + +kohonen_update_weights Node3->Node4 - - + + Node5 - -kohonen_get_min_1d + +kohonen_get_min_1d Node4->Node5 - - + + Node7->Node2 - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/d0/d46/kohonen__som__trace_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph_org.svg b/d0/d46/kohonen__som__trace_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph_org.svg new file mode 100644 index 000000000..9266cc73c --- /dev/null +++ b/d0/d46/kohonen__som__trace_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph_org.svg @@ -0,0 +1,118 @@ + + + + + + +test1 + + + +Node1 + + +test1 + + + + + +Node2 + + +_random + + + + + +Node1->Node2 + + + + + +Node3 + + +kohonen_som_tracer + + + + + +Node1->Node3 + + + + + +Node6 + + +save_nd_data + + + + + +Node1->Node6 + + + + + +Node7 + + +test_circle + + + + + +Node1->Node7 + + + + + +Node4 + + +kohonen_update_weights + + + + + +Node3->Node4 + + + + + +Node5 + + +kohonen_get_min_1d + + + + + +Node4->Node5 + + + + + +Node7->Node2 + + + + + diff --git a/d0/d46/kohonen__som__trace_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map b/d0/d46/kohonen__som__trace_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map new file mode 100644 index 000000000..681a06f36 --- /dev/null +++ b/d0/d46/kohonen__som__trace_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/d0/d46/kohonen__som__trace_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 b/d0/d46/kohonen__som__trace_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 new file mode 100644 index 000000000..0fce0548f --- /dev/null +++ b/d0/d46/kohonen__som__trace_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 @@ -0,0 +1 @@ +e807e99466c61606f8f9a55fd8367c86 \ No newline at end of file diff --git a/d0/d46/kohonen__som__trace_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg b/d0/d46/kohonen__som__trace_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg new file mode 100644 index 000000000..9103eafef --- /dev/null +++ b/d0/d46/kohonen__som__trace_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg @@ -0,0 +1,344 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +get_clock_diff + + + + + +Node1->Node2 + + + + + +Node3 + + +test1 + + + + + +Node1->Node3 + + + + + +Node10 + + +test2 + + + + + +Node1->Node10 + + + + + +Node12 + + +test3 + + + + + +Node1->Node12 + + + + + +Node4 + + +_random + + + + + +Node3->Node4 + + + + + +Node5 + + +kohonen_som_tracer + + + + + +Node3->Node5 + + + + + +Node8 + + +save_nd_data + + + + + +Node3->Node8 + + + + + +Node9 + + +test_circle + + + + + +Node3->Node9 + + + + + +Node6 + + +kohonen_update_weights + + + + + +Node5->Node6 + + + + + +Node7 + + +kohonen_get_min_1d + + + + + +Node6->Node7 + + + + + +Node9->Node4 + + + + + +Node10->Node4 + + + + + +Node10->Node5 + + + + + +Node10->Node8 + + + + + +Node11 + + +test_lamniscate + + + + + +Node10->Node11 + + + + + +Node11->Node4 + + + + + +Node12->Node4 + + + + + +Node12->Node5 + + + + + +Node12->Node8 + + + + + +Node13 + + +test_3d_classes + + + + + +Node12->Node13 + + + + + +Node13->Node4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/d0/d46/kohonen__som__trace_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph_org.svg b/d0/d46/kohonen__som__trace_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph_org.svg new file mode 100644 index 000000000..a14a6a0f2 --- /dev/null +++ b/d0/d46/kohonen__som__trace_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph_org.svg @@ -0,0 +1,256 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +get_clock_diff + + + + + +Node1->Node2 + + + + + +Node3 + + +test1 + + + + + +Node1->Node3 + + + + + +Node10 + + +test2 + + + + + +Node1->Node10 + + + + + +Node12 + + +test3 + + + + + +Node1->Node12 + + + + + +Node4 + + +_random + + + + + +Node3->Node4 + + + + + +Node5 + + +kohonen_som_tracer + + + + + +Node3->Node5 + + + + + +Node8 + + +save_nd_data + + + + + +Node3->Node8 + + + + + +Node9 + + +test_circle + + + + + +Node3->Node9 + + + + + +Node6 + + +kohonen_update_weights + + + + + +Node5->Node6 + + + + + +Node7 + + +kohonen_get_min_1d + + + + + +Node6->Node7 + + + + + +Node9->Node4 + + + + + +Node10->Node4 + + + + + +Node10->Node5 + + + + + +Node10->Node8 + + + + + +Node11 + + +test_lamniscate + + + + + +Node10->Node11 + + + + + +Node11->Node4 + + + + + +Node12->Node4 + + + + + +Node12->Node5 + + + + + +Node12->Node8 + + + + + +Node13 + + +test_3d_classes + + + + + +Node12->Node13 + + + + + +Node13->Node4 + + + + + diff --git a/d0/d46/kohonen__som__trace_8c_a41ae16442e3e5b891a58d2e5932a2cd0_cgraph.map b/d0/d46/kohonen__som__trace_8c_a41ae16442e3e5b891a58d2e5932a2cd0_cgraph.map index 99b0ec1d6..ba3356be2 100644 --- a/d0/d46/kohonen__som__trace_8c_a41ae16442e3e5b891a58d2e5932a2cd0_cgraph.map +++ b/d0/d46/kohonen__som__trace_8c_a41ae16442e3e5b891a58d2e5932a2cd0_cgraph.map @@ -1,4 +1,4 @@ - + diff --git a/d0/d46/kohonen__som__trace_8c_a41ae16442e3e5b891a58d2e5932a2cd0_cgraph.svg b/d0/d46/kohonen__som__trace_8c_a41ae16442e3e5b891a58d2e5932a2cd0_cgraph.svg index 32f8da141..59c0de8a0 100644 --- a/d0/d46/kohonen__som__trace_8c_a41ae16442e3e5b891a58d2e5932a2cd0_cgraph.svg +++ b/d0/d46/kohonen__som__trace_8c_a41ae16442e3e5b891a58d2e5932a2cd0_cgraph.svg @@ -1,14 +1,14 @@ - - + test_3d_classes - + Node1 @@ -22,16 +22,16 @@ Node2 - -_random + +_random Node1->Node2 - - + + diff --git a/d0/d46/kohonen__som__trace_8c_a6d0455dd5c30adda100e95f0423c786e_cgraph.map b/d0/d46/kohonen__som__trace_8c_a6d0455dd5c30adda100e95f0423c786e_cgraph.map index c3d6bdea7..2fc58e5f5 100644 --- a/d0/d46/kohonen__som__trace_8c_a6d0455dd5c30adda100e95f0423c786e_cgraph.map +++ b/d0/d46/kohonen__som__trace_8c_a6d0455dd5c30adda100e95f0423c786e_cgraph.map @@ -1,9 +1,9 @@ - - - - - - + + + + + + diff --git a/d0/d46/kohonen__som__trace_8c_a6d0455dd5c30adda100e95f0423c786e_cgraph.svg b/d0/d46/kohonen__som__trace_8c_a6d0455dd5c30adda100e95f0423c786e_cgraph.svg index 863316ebd..76f2c6fa8 100644 --- a/d0/d46/kohonen__som__trace_8c_a6d0455dd5c30adda100e95f0423c786e_cgraph.svg +++ b/d0/d46/kohonen__som__trace_8c_a6d0455dd5c30adda100e95f0423c786e_cgraph.svg @@ -1,14 +1,60 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + test3 - + Node1 @@ -22,97 +68,139 @@ Node2 - -_random + +_random Node1->Node2 - - + + Node3 - -kohonen_som_tracer + +kohonen_som_tracer Node1->Node3 - - + + Node6 - -save_nd_data + +save_nd_data Node1->Node6 - - + + Node7 - -test_3d_classes + +test_3d_classes Node1->Node7 - - + + Node4 - -kohonen_update_weights + +kohonen_update_weights Node3->Node4 - - + + Node5 - -kohonen_get_min_1d + +kohonen_get_min_1d Node4->Node5 - - + + Node7->Node2 - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/d0/d46/kohonen__som__trace_8c_a6d0455dd5c30adda100e95f0423c786e_cgraph_org.svg b/d0/d46/kohonen__som__trace_8c_a6d0455dd5c30adda100e95f0423c786e_cgraph_org.svg new file mode 100644 index 000000000..ff4fe39f8 --- /dev/null +++ b/d0/d46/kohonen__som__trace_8c_a6d0455dd5c30adda100e95f0423c786e_cgraph_org.svg @@ -0,0 +1,118 @@ + + + + + + +test3 + + + +Node1 + + +test3 + + + + + +Node2 + + +_random + + + + + +Node1->Node2 + + + + + +Node3 + + +kohonen_som_tracer + + + + + +Node1->Node3 + + + + + +Node6 + + +save_nd_data + + + + + +Node1->Node6 + + + + + +Node7 + + +test_3d_classes + + + + + +Node1->Node7 + + + + + +Node4 + + +kohonen_update_weights + + + + + +Node3->Node4 + + + + + +Node5 + + +kohonen_get_min_1d + + + + + +Node4->Node5 + + + + + +Node7->Node2 + + + + + diff --git a/d0/d46/kohonen__som__trace_8c_aa2246f940155472084ee461f3685d614_cgraph.map b/d0/d46/kohonen__som__trace_8c_aa2246f940155472084ee461f3685d614_cgraph.map index 80081c207..08ff68838 100644 --- a/d0/d46/kohonen__som__trace_8c_aa2246f940155472084ee461f3685d614_cgraph.map +++ b/d0/d46/kohonen__som__trace_8c_aa2246f940155472084ee461f3685d614_cgraph.map @@ -1,4 +1,4 @@ - + diff --git a/d0/d46/kohonen__som__trace_8c_aa2246f940155472084ee461f3685d614_cgraph.svg b/d0/d46/kohonen__som__trace_8c_aa2246f940155472084ee461f3685d614_cgraph.svg index 5c9c633ea..bc3e8d3ca 100644 --- a/d0/d46/kohonen__som__trace_8c_aa2246f940155472084ee461f3685d614_cgraph.svg +++ b/d0/d46/kohonen__som__trace_8c_aa2246f940155472084ee461f3685d614_cgraph.svg @@ -1,14 +1,14 @@ - - + test_lamniscate - + Node1 @@ -22,16 +22,16 @@ Node2 - -_random + +_random Node1->Node2 - - + + diff --git a/d0/d4d/problem__5_2sol1_8c__incl.map b/d0/d4d/problem__5_2sol1_8c__incl.map index 3056ca97c..ad4a5ed7c 100644 --- a/d0/d4d/problem__5_2sol1_8c__incl.map +++ b/d0/d4d/problem__5_2sol1_8c__incl.map @@ -1,5 +1,5 @@ - - - + + + diff --git a/d0/d4d/problem__5_2sol1_8c__incl.svg b/d0/d4d/problem__5_2sol1_8c__incl.svg index 2008a7926..c04228926 100644 --- a/d0/d4d/problem__5_2sol1_8c__incl.svg +++ b/d0/d4d/problem__5_2sol1_8c__incl.svg @@ -1,21 +1,21 @@ - - + project_euler/problem_5/sol1.c - + Node1 - + project_euler/problem -_5/sol1.c +_5/sol1.c @@ -23,31 +23,31 @@ Node2 - -stdio.h + +stdio.h Node1->Node2 - - + + Node3 - -stdlib.h + +stdlib.h Node1->Node3 - - + + diff --git a/d0/d57/hash__xor8_8c.html b/d0/d57/hash__xor8_8c.html index c9767b199..949e8462f 100644 --- a/d0/d57/hash__xor8_8c.html +++ b/d0/d57/hash__xor8_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: hash/hash_xor8.c 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/d57/hash__xor8_8c.html','../../');
    -
    -
    hash_xor8.c File Reference
    +
    hash_xor8.c File Reference
    -

    8-bit XOR hash algorithm for ASCII characters +

    8-bit XOR hash algorithm for ASCII characters More...

    #include <assert.h>
    #include <inttypes.h>
    @@ -109,7 +108,7 @@ Include dependency graph for hash_xor8.c:
- @@ -117,21 +116,52 @@ Functions - - + +

+

Functions

uint8_t xor8 (const char *s)
 8-bit XOR algorithm implementation More...
void test_xor8 ()
 Test function for xor8. More...
 
-int main ()
 Main function.
int main ()
 Main function. More...
 

Detailed Description

-

8-bit XOR hash algorithm for ASCII characters

-
Author
Christian Bender
-
+

8-bit XOR hash algorithm for ASCII characters

+
Author
Christian Bender
+

Function Documentation

+ +

◆ main()

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

Main function.

+
48{
+
49 test_xor8();
+
50 return 0;
+
51}
+
void test_xor8()
Test function for xor8.
Definition: hash_xor8.c:35
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ diff --git a/d0/d57/hash__xor8_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d0/d57/hash__xor8_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..99b620fce --- /dev/null +++ b/d0/d57/hash__xor8_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/d0/d57/hash__xor8_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d0/d57/hash__xor8_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..6f7aeb908 --- /dev/null +++ b/d0/d57/hash__xor8_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +e1a7052fce33c8f9e1c3df3629c67665 \ No newline at end of file diff --git a/d0/d57/hash__xor8_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d0/d57/hash__xor8_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..2421817f5 --- /dev/null +++ b/d0/d57/hash__xor8_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,52 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +test_xor8 + + + + + +Node1->Node2 + + + + + +Node3 + + +xor8 + + + + + +Node2->Node3 + + + + + diff --git a/d0/d59/problem__9_2sol2_8c__incl.map b/d0/d59/problem__9_2sol2_8c__incl.map index 9023aa2ad..6df7f9fba 100644 --- a/d0/d59/problem__9_2sol2_8c__incl.map +++ b/d0/d59/problem__9_2sol2_8c__incl.map @@ -1,5 +1,5 @@ - - - + + + diff --git a/d0/d59/problem__9_2sol2_8c__incl.svg b/d0/d59/problem__9_2sol2_8c__incl.svg index 1527bc811..ce3538c76 100644 --- a/d0/d59/problem__9_2sol2_8c__incl.svg +++ b/d0/d59/problem__9_2sol2_8c__incl.svg @@ -1,21 +1,21 @@ - - + project_euler/problem_9/sol2.c - + Node1 - + project_euler/problem -_9/sol2.c +_9/sol2.c @@ -23,31 +23,31 @@ Node2 - -stdio.h + +stdio.h Node1->Node2 - - + + Node3 - -stdlib.h + +stdlib.h Node1->Node3 - - + + diff --git a/d0/d6b/structelem.html b/d0/d6b/structelem.html index 1cc8138ad..e1333426d 100644 --- a/d0/d6b/structelem.html +++ b/d0/d6b/structelem.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: elem 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() {
@@ -92,8 +92,7 @@ $(document).ready(function(){initNavTree('d0/d6b/structelem.html','../../'); ini
-
-
elem Struct Reference
+
elem Struct Reference
@@ -103,12 +102,12 @@ Collaboration diagram for elem:
[legend]
- - -

+

Data Fields

+
void * val
 
+
struct elem * next
 
@@ -121,7 +120,7 @@ struct elem *  diff --git a/d0/d6b/structelem.js b/d0/d6b/structelem.js deleted file mode 100644 index 9becd71c0..000000000 --- a/d0/d6b/structelem.js +++ /dev/null @@ -1,5 +0,0 @@ -var structelem = -[ - [ "next", "d0/d6b/structelem.html#ab9cf5c2e1c9a0ec2938275b90d39d5ca", null ], - [ "val", "d0/d6b/structelem.html#a738173725677dc7ccc8529cc8537c50d", null ] -]; \ No newline at end of file diff --git a/d0/d6c/problem__4_2sol_8c.html b/d0/d6c/problem__4_2sol_8c.html index 182d52672..2d1db67a3 100644 --- a/d0/d6c/problem__4_2sol_8c.html +++ b/d0/d6c/problem__4_2sol_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_4/sol.c 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,35 +92,33 @@ $(document).ready(function(){initNavTree('d0/d6c/problem__4_2sol_8c.html','../..
-
-
sol.c File Reference
+
sol.c File Reference
-

Problem 4 solution +

Problem 4 solution More...

#include <stdio.h>
Include dependency graph for sol.c:
-
+
- - - + +

+

Functions

int is_palindromic (unsigned int n)
 Check if number is palindromic. More...
 
-int main (void)
 Main function.
int main (void)
 Main function. More...
 

Detailed Description

-

Problem 4 solution

+

Problem 4 solution

Function Documentation

- +

◆ is_palindromic()

@@ -146,17 +144,61 @@ int 
Returns
1 if palindromic
0 if not palindromic
-
13 {
-
14  unsigned int reversed = 0, t = n;
-
15 
-
16  while (t > 0)
-
17  {
-
18  reversed = 10 * reversed + (t % 10);
-
19  t /= 10;
-
20  }
-
21  return reversed == n;
-
22 }
+
13{
+
14 unsigned int reversed = 0, t = n;
+
15
+
16 while (t > 0)
+
17 {
+
18 reversed = 10 * reversed + (t % 10);
+
19 t /= 10;
+
20 }
+
21 return reversed == n;
+
22}
+
+
+ +

◆ main()

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

Main function.

+
26{
+
27 unsigned int i, j, max = 0;
+
28 for (i = 100; i <= 999; i++)
+
29 {
+
30 for (j = 100; j <= 999; j++)
+
31 {
+
32 unsigned int p = i * j;
+
33 if (is_palindromic(p) && p > max)
+
34 {
+
35 max = p;
+
36 }
+
37 }
+
38 }
+
39 printf("%u\n", max);
+
40 return 0;
+
41}
+
#define max(a, b)
shorthand for maximum value
Definition: kohonen_som_topology.c:39
+
int is_palindromic(unsigned int n)
Check if number is palindromic.
Definition: sol.c:12
+
+Here is the call graph for this function:
+
+
+
+
+
@@ -165,7 +207,7 @@ int 
diff --git a/d0/d6c/problem__4_2sol_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map b/d0/d6c/problem__4_2sol_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map new file mode 100644 index 000000000..39680f0f0 --- /dev/null +++ b/d0/d6c/problem__4_2sol_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/d0/d6c/problem__4_2sol_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.md5 b/d0/d6c/problem__4_2sol_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.md5 new file mode 100644 index 000000000..4d21f6586 --- /dev/null +++ b/d0/d6c/problem__4_2sol_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.md5 @@ -0,0 +1 @@ +5ae48647fd17a3bb28d55141ca83d187 \ No newline at end of file diff --git a/d0/d6c/problem__4_2sol_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg b/d0/d6c/problem__4_2sol_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg new file mode 100644 index 000000000..b33e132af --- /dev/null +++ b/d0/d6c/problem__4_2sol_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg @@ -0,0 +1,37 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +is_palindromic + + + + + +Node1->Node2 + + + + + diff --git a/d0/d6d/problem__10_2sol1_8c.html b/d0/d6d/problem__10_2sol1_8c.html index 90c15ab77..3d92e040f 100644 --- a/d0/d6d/problem__10_2sol1_8c.html +++ b/d0/d6d/problem__10_2sol1_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_10/sol1.c 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/d6d/problem__10_2sol1_8c.html','../
-
-
sol1.c File Reference
+
sol1.c File Reference
-

Problem 10 solution +

Problem 10 solution More...

#include <math.h>
#include <stdio.h>
@@ -109,31 +108,139 @@ Include dependency graph for sol1.c:
- - - + + - - + + - - + +

+

Functions

-char is_prime (unsigned long n)
 Function to check if a number is prime.
char is_prime (unsigned long n)
 Function to check if a number is prime. More...
 
-unsigned long long sum_of_primes (unsigned long N)
 Computes sum of prime numbers less than N.
unsigned long long sum_of_primes (unsigned long N)
 Computes sum of prime numbers less than N. More...
 
-int main (int argc, char *argv[])
 Main function.
int main (int argc, char *argv[])
 Main function. More...
 

Detailed Description

-

Problem 10 solution

-
Author
Krishna Vedala
-
+

Problem 10 solution

+
Author
Krishna Vedala
+

Function Documentation

+ +

◆ is_prime()

+ +
+
+ + + + + + + + +
char is_prime (unsigned long n)
+
+ +

Function to check if a number is prime.

+
12{
+
13 for (unsigned long i = 2; i < sqrtl(n) + 1; i++)
+
14 if (n % i == 0)
+
15 return 0;
+
16
+
17 return 1;
+
18}
+
+
+
+ +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char * argv[] 
)
+
+ +

Main function.

+
34{
+
35 unsigned long n = 100;
+
36
+
37 if (argc == 2) /* if command line argument is provided */
+
38 n = atol(argv[1]); /* use that as the upper limit */
+
39
+
40 printf("%ld: %llu\n", n, sum_of_primes(n));
+
41
+
42 return 0;
+
43}
+
unsigned long long sum_of_primes(unsigned long N)
Computes sum of prime numbers less than N.
Definition: sol1.c:21
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ sum_of_primes()

+ +
+
+ + + + + + + + +
unsigned long long sum_of_primes (unsigned long N)
+
+ +

Computes sum of prime numbers less than N.

+
22{
+
23 unsigned long long sum = 2;
+
24
+
25 for (long i = 3; i < N; i += 2) /* skip even numbers */
+
26 if (is_prime(i))
+
27 sum += i;
+
28
+
29 return sum;
+
30}
+
char is_prime(unsigned long n)
Function to check if a number is prime.
Definition: sol1.c:11
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ diff --git a/d0/d6d/problem__10_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map b/d0/d6d/problem__10_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map new file mode 100644 index 000000000..893c132b3 --- /dev/null +++ b/d0/d6d/problem__10_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/d0/d6d/problem__10_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 b/d0/d6d/problem__10_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 new file mode 100644 index 000000000..b166aef39 --- /dev/null +++ b/d0/d6d/problem__10_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 @@ -0,0 +1 @@ +1494692a35e6af4481fb3b6e21201019 \ No newline at end of file diff --git a/d0/d6d/problem__10_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg b/d0/d6d/problem__10_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg new file mode 100644 index 000000000..43ff2a652 --- /dev/null +++ b/d0/d6d/problem__10_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg @@ -0,0 +1,52 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +sum_of_primes + + + + + +Node1->Node2 + + + + + +Node3 + + +is_prime + + + + + +Node2->Node3 + + + + + diff --git a/d0/d6d/problem__10_2sol1_8c_ae3d987cb2ad0ddb0c3caa4c2506a20e5_cgraph.map b/d0/d6d/problem__10_2sol1_8c_ae3d987cb2ad0ddb0c3caa4c2506a20e5_cgraph.map new file mode 100644 index 000000000..799b0cf46 --- /dev/null +++ b/d0/d6d/problem__10_2sol1_8c_ae3d987cb2ad0ddb0c3caa4c2506a20e5_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/d0/d6d/problem__10_2sol1_8c_ae3d987cb2ad0ddb0c3caa4c2506a20e5_cgraph.md5 b/d0/d6d/problem__10_2sol1_8c_ae3d987cb2ad0ddb0c3caa4c2506a20e5_cgraph.md5 new file mode 100644 index 000000000..92ef00deb --- /dev/null +++ b/d0/d6d/problem__10_2sol1_8c_ae3d987cb2ad0ddb0c3caa4c2506a20e5_cgraph.md5 @@ -0,0 +1 @@ +c0c14aacd265297e08e10766b8c71ebf \ No newline at end of file diff --git a/d0/d6d/problem__10_2sol1_8c_ae3d987cb2ad0ddb0c3caa4c2506a20e5_cgraph.svg b/d0/d6d/problem__10_2sol1_8c_ae3d987cb2ad0ddb0c3caa4c2506a20e5_cgraph.svg new file mode 100644 index 000000000..be7edd5c3 --- /dev/null +++ b/d0/d6d/problem__10_2sol1_8c_ae3d987cb2ad0ddb0c3caa4c2506a20e5_cgraph.svg @@ -0,0 +1,37 @@ + + + + + + +sum_of_primes + + + +Node1 + + +sum_of_primes + + + + + +Node2 + + +is_prime + + + + + +Node1->Node2 + + + + + diff --git a/d0/d7f/so1_8c.html b/d0/d7f/so1_8c.html index 5ad251f73..b0c11b725 100644 --- a/d0/d7f/so1_8c.html +++ b/d0/d7f/so1_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_2/so1.c 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,39 +92,78 @@ $(document).ready(function(){initNavTree('d0/d7f/so1_8c.html','../../'); initRes
-
-
so1.c File Reference
+
so1.c File Reference
-

Problem 2 solution +

Problem 2 solution More...

#include <stdio.h>
Include dependency graph for so1.c:
-
+
- - - + +

+

Functions

-int main ()
 Main function.
int main ()
 Main function. More...
 

Detailed Description

-

Problem 2 solution

-

Problem:

-

Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1,2,3,5,8,13,21,34,55,89,.. By considering the terms in the Fibonacci sequence whose values do not exceed n, find the sum of the even-valued terms. e.g. for n=10, we have {2,8}, sum is 10.

-
+

Problem 2 solution

+

Problem:

+

Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1,2,3,5,8,13,21,34,55,89,.. By considering the terms in the Fibonacci sequence whose values do not exceed n, find the sum of the even-valued terms. e.g. for n=10, we have {2,8}, sum is 10.

+

Function Documentation

+ +

◆ main()

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

Main function.

+
18{
+
19 int n = 0;
+
20 int sum = 0;
+
21 int i = 1;
+
22 int j = 2;
+
23 int temp;
+
24 scanf("%d", &n);
+
25
+
26 while (j <= n)
+
27 {
+
28 if ((j & 1) == 0) // can also use(j%2 == 0)
+
29 sum += j;
+
30 temp = i;
+
31 i = j;
+
32 j = temp + i;
+
33 }
+
34
+
35 printf("%d\n", sum);
+
36 return 0;
+
37}
+
+
+
+
diff --git a/d0/d8a/octal__to__hexadecimal_8c.html b/d0/d8a/octal__to__hexadecimal_8c.html index cd11d2c3c..fa8fddae7 100644 --- a/d0/d8a/octal__to__hexadecimal_8c.html +++ b/d0/d8a/octal__to__hexadecimal_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: conversions/octal_to_hexadecimal.c 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/d8a/octal__to__hexadecimal_8c.html'
-
-
octal_to_hexadecimal.c File Reference
+
octal_to_hexadecimal.c File Reference
@@ -111,14 +110,14 @@ Include dependency graph for octal_to_hexadecimal.c:
- - - - + + + @@ -127,10 +126,10 @@ Functions

+

Functions

long octalToDecimal (long octalValue)
 Convert octal number to decimal number. More...
 
char * octalToHexadecimal (long octalValue)
 Convert octal number to hexadecimal number dynamically allocated memory needs to be freed by the calling the function free. More...
 
char * octalToHexadecimal (long octalValue)
 Convert octal number to hexadecimal number dynamically allocated memory needs to be freed by the calling the function free. More...
 
static void test ()
 Test function. More...
 
 

Detailed Description

-

Octal to hexadecimal conversion by scanning user input.

-

The octalToHexadecimal function take the octal number as long return a string hexadecimal value after conversion

Author
Rachit Bhalla
+

Octal to hexadecimal conversion by scanning user input.

+

The octalToHexadecimal function take the octal number as long return a string hexadecimal value after conversion

Author
Rachit Bhalla

Function Documentation

- +

◆ main()

@@ -148,38 +147,38 @@ Functions

Main function.

Returns
0 on exit
-
61 {
-
62  // execute the tests
-
63  test();
-
64 
-
65  // get the value of octal number as input
-
66  int octalValue;
-
67  printf("Enter an octal number: ");
-
68  scanf("%d", &octalValue);
-
69 
-
70  // call the function octalToHexadecimal and print the hexadecimal value
-
71  char *hexadecimalValue = octalToHexadecimal(octalValue);
-
72  printf("Equivalent hexadecimal number is: %s", hexadecimalValue);
-
73 
-
74  // free the memory allocated dynamically in function octalToHexadecimal
-
75  free(hexadecimalValue);
-
76 
-
77  // return 0 and exit
-
78  return 0;
-
79 }
+
61{
+
62 // execute the tests
+
63 test();
+
64
+
65 // get the value of octal number as input
+
66 int octalValue;
+
67 printf("Enter an octal number: ");
+
68 scanf("%d", &octalValue);
+
69
+
70 // call the function octalToHexadecimal and print the hexadecimal value
+
71 char *hexadecimalValue = octalToHexadecimal(octalValue);
+
72 printf("Equivalent hexadecimal number is: %s", hexadecimalValue);
+
73
+
74 // free the memory allocated dynamically in function octalToHexadecimal
+
75 free(hexadecimalValue);
+
76
+
77 // return 0 and exit
+
78 return 0;
+
79}
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
-
char * octalToHexadecimal(long octalValue)
Convert octal number to hexadecimal number dynamically allocated memory needs to be freed by the call...
Definition: octal_to_hexadecimal.c:38
+
char * octalToHexadecimal(long octalValue)
Convert octal number to hexadecimal number dynamically allocated memory needs to be freed by the call...
Definition: octal_to_hexadecimal.c:38
static void test()
Test function.
Definition: octal_to_hexadecimal.c:48
Here is the call graph for this function:
-
+
- +

◆ octalToDecimal()

@@ -203,28 +202,28 @@ Here is the call graph for this function:
Returns
a decimal number after conversion
-
20  {
-
21  long decimalValue = 0;
-
22  int i = 0;
-
23  while (octalValue) {
-
24  // Extracts right-most digit, multiplies it with 8^i, and increment i by 1
-
25  decimalValue += (long)(octalValue % 10) * pow(8, i++);
-
26  // Shift right in base 10
-
27  octalValue /= 10;
-
28  }
-
29  return decimalValue;
-
30 }
+
20 {
+
21 long decimalValue = 0;
+
22 int i = 0;
+
23 while (octalValue) {
+
24 // Extracts right-most digit, multiplies it with 8^i, and increment i by 1
+
25 decimalValue += (long)(octalValue % 10) * pow(8, i++);
+
26 // Shift right in base 10
+
27 octalValue /= 10;
+
28 }
+
29 return decimalValue;
+
30}
- -

◆ octalToHexadecimal()

+ +

◆ octalToHexadecimal()

- + @@ -241,23 +240,23 @@ Here is the call graph for this function:
Returns
a hexadecimal value as a string after conversion
-
38  {
-
39  char *hexadecimalValue = malloc(256 * sizeof(char));
-
40  sprintf(hexadecimalValue, "%lX", octalToDecimal(octalValue));
-
41  return hexadecimalValue;
-
42 }
+
38 {
+
39 char *hexadecimalValue = malloc(256 * sizeof(char));
+
40 sprintf(hexadecimalValue, "%lX", octalToDecimal(octalValue));
+
41 return hexadecimalValue;
+
42}
#define malloc(bytes)
This macro replace the standard malloc function with malloc_dbg.
Definition: malloc_dbg.h:18
long octalToDecimal(long octalValue)
Convert octal number to decimal number.
Definition: octal_to_hexadecimal.c:20
Here is the call graph for this function:
-
+
- +

◆ test()

@@ -283,17 +282,17 @@ Here is the call graph for this function:

Test function.

Returns
void
-
48  {
-
49  /* test that hexadecimal value of octal number 213 is 8B */
-
50  assert(strcmp(octalToHexadecimal(213), "8B") == 0);
-
51 
-
52  /* test that hexadecimal value of octal number 174 is 7C */
-
53  assert(strcmp(octalToHexadecimal(174), "7C") == 0);
-
54 }
+
48 {
+
49 /* test that hexadecimal value of octal number 213 is 8B */
+
50 assert(strcmp(octalToHexadecimal(213), "8B") == 0);
+
51
+
52 /* test that hexadecimal value of octal number 174 is 7C */
+
53 assert(strcmp(octalToHexadecimal(174), "7C") == 0);
+
54}
Here is the call graph for this function:
-
+
@@ -305,7 +304,7 @@ Here is the call graph for this function:
diff --git a/d0/d8a/octal__to__hexadecimal_8c.js b/d0/d8a/octal__to__hexadecimal_8c.js index b764a232b..a753f8258 100644 --- a/d0/d8a/octal__to__hexadecimal_8c.js +++ b/d0/d8a/octal__to__hexadecimal_8c.js @@ -2,6 +2,6 @@ var octal__to__hexadecimal_8c = [ [ "main", "d0/d8a/octal__to__hexadecimal_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], [ "octalToDecimal", "d0/d8a/octal__to__hexadecimal_8c.html#a86a4edb605c2a03d9175c59de679347d", null ], - [ "octalToHexadecimal", "d0/d8a/octal__to__hexadecimal_8c.html#a042035b4ba7b92974f0edf6eb1b0cbe1", null ], + [ "octalToHexadecimal", "d0/d8a/octal__to__hexadecimal_8c.html#a823ef5170955cfef40e07d9a4d2e87e2", null ], [ "test", "d0/d8a/octal__to__hexadecimal_8c.html#aa8dca7b867074164d5f45b0f3851269d", null ] ]; \ No newline at end of file diff --git a/d0/d8a/octal__to__hexadecimal_8c_a042035b4ba7b92974f0edf6eb1b0cbe1_cgraph.map b/d0/d8a/octal__to__hexadecimal_8c_a823ef5170955cfef40e07d9a4d2e87e2_cgraph.map similarity index 75% rename from d0/d8a/octal__to__hexadecimal_8c_a042035b4ba7b92974f0edf6eb1b0cbe1_cgraph.map rename to d0/d8a/octal__to__hexadecimal_8c_a823ef5170955cfef40e07d9a4d2e87e2_cgraph.map index 6220d7bb5..625f12271 100644 --- a/d0/d8a/octal__to__hexadecimal_8c_a042035b4ba7b92974f0edf6eb1b0cbe1_cgraph.map +++ b/d0/d8a/octal__to__hexadecimal_8c_a823ef5170955cfef40e07d9a4d2e87e2_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/d0/d8a/octal__to__hexadecimal_8c_a042035b4ba7b92974f0edf6eb1b0cbe1_cgraph.md5 b/d0/d8a/octal__to__hexadecimal_8c_a823ef5170955cfef40e07d9a4d2e87e2_cgraph.md5 similarity index 100% rename from d0/d8a/octal__to__hexadecimal_8c_a042035b4ba7b92974f0edf6eb1b0cbe1_cgraph.md5 rename to d0/d8a/octal__to__hexadecimal_8c_a823ef5170955cfef40e07d9a4d2e87e2_cgraph.md5 diff --git a/d0/d8a/octal__to__hexadecimal_8c_a042035b4ba7b92974f0edf6eb1b0cbe1_cgraph.svg b/d0/d8a/octal__to__hexadecimal_8c_a823ef5170955cfef40e07d9a4d2e87e2_cgraph.svg similarity index 62% rename from d0/d8a/octal__to__hexadecimal_8c_a042035b4ba7b92974f0edf6eb1b0cbe1_cgraph.svg rename to d0/d8a/octal__to__hexadecimal_8c_a823ef5170955cfef40e07d9a4d2e87e2_cgraph.svg index 06fa13f4b..61d9b50f6 100644 --- a/d0/d8a/octal__to__hexadecimal_8c_a042035b4ba7b92974f0edf6eb1b0cbe1_cgraph.svg +++ b/d0/d8a/octal__to__hexadecimal_8c_a823ef5170955cfef40e07d9a4d2e87e2_cgraph.svg @@ -1,20 +1,20 @@ - - + octalToHexadecimal - + Node1 - -octalToHexadecimal + +octalToHexadecimal @@ -22,16 +22,16 @@ Node2 - -octalToDecimal + +octalToDecimal Node1->Node2 - - + + diff --git a/d0/d8a/octal__to__hexadecimal_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map b/d0/d8a/octal__to__hexadecimal_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map index c5686c096..f335db60c 100644 --- a/d0/d8a/octal__to__hexadecimal_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map +++ b/d0/d8a/octal__to__hexadecimal_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map @@ -1,5 +1,5 @@ - - + + diff --git a/d0/d8a/octal__to__hexadecimal_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 b/d0/d8a/octal__to__hexadecimal_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 index 41aa2b542..042e83e39 100644 --- a/d0/d8a/octal__to__hexadecimal_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 +++ b/d0/d8a/octal__to__hexadecimal_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 @@ -1 +1 @@ -94ca6007a16192605829c0e9175bd489 \ No newline at end of file +c3cdaefac70dbde53bb5af7d3d73bce0 \ No newline at end of file diff --git a/d0/d8a/octal__to__hexadecimal_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/d0/d8a/octal__to__hexadecimal_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg index f91215cb9..923110881 100644 --- a/d0/d8a/octal__to__hexadecimal_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg +++ b/d0/d8a/octal__to__hexadecimal_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg @@ -1,14 +1,14 @@ - - + test - + Node1 @@ -21,32 +21,32 @@ Node2 - - -octalToHexadecimal + + +octalToHexadecimal Node1->Node2 - - + + Node3 - -octalToDecimal + +octalToDecimal Node2->Node3 - - + + diff --git a/d0/d8a/octal__to__hexadecimal_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d0/d8a/octal__to__hexadecimal_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map index 07438cf0e..8407a9ca6 100644 --- a/d0/d8a/octal__to__hexadecimal_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map +++ b/d0/d8a/octal__to__hexadecimal_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -1,6 +1,6 @@ - + - + diff --git a/d0/d8a/octal__to__hexadecimal_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d0/d8a/octal__to__hexadecimal_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 index d31ce2892..82d8537ed 100644 --- a/d0/d8a/octal__to__hexadecimal_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 +++ b/d0/d8a/octal__to__hexadecimal_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -1 +1 @@ -a9759acd9602b7176b50a7c5c094ac8f \ No newline at end of file +0a029a42587c06dcbfbc71bf33c15e12 \ No newline at end of file diff --git a/d0/d8a/octal__to__hexadecimal_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d0/d8a/octal__to__hexadecimal_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index 5e8da4d12..fa6526e34 100644 --- a/d0/d8a/octal__to__hexadecimal_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/d0/d8a/octal__to__hexadecimal_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,14 +1,14 @@ - - + main - + Node1 @@ -21,17 +21,17 @@ Node2 - - -octalToHexadecimal + + +octalToHexadecimal Node1->Node2 - - + + @@ -52,22 +52,22 @@ Node3 - -octalToDecimal + +octalToDecimal Node2->Node3 - - + + Node4->Node2 - - + + diff --git a/d0/d8a/structmax__heap.html b/d0/d8a/structmax__heap.html index 43b632aea..70611f27c 100644 --- a/d0/d8a/structmax__heap.html +++ b/d0/d8a/structmax__heap.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: max_heap Struct Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@
@@ -42,21 +41,22 @@
char* octalToHexadecimal char * octalToHexadecimal ( long  octalValue)
-
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,24 +92,29 @@ $(document).ready(function(){initNavTree('d0/d8a/structmax__heap.html','../../')
-
-
max_heap Struct Reference
+
max_heap Struct Reference
+ +

for INT_MIN + More...

- - - -

+

Data Fields

+
int * p
 
+
int size
 
+
int count
 
-
The documentation for this struct was generated from the following file:
    +

    Detailed Description

    +

    for INT_MIN

    +

    for IO operations for dynamic memory allocation

    +

    The documentation for this struct was generated from the following file:
    • data_structures/heap/max_heap.c
@@ -118,7 +123,7 @@ int count diff --git a/d0/d8a/structmax__heap.js b/d0/d8a/structmax__heap.js deleted file mode 100644 index 867b7457f..000000000 --- a/d0/d8a/structmax__heap.js +++ /dev/null @@ -1,6 +0,0 @@ -var structmax__heap = -[ - [ "count", "d0/d8a/structmax__heap.html#a917b63797e1857ce994dd5e6cfcebf1e", null ], - [ "p", "d0/d8a/structmax__heap.html#a1b632c34e7304f9e0720834200696340", null ], - [ "size", "d0/d8a/structmax__heap.html#ac4d520821651b109fd2ba2a99c6c6015", null ] -]; \ No newline at end of file diff --git a/d0/d91/binary__search_8c__incl.map b/d0/d91/binary__search_8c__incl.map index 37941bd18..434af6742 100644 --- a/d0/d91/binary__search_8c__incl.map +++ b/d0/d91/binary__search_8c__incl.map @@ -1,5 +1,5 @@ - - - + + + diff --git a/d0/d91/binary__search_8c__incl.svg b/d0/d91/binary__search_8c__incl.svg index 09662dec8..831e0ac96 100644 --- a/d0/d91/binary__search_8c__incl.svg +++ b/d0/d91/binary__search_8c__incl.svg @@ -1,20 +1,20 @@ - - + searching/binary_search.c - + Node1 - -searching/binary_search.c + +searching/binary_search.c @@ -22,31 +22,31 @@ Node2 - -assert.h + +assert.h Node1->Node2 - - + + Node3 - -stdio.h + +stdio.h Node1->Node3 - - + + diff --git a/d0/d99/c__atoi__str__to__integer_8c__incl.map b/d0/d99/c__atoi__str__to__integer_8c__incl.map index a28382ae1..646ac2e67 100644 --- a/d0/d99/c__atoi__str__to__integer_8c__incl.map +++ b/d0/d99/c__atoi__str__to__integer_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/d0/d99/c__atoi__str__to__integer_8c__incl.svg b/d0/d99/c__atoi__str__to__integer_8c__incl.svg index 275bbe6f7..48e1c9ad5 100644 --- a/d0/d99/c__atoi__str__to__integer_8c__incl.svg +++ b/d0/d99/c__atoi__str__to__integer_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - -conversions/c_atoi + +conversions/c_atoi _str_to_integer.c diff --git a/d0/db8/collatz_8c__incl.map b/d0/db8/collatz_8c__incl.map index 5a2d66e10..fefd130b8 100644 --- a/d0/db8/collatz_8c__incl.map +++ b/d0/db8/collatz_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/d0/db8/collatz_8c__incl.svg b/d0/db8/collatz_8c__incl.svg index 74995728f..992e27304 100644 --- a/d0/db8/collatz_8c__incl.svg +++ b/d0/db8/collatz_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - + misc/collatz.c diff --git a/d0/dc7/geometry__datatypes_8h.html b/d0/dc7/geometry__datatypes_8h.html index 03163379a..f22c3aff8 100644 --- a/d0/dc7/geometry__datatypes_8h.html +++ b/d0/dc7/geometry__datatypes_8h.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: geometry/geometry_datatypes.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() {
@@ -94,8 +94,7 @@ $(document).ready(function(){initNavTree('d0/dc7/geometry__datatypes_8h.html','. Data Structures | Macros | Typedefs -
-
geometry_datatypes.h File Reference
+
geometry_datatypes.h File Reference
@@ -104,13 +103,13 @@ $(document).ready(function(){initNavTree('d0/dc7/geometry__datatypes_8h.html','.
This graph shows which files directly or indirectly include this file:
-
+

Go to the source code of this file.

- @@ -128,37 +127,37 @@ Data Structures

+

Data Structures

struct  vec_3d_
 3D vector type More...
 a dual quaternion type More...
 
-

+

Macros

#define EPSILON   1e-9
 Minimum recognizable value. More...
 
- +typedef struct vec_3d_  +typedef struct mat_3x3_  +typedef struct quaternion_  +typedef struct euler_  +typedef struct dual_quat_ 

+

Typedefs

-typedef struct vec_3d_ vec_3d
vec_3d
 3D vector type
 
-typedef struct mat_3x3_ mat_3x3
mat_3x3
 A 3x3 Matrix type definition.
 
-typedef struct quaternion_ quaternion
quaternion
 a Quaternion type represented using a scalar \(w\) or \(q_0\) and a 3D vector \(\left(q_1,q_2,q_3\right)\)
 
-typedef struct euler_ euler
euler
 3D Euler or Tait-Bryan angles (in radian)
 
-typedef struct dual_quat_ dual_quat
dual_quat
 a dual quaternion type
 

Detailed Description

-

Generic header that provides data types for 3D vectors and quaternions.

+

Generic header that provides data types for 3D vectors and quaternions.

Author
Krishna Vedala
@@ -166,7 +165,7 @@ typedef struct dual_qu diff --git a/d0/dc7/geometry__datatypes_8h_source.html b/d0/dc7/geometry__datatypes_8h_source.html index 1191466dd..f698c5e22 100644 --- a/d0/dc7/geometry__datatypes_8h_source.html +++ b/d0/dc7/geometry__datatypes_8h_source.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: geometry/geometry_datatypes.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,125 +90,124 @@ $(document).ready(function(){initNavTree('d0/dc7/geometry__datatypes_8h_source.h
-
-
geometry_datatypes.h
+
geometry_datatypes.h
-Go to the documentation of this file.
1 /**
-
2  * @addtogroup quaternions Library for 3D Vectors & Quaternions
-
3  * @{
-
4  * @file
-
5  * @brief Generic header that provides data types for 3D vectors and quaternions
-
6  * @author Krishna Vedala
-
7  */
-
8 
-
9 #ifndef __LIBQUAT_H_
-
10 #define __LIBQUAT_H_
-
11 
-
12 /** Minimum recognizable value. Any value less than this is considered to be
-
13  * @f$=0@f$ */
-
14 #define EPSILON 1e-9
-
15 
-
16 /**
-
17  * @addtogroup vec_3d 3D Vector operations
-
18  * @{
-
19  */
-
20 /** 3D vector type */
-
21 typedef struct vec_3d_
-
22 {
-
23  float x; /**< X co-ordinate */
-
24  float y; /**< Y co-ordinate */
-
25  float z; /**< Z co-ordinate */
- -
27 /** @} */
-
28 
-
29 /**
-
30  * @addtogroup matrix Matrix operations
-
31  * @{
-
32  */
-
33 /** A 3x3 Matrix type definition */
-
34 typedef struct mat_3x3_
-
35 {
-
36  union
-
37  { /**< 3 element row 1 */
-
38  float row1[3];
-
39  vec_3d vec1;
-
40  };
-
41  union
-
42  { /**< 3 element row 2 */
-
43  float row2[3];
-
44  vec_3d vec2;
-
45  };
-
46  union
-
47  { /**< 3 element row 3 */
-
48  float row3[3];
-
49  vec_3d vec3;
-
50  };
- -
52 /** @} */
-
53 
-
54 /** @addtogroup quats 3D Quaternion operations
-
55  * @{
-
56  */
-
57 /** a Quaternion type represented using a scalar \f$w\f$ or \f$q_0\f$ and a
-
58  * 3D vector \f$\left(q_1,q_2,q_3\right)\f$
-
59  */
-
60 typedef struct quaternion_
-
61 {
-
62  union
-
63  {
-
64  float w; /**< real part of quaternion */
-
65  float q0; /**< real part of quaternion */
-
66  };
-
67  /**< dual part of quaternion */
-
68  union
-
69  {
-
70  vec_3d dual; /**< can be a 3D vector */
-
71  /** or individual values */
-
72  struct
-
73  {
-
74  float q1, q2, q3;
-
75  };
-
76  };
- -
78 
-
79 /** 3D Euler or Tait-Bryan angles (in radian) */
-
80 typedef struct euler_
-
81 {
-
82  union
-
83  {
-
84  float roll; /**< or bank \f$\phi\f$ = rotation about X axis */
-
85  float bank; /**< or roll \f$\phi\f$ = rotation about X axis */
-
86  };
-
87  union
-
88  {
-
89  float pitch; /**< or elevation \f$\theta\f$ = rotation about Y axis */
-
90  float elevation; /**< or pitch \f$\theta\f$ = rotation about Y axis */
-
91  };
-
92  union
-
93  {
-
94  float yaw; /**< or heading \f$\psi\f$ = rotation about Z axis */
-
95  float heading; /**< or yaw \f$\psi\f$ = rotation about Z axis */
-
96  };
- -
98 
-
99 /** @} */
-
100 
-
101 /** @addtogroup dual_quats 3D Dual-Quaternion operations
-
102  * @{
-
103  */
-
104 /** a dual quaternion type */
-
105 typedef struct dual_quat_
-
106 {
-
107  quaternion real; /**< real part of dual quaternion */
-
108  quaternion dual; /**< dual part of dual quaternion */
- -
110 
-
111 /** @} */
-
112 
-
113 #endif // __LIBQUAT_H_
-
114 
-
115 /** @} */
+Go to the documentation of this file.
1/**
+
2 * @addtogroup quaternions Library for 3D Vectors & Quaternions
+
3 * @{
+
4 * @file
+
5 * @brief Generic header that provides data types for 3D vectors and quaternions
+
6 * @author Krishna Vedala
+
7 */
+
8
+
9#ifndef __LIBQUAT_H_
+
10#define __LIBQUAT_H_
+
11
+
12/** Minimum recognizable value. Any value less than this is considered to be
+
13 * @f$=0@f$ */
+
14#define EPSILON 1e-9
+
15
+
16/**
+
17 * @addtogroup vec_3d 3D Vector operations
+
18 * @{
+
19 */
+
20/** 3D vector type */
+
21typedef struct vec_3d_
+
22{
+
23 float x; /**< X co-ordinate */
+
24 float y; /**< Y co-ordinate */
+
25 float z; /**< Z co-ordinate */
+ +
27/** @} */
+
28
+
29/**
+
30 * @addtogroup matrix Matrix operations
+
31 * @{
+
32 */
+
33/** A 3x3 Matrix type definition */
+
34typedef struct mat_3x3_
+
35{
+
36 union
+
37 { /**< 3 element row 1 */
+
38 float row1[3];
+
39 vec_3d vec1;
+
40 };
+
41 union
+
42 { /**< 3 element row 2 */
+
43 float row2[3];
+
44 vec_3d vec2;
+
45 };
+
46 union
+
47 { /**< 3 element row 3 */
+
48 float row3[3];
+
49 vec_3d vec3;
+
50 };
+ +
52/** @} */
+
53
+
54/** @addtogroup quats 3D Quaternion operations
+
55 * @{
+
56 */
+
57/** a Quaternion type represented using a scalar \f$w\f$ or \f$q_0\f$ and a
+
58 * 3D vector \f$\left(q_1,q_2,q_3\right)\f$
+
59 */
+
60typedef struct quaternion_
+
61{
+
62 union
+
63 {
+
64 float w; /**< real part of quaternion */
+
65 float q0; /**< real part of quaternion */
+
66 };
+
67 /**< dual part of quaternion */
+
68 union
+
69 {
+
70 vec_3d dual; /**< can be a 3D vector */
+
71 /** or individual values */
+
72 struct
+
73 {
+
74 float q1, q2, q3;
+
75 };
+
76 };
+ +
78
+
79/** 3D Euler or Tait-Bryan angles (in radian) */
+
80typedef struct euler_
+
81{
+
82 union
+
83 {
+
84 float roll; /**< or bank \f$\phi\f$ = rotation about X axis */
+
85 float bank; /**< or roll \f$\phi\f$ = rotation about X axis */
+
86 };
+
87 union
+
88 {
+
89 float pitch; /**< or elevation \f$\theta\f$ = rotation about Y axis */
+
90 float elevation; /**< or pitch \f$\theta\f$ = rotation about Y axis */
+
91 };
+
92 union
+
93 {
+
94 float yaw; /**< or heading \f$\psi\f$ = rotation about Z axis */
+
95 float heading; /**< or yaw \f$\psi\f$ = rotation about Z axis */
+
96 };
+ +
98
+
99/** @} */
+
100
+
101/** @addtogroup dual_quats 3D Dual-Quaternion operations
+
102 * @{
+
103 */
+
104/** a dual quaternion type */
+
105typedef struct dual_quat_
+
106{
+
107 quaternion real; /**< real part of dual quaternion */
+
108 quaternion dual; /**< dual part of dual quaternion */
+ +
110
+
111/** @} */
+
112
+
113#endif // __LIBQUAT_H_
+
114
+
115/** @} */
struct dual_quat_ dual_quat
a dual quaternion type
struct mat_3x3_ mat_3x3
A 3x3 Matrix type definition.
struct euler_ euler
3D Euler or Tait-Bryan angles (in radian)
@@ -242,7 +241,7 @@ $(document).ready(function(){initNavTree('d0/dc7/geometry__datatypes_8h_source.h diff --git a/d0/dcb/group__kohonen__1d.html b/d0/dcb/group__kohonen__1d.html index 2827eccb2..6aa28d752 100644 --- a/d0/dcb/group__kohonen__1d.html +++ b/d0/dcb/group__kohonen__1d.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Kohonen SOM trace/chain 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() {
@@ -93,29 +93,28 @@ $(document).ready(function(){initNavTree('d0/dcb/group__kohonen__1d.html','../.. -
-
Kohonen SOM trace/chain algorithm
+
Kohonen SOM trace/chain algorithm
Collaboration diagram for Kohonen SOM trace/chain algorithm:
-
+
- - + - +

+

Macros

-#define max(a, b)   (((a) > (b)) ? (a) : (b))
+#define max(a, b)   (((a) > (b)) ? (a) : (b))
 shorthand for maximum value
 
-#define min(a, b)   (((a) < (b)) ? (a) : (b))
+#define min(a, b)   (((a) < (b)) ? (a) : (b))
 shorthand for minimum value
 
- @@ -135,7 +134,7 @@ Functions

+

Functions

double _random (double a, double b)
 Helper function to generate a random number in a given interval. More...

Detailed Description

Function Documentation

- +

◆ _random()

@@ -162,7 +161,7 @@ Functions

Helper function to generate a random number in a given interval.

-


+


Steps:

  1. r1 = rand() % 100 gets a random number between 0 and 99
  2. r2 = r1 / 100 converts random number to be between 0 and 0.99
  3. @@ -179,14 +178,14 @@ Functions
    Returns
    random number in the range \([a,b)\)
    -
    55 {
    -
    56  int r = rand() % 100;
    -
    57  return ((b - a) * r / 100.f) + a;
    -
    58 }
    +
    55{
    +
    56 int r = rand() % 100;
    +
    57 return ((b - a) * r / 100.f) + a;
    +
    58}
- +

◆ kohonen_get_min_1d()

@@ -234,22 +233,22 @@ Functions -
105 {
-
106  val[0] = INFINITY; // initial min value
-
107 
-
108  for (int i = 0; i < N; i++) // check each value
-
109  {
-
110  if (X[i] < val[0]) // if a lower value is found
-
111  { // save the value and its index
-
112  idx[0] = i;
-
113  val[0] = X[i];
-
114  }
-
115  }
-
116 }
+
105{
+
106 val[0] = INFINITY; // initial min value
+
107
+
108 for (int i = 0; i < N; i++) // check each value
+
109 {
+
110 if (X[i] < val[0]) // if a lower value is found
+
111 { // save the value and its index
+
112 idx[0] = i;
+
113 val[0] = X[i];
+
114 }
+
115 }
+
116}
- +

◆ kohonen_som_tracer()

@@ -311,42 +310,42 @@ Functions -
181 {
-
182  int R = num_out >> 2, iter = 0;
-
183  double alpha = 1.f;
-
184  double *D = (double *)malloc(num_out * sizeof(double));
-
185 
-
186  // Loop alpha from 1 to alpha_min
-
187  for (; alpha > alpha_min; alpha -= 0.01, iter++)
-
188  {
-
189  // Loop for each sample pattern in the data set
-
190  for (int sample = 0; sample < num_samples; sample++)
-
191  {
-
192  const double *x = X[sample];
-
193  // update weights for the current input pattern sample
-
194  kohonen_update_weights(x, W, D, num_out, num_features, alpha, R);
-
195  }
-
196 
-
197  // every 10th iteration, reduce the neighborhood range
-
198  if (iter % 10 == 0 && R > 1)
-
199  R--;
-
200  }
-
201 
-
202  free(D);
-
203 }
+
181{
+
182 int R = num_out >> 2, iter = 0;
+
183 double alpha = 1.f;
+
184 double *D = (double *)malloc(num_out * sizeof(double));
+
185
+
186 // Loop alpha from 1 to alpha_min
+
187 for (; alpha > alpha_min; alpha -= 0.01, iter++)
+
188 {
+
189 // Loop for each sample pattern in the data set
+
190 for (int sample = 0; sample < num_samples; sample++)
+
191 {
+
192 const double *x = X[sample];
+
193 // update weights for the current input pattern sample
+
194 kohonen_update_weights(x, W, D, num_out, num_features, alpha, R);
+
195 }
+
196
+
197 // every 10th iteration, reduce the neighborhood range
+
198 if (iter % 10 == 0 && R > 1)
+
199 R--;
+
200 }
+
201
+
202 free(D);
+
203}
void kohonen_update_weights(double const *x, double *const *W, double *D, int num_out, int num_features, double alpha, int R)
Update weights of the SOM using Kohonen algorithm.
Definition: kohonen_som_trace.c:129
#define malloc(bytes)
This macro replace the standard malloc function with malloc_dbg.
Definition: malloc_dbg.h:18
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
Here is the call graph for this function:
-
+
- +

◆ kohonen_update_weights()

@@ -415,55 +414,55 @@ Here is the call graph for this function:
-
131 {
-
132  int j, k;
-
133 
-
134 #ifdef _OPENMP
-
135 #pragma omp for
-
136 #endif
-
137  // step 1: for each output point
-
138  for (j = 0; j < num_out; j++)
-
139  {
-
140  D[j] = 0.f;
-
141  // compute Euclidian distance of each output
-
142  // point from the current sample
-
143  for (k = 0; k < num_features; k++)
-
144  D[j] += (W[j][k] - x[k]) * (W[j][k] - x[k]);
-
145  }
-
146 
-
147  // step 2: get closest node i.e., node with smallest Euclidian distance to
-
148  // the current pattern
-
149  int d_min_idx;
-
150  double d_min;
-
151  kohonen_get_min_1d(D, num_out, &d_min, &d_min_idx);
-
152 
-
153  // step 3a: get the neighborhood range
-
154  int from_node = max(0, d_min_idx - R);
-
155  int to_node = min(num_out, d_min_idx + R + 1);
-
156 
-
157  // step 3b: update the weights of nodes in the
-
158  // neighborhood
-
159 #ifdef _OPENMP
-
160 #pragma omp for
-
161 #endif
-
162  for (j = from_node; j < to_node; j++)
-
163  for (k = 0; k < num_features; k++)
-
164  // update weights of nodes in the neighborhood
-
165  W[j][k] += alpha * (x[k] - W[j][k]);
-
166 }
+
131{
+
132 int j, k;
+
133
+
134#ifdef _OPENMP
+
135#pragma omp for
+
136#endif
+
137 // step 1: for each output point
+
138 for (j = 0; j < num_out; j++)
+
139 {
+
140 D[j] = 0.f;
+
141 // compute Euclidian distance of each output
+
142 // point from the current sample
+
143 for (k = 0; k < num_features; k++)
+
144 D[j] += (W[j][k] - x[k]) * (W[j][k] - x[k]);
+
145 }
+
146
+
147 // step 2: get closest node i.e., node with smallest Euclidian distance to
+
148 // the current pattern
+
149 int d_min_idx;
+
150 double d_min;
+
151 kohonen_get_min_1d(D, num_out, &d_min, &d_min_idx);
+
152
+
153 // step 3a: get the neighborhood range
+
154 int from_node = max(0, d_min_idx - R);
+
155 int to_node = min(num_out, d_min_idx + R + 1);
+
156
+
157 // step 3b: update the weights of nodes in the
+
158 // neighborhood
+
159#ifdef _OPENMP
+
160#pragma omp for
+
161#endif
+
162 for (j = from_node; j < to_node; j++)
+
163 for (k = 0; k < num_features; k++)
+
164 // update weights of nodes in the neighborhood
+
165 W[j][k] += alpha * (x[k] - W[j][k]);
+
166}
void kohonen_get_min_1d(double const *X, int N, double *val, int *idx)
Get minimum value and index of the value in a vector.
Definition: kohonen_som_trace.c:104
#define min(a, b)
shorthand for minimum value
Definition: kohonen_som_trace.c:36
#define max(a, b)
shorthand for maximum value
Definition: kohonen_som_trace.c:32
Here is the call graph for this function:
-
+
- +

◆ save_nd_data()

@@ -514,30 +513,30 @@ Here is the call graph for this function:
Returns
0 if all ok
-1 if file creation failed
-
72 {
-
73  FILE *fp = fopen(fname, "wt");
-
74  if (!fp) // error with fopen
-
75  {
-
76  char msg[120];
-
77  sprintf(msg, "File error (%s): ", fname);
-
78  perror(msg);
-
79  return -1;
-
80  }
-
81 
-
82  for (int i = 0; i < num_points; i++) // for each point in the array
-
83  {
-
84  for (int j = 0; j < num_features; j++) // for each feature in the array
-
85  {
-
86  fprintf(fp, "%.4g", X[i][j]); // print the feature value
-
87  if (j < num_features - 1) // if not the last feature
-
88  fprintf(fp, ","); // suffix comma
-
89  }
-
90  if (i < num_points - 1) // if not the last row
-
91  fprintf(fp, "\n"); // start a new line
-
92  }
-
93  fclose(fp);
-
94  return 0;
-
95 }
+
72{
+
73 FILE *fp = fopen(fname, "wt");
+
74 if (!fp) // error with fopen
+
75 {
+
76 char msg[120];
+
77 sprintf(msg, "File error (%s): ", fname);
+
78 perror(msg);
+
79 return -1;
+
80 }
+
81
+
82 for (int i = 0; i < num_points; i++) // for each point in the array
+
83 {
+
84 for (int j = 0; j < num_features; j++) // for each feature in the array
+
85 {
+
86 fprintf(fp, "%.4g", X[i][j]); // print the feature value
+
87 if (j < num_features - 1) // if not the last feature
+
88 fprintf(fp, ","); // suffix comma
+
89 }
+
90 if (i < num_points - 1) // if not the last row
+
91 fprintf(fp, "\n"); // start a new line
+
92 }
+
93 fclose(fp);
+
94 return 0;
+
95}
@@ -546,7 +545,7 @@ Here is the call graph for this function:
diff --git a/d0/dcb/group__kohonen__1d.map b/d0/dcb/group__kohonen__1d.map index 9c2eaa14c..f1db75cfa 100644 --- a/d0/dcb/group__kohonen__1d.map +++ b/d0/dcb/group__kohonen__1d.map @@ -1,4 +1,4 @@ - - + + diff --git a/d0/dcb/group__kohonen__1d.svg b/d0/dcb/group__kohonen__1d.svg index f84af7dc8..ee7a8218f 100644 --- a/d0/dcb/group__kohonen__1d.svg +++ b/d0/dcb/group__kohonen__1d.svg @@ -1,21 +1,21 @@ - - + Kohonen SOM trace/chain algorithm - + Node1 - -Kohonen SOM trace/chain - algorithm + +Kohonen SOM trace/chain + algorithm @@ -23,16 +23,16 @@ Node2 - -Machine learning algorithms + +Machine learning algorithms Node2->Node1 - - + + diff --git a/d0/dcb/group__kohonen__1d_gae334493a0917a24736fe5ba82aa6f81f_cgraph.map b/d0/dcb/group__kohonen__1d_gae334493a0917a24736fe5ba82aa6f81f_cgraph.map index bbeae6213..053f6a9cd 100644 --- a/d0/dcb/group__kohonen__1d_gae334493a0917a24736fe5ba82aa6f81f_cgraph.map +++ b/d0/dcb/group__kohonen__1d_gae334493a0917a24736fe5ba82aa6f81f_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/d0/dcb/group__kohonen__1d_gae334493a0917a24736fe5ba82aa6f81f_cgraph.svg b/d0/dcb/group__kohonen__1d_gae334493a0917a24736fe5ba82aa6f81f_cgraph.svg index 83f98c9e1..a22b2ffbb 100644 --- a/d0/dcb/group__kohonen__1d_gae334493a0917a24736fe5ba82aa6f81f_cgraph.svg +++ b/d0/dcb/group__kohonen__1d_gae334493a0917a24736fe5ba82aa6f81f_cgraph.svg @@ -1,20 +1,20 @@ - - + kohonen_update_weights - + Node1 - -kohonen_update_weights + +kohonen_update_weights @@ -22,16 +22,16 @@ Node2 - -kohonen_get_min_1d + +kohonen_get_min_1d Node1->Node2 - - + + diff --git a/d0/dcb/group__kohonen__1d_gaeaeffbff2be4d5d15b0d4f10f846abde_cgraph.map b/d0/dcb/group__kohonen__1d_gaeaeffbff2be4d5d15b0d4f10f846abde_cgraph.map index 58c943ec6..4960d1a52 100644 --- a/d0/dcb/group__kohonen__1d_gaeaeffbff2be4d5d15b0d4f10f846abde_cgraph.map +++ b/d0/dcb/group__kohonen__1d_gaeaeffbff2be4d5d15b0d4f10f846abde_cgraph.map @@ -1,5 +1,5 @@ - - - + + + diff --git a/d0/dcb/group__kohonen__1d_gaeaeffbff2be4d5d15b0d4f10f846abde_cgraph.svg b/d0/dcb/group__kohonen__1d_gaeaeffbff2be4d5d15b0d4f10f846abde_cgraph.svg index a65e5a3ef..43bec155a 100644 --- a/d0/dcb/group__kohonen__1d_gaeaeffbff2be4d5d15b0d4f10f846abde_cgraph.svg +++ b/d0/dcb/group__kohonen__1d_gaeaeffbff2be4d5d15b0d4f10f846abde_cgraph.svg @@ -1,20 +1,20 @@ - - + kohonen_som_tracer - + Node1 - -kohonen_som_tracer + +kohonen_som_tracer @@ -22,31 +22,31 @@ Node2 - -kohonen_update_weights + +kohonen_update_weights Node1->Node2 - - + + Node3 - -kohonen_get_min_1d + +kohonen_get_min_1d Node2->Node3 - - + + diff --git a/d0/dcb/poly__add_8c.html b/d0/dcb/poly__add_8c.html index 27b42c871..28ea0b737 100644 --- a/d0/dcb/poly__add_8c.html +++ b/d0/dcb/poly__add_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: misc/poly_add.c 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/dcb/poly__add_8c.html','../../'); i -
-
poly_add.c File Reference
+
poly_add.c File Reference
-

Implementation of Addition of two polynomials +

Implementation of Addition of two polynomials More...

#include <stdio.h>
#include <stdlib.h>
@@ -109,13 +108,13 @@ Include dependency graph for poly_add.c:
-

+

Data Structures

struct  term
 identifier for single-variable polynomial coefficients as a linked list More...
 
- @@ -143,11 +142,11 @@ Functions

+

Functions

void free_poly (struct term *poly)
 Frees memory space. More...
 

Detailed Description

-

Implementation of Addition of two polynomials

-
Author
Ankita Roy Chowdhury
+

Implementation of Addition of two polynomials

+
Author
Ankita Roy Chowdhury

This code takes two polynomials as input and prints their sum using linked list. The polynomials must be in increasing or decreasing order of degree. Degree must be positive.

Function Documentation

- +

◆ create_polynomial()

@@ -189,34 +188,34 @@ Functions
Returns
none
-
55 {
-
56  // Creating the polynomial using temporary linked lists
-
57  struct term *temp1, *temp2;
-
58  temp1 = *poly; // Contains the null pointer
-
59 
-
60  // Initiating first term
-
61  if (temp1 == NULL)
-
62  {
-
63  temp2 = (struct term *)malloc(
-
64  sizeof(struct term)); // Dynamic node creation
-
65  temp2->coef = coef;
-
66  temp2->pow = pow;
-
67  // Updating the null pointer with the address of the first node of the
-
68  // polynomial just created
-
69  *poly = temp2;
-
70  temp2->next = NULL; // Increasing the pointer temp2
-
71  }
-
72  // Creating the rest of the nodes
-
73  else
-
74  {
-
75  temp2->next = (struct term *)malloc(
-
76  sizeof(struct term)); // Dynamic node creation
-
77  temp2 = temp2->next; // Increasing the pointer temp2
-
78  temp2->coef = coef;
-
79  temp2->pow = pow;
-
80  temp2->next = NULL;
-
81  }
-
82 }
+
55{
+
56 // Creating the polynomial using temporary linked lists
+
57 struct term *temp1, *temp2;
+
58 temp1 = *poly; // Contains the null pointer
+
59
+
60 // Initiating first term
+
61 if (temp1 == NULL)
+
62 {
+
63 temp2 = (struct term *)malloc(
+
64 sizeof(struct term)); // Dynamic node creation
+
65 temp2->coef = coef;
+
66 temp2->pow = pow;
+
67 // Updating the null pointer with the address of the first node of the
+
68 // polynomial just created
+
69 *poly = temp2;
+
70 temp2->next = NULL; // Increasing the pointer temp2
+
71 }
+
72 // Creating the rest of the nodes
+
73 else
+
74 {
+
75 temp2->next = (struct term *)malloc(
+
76 sizeof(struct term)); // Dynamic node creation
+
77 temp2 = temp2->next; // Increasing the pointer temp2
+
78 temp2->coef = coef;
+
79 temp2->pow = pow;
+
80 temp2->next = NULL;
+
81 }
+
82}
#define malloc(bytes)
This macro replace the standard malloc function with malloc_dbg.
Definition: malloc_dbg.h:18
identifier for single-variable polynomial coefficients as a linked list
Definition: poly_add.c:20
int pow
power of the polynomial term
Definition: poly_add.c:22
@@ -225,7 +224,7 @@ Functions
- +

◆ display_polynomial()

@@ -249,21 +248,21 @@ Functions
Returns
none
-
183 {
-
184  while (poly != NULL)
-
185  {
-
186  printf("%d x^%d", poly->coef, poly->pow);
-
187  poly = poly->next;
-
188  if (poly != NULL)
-
189  {
-
190  printf(" + ");
-
191  }
-
192  }
-
193 }
+
183{
+
184 while (poly != NULL)
+
185 {
+
186 printf("%d x^%d", poly->coef, poly->pow);
+
187 poly = poly->next;
+
188 if (poly != NULL)
+
189 {
+
190 printf(" + ");
+
191 }
+
192 }
+
193}
- +

◆ free_poly()

@@ -287,25 +286,25 @@ Functions
Returns
void
-
32 {
-
33  if (!poly)
-
34  {
-
35  return; // NULL pointer does not need delete
-
36  }
-
37  else
-
38  {
-
39  while (!poly->next)
-
40  {
-
41  free(poly->next); // Deletes next term
-
42  }
-
43  free(poly); // delete the current term
-
44  }
-
45 }
+
32{
+
33 if (!poly)
+
34 {
+
35 return; // NULL pointer does not need delete
+
36 }
+
37 else
+
38 {
+
39 while (!poly->next)
+
40 {
+
41 free(poly->next); // Deletes next term
+
42 }
+
43 free(poly); // delete the current term
+
44 }
+
45}
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
- +

◆ main()

@@ -323,27 +322,27 @@ Functions

Main function.

Returns
0 on exit
-
312 {
-
313  struct term *poly1 = NULL, *poly2 = NULL, *poly3 = NULL;
-
314  test1(poly1, poly2, poly3);
-
315  test2(poly1, poly2, poly3);
-
316  test3(poly1, poly2, poly3);
-
317 
-
318  return 0;
-
319 }
+
312{
+
313 struct term *poly1 = NULL, *poly2 = NULL, *poly3 = NULL;
+
314 test1(poly1, poly2, poly3);
+
315 test2(poly1, poly2, poly3);
+
316 test3(poly1, poly2, poly3);
+
317
+
318 return 0;
+
319}
static void test2(struct term *poly1, struct term *poly2, struct term *poly3)
Test function 2.
Definition: poly_add.c:239
static void test3(struct term *poly1, struct term *poly2, struct term *poly3)
Test function 3.
Definition: poly_add.c:279
static void test1(struct term *poly1, struct term *poly2, struct term *poly3)
Test function 1.
Definition: poly_add.c:204
Here is the call graph for this function:
-
+
- +

◆ poly_add()

@@ -384,94 +383,94 @@ Here is the call graph for this function:
-
92 {
-
93  // Creating a temporary linked list to store the resultant polynomial
-
94  struct term *temp = (struct term *)malloc(sizeof(struct term));
-
95  temp->next = NULL;
-
96  *pol =
-
97  temp; //*pol always points to the 1st node of the resultant polynomial
-
98 
-
99  // Comparing the powers of the nodes of both the polynomials
-
100  // until one gets exhausted
-
101  while (poly1 && poly2)
-
102  {
-
103  /* If the power of the first polynomial is greater than the power of the
-
104  second one place the power and coefficient of that node of the first
-
105  polynomial in temp and increase the pointer poly1
-
106  */
-
107  if (poly1->pow > poly2->pow)
-
108  {
-
109  temp->coef = poly1->coef;
-
110  temp->pow = poly1->pow;
-
111  poly1 = poly1->next;
-
112  }
-
113  /* If the power of the second polynomial is greater than the power of
-
114  the first one place the power and coefficient of that node of the
-
115  second polynomial in temp and increase the pointer poly2
-
116  */
-
117  else if (poly1->pow < poly2->pow)
-
118  {
-
119  temp->coef = poly2->coef;
-
120  temp->pow = poly2->pow;
-
121  poly2 = poly2->next;
-
122  }
-
123  /* If both of them have same power then sum the coefficients
-
124  place both the summed coefficient and the power in temp
-
125  increase both the pointers poly1 and poly2
-
126  */
-
127  else
-
128  {
-
129  temp->coef = poly1->coef + poly2->coef;
-
130  temp->pow = poly1->pow;
-
131  poly1 = poly1->next;
-
132  poly2 = poly2->next;
-
133  }
-
134  /* If none of the polynomials are exhausted
-
135  dynamically create a node in temp
-
136  */
-
137  if (poly1 && poly2)
-
138  {
-
139  temp->next = (struct term *)malloc(
-
140  sizeof(struct term)); // Dynamic node creation
-
141  temp = temp->next; // Increase the pointer temp
-
142  temp->next = NULL;
-
143  }
-
144  }
-
145  /* If one of the polynomials is exhausted
-
146  place the rest of the other polynomial as it is in temp
-
147  by creating nodes dynamically
-
148  */
-
149  while (poly1 || poly2)
-
150  {
-
151  temp->next = (struct term *)malloc(
-
152  sizeof(struct term)); // Dynamic node creation
-
153  temp = temp->next; // Increasing the pointer
-
154  temp->next = NULL;
-
155 
-
156  /* If poly1 is not exhausted
-
157  place rest of that polynomial in temp
-
158  */
-
159  if (poly1)
-
160  {
-
161  temp->coef = poly1->coef;
-
162  temp->pow = poly1->pow;
-
163  poly1 = poly1->next;
-
164  }
-
165  /* If poly2 is not exhausted
-
166  place rest of that polynomial in temp
-
167  */
-
168  else if (poly2)
-
169  {
-
170  temp->coef = poly2->coef;
-
171  temp->pow = poly2->pow;
-
172  poly2 = poly2->next;
-
173  }
-
174  }
-
175 }
+
92{
+
93 // Creating a temporary linked list to store the resultant polynomial
+
94 struct term *temp = (struct term *)malloc(sizeof(struct term));
+
95 temp->next = NULL;
+
96 *pol =
+
97 temp; //*pol always points to the 1st node of the resultant polynomial
+
98
+
99 // Comparing the powers of the nodes of both the polynomials
+
100 // until one gets exhausted
+
101 while (poly1 && poly2)
+
102 {
+
103 /* If the power of the first polynomial is greater than the power of the
+
104 second one place the power and coefficient of that node of the first
+
105 polynomial in temp and increase the pointer poly1
+
106 */
+
107 if (poly1->pow > poly2->pow)
+
108 {
+
109 temp->coef = poly1->coef;
+
110 temp->pow = poly1->pow;
+
111 poly1 = poly1->next;
+
112 }
+
113 /* If the power of the second polynomial is greater than the power of
+
114 the first one place the power and coefficient of that node of the
+
115 second polynomial in temp and increase the pointer poly2
+
116 */
+
117 else if (poly1->pow < poly2->pow)
+
118 {
+
119 temp->coef = poly2->coef;
+
120 temp->pow = poly2->pow;
+
121 poly2 = poly2->next;
+
122 }
+
123 /* If both of them have same power then sum the coefficients
+
124 place both the summed coefficient and the power in temp
+
125 increase both the pointers poly1 and poly2
+
126 */
+
127 else
+
128 {
+
129 temp->coef = poly1->coef + poly2->coef;
+
130 temp->pow = poly1->pow;
+
131 poly1 = poly1->next;
+
132 poly2 = poly2->next;
+
133 }
+
134 /* If none of the polynomials are exhausted
+
135 dynamically create a node in temp
+
136 */
+
137 if (poly1 && poly2)
+
138 {
+
139 temp->next = (struct term *)malloc(
+
140 sizeof(struct term)); // Dynamic node creation
+
141 temp = temp->next; // Increase the pointer temp
+
142 temp->next = NULL;
+
143 }
+
144 }
+
145 /* If one of the polynomials is exhausted
+
146 place the rest of the other polynomial as it is in temp
+
147 by creating nodes dynamically
+
148 */
+
149 while (poly1 || poly2)
+
150 {
+
151 temp->next = (struct term *)malloc(
+
152 sizeof(struct term)); // Dynamic node creation
+
153 temp = temp->next; // Increasing the pointer
+
154 temp->next = NULL;
+
155
+
156 /* If poly1 is not exhausted
+
157 place rest of that polynomial in temp
+
158 */
+
159 if (poly1)
+
160 {
+
161 temp->coef = poly1->coef;
+
162 temp->pow = poly1->pow;
+
163 poly1 = poly1->next;
+
164 }
+
165 /* If poly2 is not exhausted
+
166 place rest of that polynomial in temp
+
167 */
+
168 else if (poly2)
+
169 {
+
170 temp->coef = poly2->coef;
+
171 temp->pow = poly2->pow;
+
172 poly2 = poly2->next;
+
173 }
+
174 }
+
175}
- +

◆ test1()

@@ -512,31 +511,31 @@ Here is the call graph for this function:

Test function 1.

-

Polynomial 1 is 5 x^2 + 3 x^1 + 2 x^0 Polynomial 2 is 7 x^3 + 9 x^1 + 10 x^0 Resultant polynomial is 7 x^3 + 5 x^2 + 12 x^1 + 12 x^0

Returns
void
-
205 {
-
206  printf("\n----Test 1----\n");
-
207  printf("\nFirst Polynomial:\n"); // Defining the 1st polynomial
-
208  create_polynomial(&poly1, 5, 2);
-
209  create_polynomial(&poly1, 3, 1);
-
210  create_polynomial(&poly1, 2, 0);
-
211  display_polynomial(poly1);
-
212 
-
213  printf("\nSecond Polynomial:\n"); // Defining the 2nd polynomial
-
214  create_polynomial(&poly2, 7, 3);
-
215  create_polynomial(&poly2, 9, 1);
-
216  create_polynomial(&poly2, 10, 0);
-
217  display_polynomial(poly2);
-
218 
-
219  poly_add(&poly3, poly1, poly2); // Adding the two polynomials
-
220  printf("\nResultant polynomial:\n");
-
221  display_polynomial(poly3);
-
222  printf("\n");
-
223 
-
224  // Frees memory space
-
225  free_poly(poly1);
-
226  free_poly(poly2);
-
227  free_poly(poly3);
-
228 }
+

Polynomial 1 is 5 x^2 + 3 x^1 + 2 x^0 Polynomial 2 is 7 x^3 + 9 x^1 + 10 x^0 Resultant polynomial is 7 x^3 + 5 x^2 + 12 x^1 + 12 x^0

Returns
void
+
205{
+
206 printf("\n----Test 1----\n");
+
207 printf("\nFirst Polynomial:\n"); // Defining the 1st polynomial
+
208 create_polynomial(&poly1, 5, 2);
+
209 create_polynomial(&poly1, 3, 1);
+
210 create_polynomial(&poly1, 2, 0);
+
211 display_polynomial(poly1);
+
212
+
213 printf("\nSecond Polynomial:\n"); // Defining the 2nd polynomial
+
214 create_polynomial(&poly2, 7, 3);
+
215 create_polynomial(&poly2, 9, 1);
+
216 create_polynomial(&poly2, 10, 0);
+
217 display_polynomial(poly2);
+
218
+
219 poly_add(&poly3, poly1, poly2); // Adding the two polynomials
+
220 printf("\nResultant polynomial:\n");
+
221 display_polynomial(poly3);
+
222 printf("\n");
+
223
+
224 // Frees memory space
+
225 free_poly(poly1);
+
226 free_poly(poly2);
+
227 free_poly(poly3);
+
228}
void create_polynomial(struct term **poly, int coef, int pow)
The function will create a polynomial.
Definition: poly_add.c:54
void free_poly(struct term *poly)
Frees memory space.
Definition: poly_add.c:31
void poly_add(struct term **pol, struct term *poly1, struct term *poly2)
The function will add 2 polynomials.
Definition: poly_add.c:91
@@ -544,13 +543,13 @@ Here is the call graph for this function:
Here is the call graph for this function:
-
+
- +

◆ test2()

@@ -591,46 +590,46 @@ Here is the call graph for this function:

Test function 2.

-

Polynomial 1 is 3 x^5 + 1 x^4 + 2 x^3 + -2 x^1 + 5 x^0 Polynomial 2 is 2 x^5 + 3 x^3 + 7 x^1 + 2 x^0 Resultant polynomial is 5 x^5 + 1 x^4 + 5 x^3 + 5 x^1 + 7 x^0

Returns
void
-
240 {
-
241  printf("\n----Test 2----\n");
-
242  printf("\nFirst Polynomial:\n"); // Defining the 1st polynomial
-
243  create_polynomial(&poly1, 3, 5);
-
244  create_polynomial(&poly1, 1, 4);
-
245  create_polynomial(&poly1, 2, 3);
-
246  create_polynomial(&poly1, -2, 1);
-
247  create_polynomial(&poly1, 5, 0);
-
248 
-
249  display_polynomial(poly1);
-
250 
-
251  printf("\nSecond Polynomial:\n"); // Defining the 2nd polynomial
-
252  create_polynomial(&poly2, 2, 5);
-
253  create_polynomial(&poly2, 3, 3);
-
254  create_polynomial(&poly2, 7, 1);
-
255  create_polynomial(&poly2, 2, 0);
-
256 
-
257  display_polynomial(poly2);
-
258 
-
259  poly_add(&poly3, poly1, poly2); // Adding the two polynomials
-
260  printf("\nResultant polynomial:\n");
-
261  display_polynomial(poly3);
-
262  printf("\n");
-
263 
-
264  // Frees memory space
-
265  free_poly(poly1);
-
266  free_poly(poly2);
-
267  free_poly(poly3);
-
268 }
+

Polynomial 1 is 3 x^5 + 1 x^4 + 2 x^3 + -2 x^1 + 5 x^0 Polynomial 2 is 2 x^5 + 3 x^3 + 7 x^1 + 2 x^0 Resultant polynomial is 5 x^5 + 1 x^4 + 5 x^3 + 5 x^1 + 7 x^0

Returns
void
+
240{
+
241 printf("\n----Test 2----\n");
+
242 printf("\nFirst Polynomial:\n"); // Defining the 1st polynomial
+
243 create_polynomial(&poly1, 3, 5);
+
244 create_polynomial(&poly1, 1, 4);
+
245 create_polynomial(&poly1, 2, 3);
+
246 create_polynomial(&poly1, -2, 1);
+
247 create_polynomial(&poly1, 5, 0);
+
248
+
249 display_polynomial(poly1);
+
250
+
251 printf("\nSecond Polynomial:\n"); // Defining the 2nd polynomial
+
252 create_polynomial(&poly2, 2, 5);
+
253 create_polynomial(&poly2, 3, 3);
+
254 create_polynomial(&poly2, 7, 1);
+
255 create_polynomial(&poly2, 2, 0);
+
256
+
257 display_polynomial(poly2);
+
258
+
259 poly_add(&poly3, poly1, poly2); // Adding the two polynomials
+
260 printf("\nResultant polynomial:\n");
+
261 display_polynomial(poly3);
+
262 printf("\n");
+
263
+
264 // Frees memory space
+
265 free_poly(poly1);
+
266 free_poly(poly2);
+
267 free_poly(poly3);
+
268}
Here is the call graph for this function:
-
+
- +

◆ test3()

@@ -671,37 +670,37 @@ Here is the call graph for this function:

Test function 3.

-

Polynomial 1 is -12 x^0 + 8 x^1 + 4 x^3 Polynomial 2 is 5 x^0 + -13 x^1 + 3 x^3 Resultant polynomial is -7 x^0 + -5 x^1 + 7 x^3

Returns
void
-
280 {
-
281  printf("\n----Test 3----\n");
-
282  printf("\nFirst Polynomial:\n"); // Defining the 1st polynomial
-
283  create_polynomial(&poly1, -12, 0);
-
284  create_polynomial(&poly1, 8, 1);
-
285  create_polynomial(&poly1, 4, 3);
-
286 
-
287  display_polynomial(poly1);
-
288 
-
289  printf("\nSecond Polynomial:\n"); // Defining the 2nd polynomial
-
290  create_polynomial(&poly2, 5, 0);
-
291  create_polynomial(&poly2, -13, 1);
-
292  create_polynomial(&poly2, 3, 3);
-
293 
-
294  display_polynomial(poly2);
-
295 
-
296  poly_add(&poly3, poly1, poly2); // Adding the two polynomials
-
297  printf("\nResultant polynomial:\n");
-
298  display_polynomial(poly3);
-
299  printf("\n");
-
300 
-
301  // Frees memory space
-
302  free_poly(poly1);
-
303  free_poly(poly2);
-
304  free_poly(poly3);
-
305 }
+

Polynomial 1 is -12 x^0 + 8 x^1 + 4 x^3 Polynomial 2 is 5 x^0 + -13 x^1 + 3 x^3 Resultant polynomial is -7 x^0 + -5 x^1 + 7 x^3

Returns
void
+
280{
+
281 printf("\n----Test 3----\n");
+
282 printf("\nFirst Polynomial:\n"); // Defining the 1st polynomial
+
283 create_polynomial(&poly1, -12, 0);
+
284 create_polynomial(&poly1, 8, 1);
+
285 create_polynomial(&poly1, 4, 3);
+
286
+
287 display_polynomial(poly1);
+
288
+
289 printf("\nSecond Polynomial:\n"); // Defining the 2nd polynomial
+
290 create_polynomial(&poly2, 5, 0);
+
291 create_polynomial(&poly2, -13, 1);
+
292 create_polynomial(&poly2, 3, 3);
+
293
+
294 display_polynomial(poly2);
+
295
+
296 poly_add(&poly3, poly1, poly2); // Adding the two polynomials
+
297 printf("\nResultant polynomial:\n");
+
298 display_polynomial(poly3);
+
299 printf("\n");
+
300
+
301 // Frees memory space
+
302 free_poly(poly1);
+
303 free_poly(poly2);
+
304 free_poly(poly3);
+
305}
Here is the call graph for this function:
-
+
@@ -713,7 +712,7 @@ Here is the call graph for this function:
diff --git a/d0/dcb/poly__add_8c_a0c5173884bd798a6ca6f437b9b932409_cgraph.map b/d0/dcb/poly__add_8c_a0c5173884bd798a6ca6f437b9b932409_cgraph.map index 481a341e0..b67f060b3 100644 --- a/d0/dcb/poly__add_8c_a0c5173884bd798a6ca6f437b9b932409_cgraph.map +++ b/d0/dcb/poly__add_8c_a0c5173884bd798a6ca6f437b9b932409_cgraph.map @@ -1,7 +1,7 @@ - - - - + + + + diff --git a/d0/dcb/poly__add_8c_a0c5173884bd798a6ca6f437b9b932409_cgraph.svg b/d0/dcb/poly__add_8c_a0c5173884bd798a6ca6f437b9b932409_cgraph.svg index 006bcac97..c537132db 100644 --- a/d0/dcb/poly__add_8c_a0c5173884bd798a6ca6f437b9b932409_cgraph.svg +++ b/d0/dcb/poly__add_8c_a0c5173884bd798a6ca6f437b9b932409_cgraph.svg @@ -1,14 +1,14 @@ - - + test2 - + Node1 @@ -22,61 +22,61 @@ Node2 - -create_polynomial + +create_polynomial Node1->Node2 - - + + Node3 - -display_polynomial + +display_polynomial Node1->Node3 - - + + Node4 - -free_poly + +free_poly Node1->Node4 - - + + Node5 - -poly_add + +poly_add Node1->Node5 - - + + diff --git a/d0/dcb/poly__add_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map b/d0/dcb/poly__add_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map index e8098404a..6436d2c63 100644 --- a/d0/dcb/poly__add_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map +++ b/d0/dcb/poly__add_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map @@ -3,8 +3,8 @@ - - - - + + + + diff --git a/d0/dcb/poly__add_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg b/d0/dcb/poly__add_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg index 680b40978..33b05a195 100644 --- a/d0/dcb/poly__add_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg +++ b/d0/dcb/poly__add_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg @@ -1,14 +1,14 @@ - - + main - + Node1 @@ -67,109 +67,109 @@ Node3 - -create_polynomial + +create_polynomial Node2->Node3 - - + + Node4 - -display_polynomial + +display_polynomial Node2->Node4 - - + + Node5 - -free_poly + +free_poly Node2->Node5 - - + + Node6 - -poly_add + +poly_add Node2->Node6 - - + + Node7->Node3 - - + + Node7->Node4 - - + + Node7->Node5 - - + + Node7->Node6 - - + + Node8->Node3 - - + + Node8->Node4 - - + + Node8->Node5 - - + + Node8->Node6 - - + + diff --git a/d0/dcb/poly__add_8c_ab138609c765e2fd8b89e9c107cd40d57_cgraph.map b/d0/dcb/poly__add_8c_ab138609c765e2fd8b89e9c107cd40d57_cgraph.map index 4fc3461c5..328fd4b38 100644 --- a/d0/dcb/poly__add_8c_ab138609c765e2fd8b89e9c107cd40d57_cgraph.map +++ b/d0/dcb/poly__add_8c_ab138609c765e2fd8b89e9c107cd40d57_cgraph.map @@ -1,7 +1,7 @@ - - - - + + + + diff --git a/d0/dcb/poly__add_8c_ab138609c765e2fd8b89e9c107cd40d57_cgraph.svg b/d0/dcb/poly__add_8c_ab138609c765e2fd8b89e9c107cd40d57_cgraph.svg index 2bc23a32b..1d5ddb3fc 100644 --- a/d0/dcb/poly__add_8c_ab138609c765e2fd8b89e9c107cd40d57_cgraph.svg +++ b/d0/dcb/poly__add_8c_ab138609c765e2fd8b89e9c107cd40d57_cgraph.svg @@ -1,14 +1,14 @@ - - + test3 - + Node1 @@ -22,61 +22,61 @@ Node2 - -create_polynomial + +create_polynomial Node1->Node2 - - + + Node3 - -display_polynomial + +display_polynomial Node1->Node3 - - + + Node4 - -free_poly + +free_poly Node1->Node4 - - + + Node5 - -poly_add + +poly_add Node1->Node5 - - + + diff --git a/d0/dcb/poly__add_8c_ab215107dbb50c7efa811a687ce9b95af_cgraph.map b/d0/dcb/poly__add_8c_ab215107dbb50c7efa811a687ce9b95af_cgraph.map index 681d4f90e..95835f10f 100644 --- a/d0/dcb/poly__add_8c_ab215107dbb50c7efa811a687ce9b95af_cgraph.map +++ b/d0/dcb/poly__add_8c_ab215107dbb50c7efa811a687ce9b95af_cgraph.map @@ -1,7 +1,7 @@ - - - - + + + + diff --git a/d0/dcb/poly__add_8c_ab215107dbb50c7efa811a687ce9b95af_cgraph.svg b/d0/dcb/poly__add_8c_ab215107dbb50c7efa811a687ce9b95af_cgraph.svg index 3fc3ecec3..d2d702158 100644 --- a/d0/dcb/poly__add_8c_ab215107dbb50c7efa811a687ce9b95af_cgraph.svg +++ b/d0/dcb/poly__add_8c_ab215107dbb50c7efa811a687ce9b95af_cgraph.svg @@ -1,14 +1,14 @@ - - + test1 - + Node1 @@ -22,61 +22,61 @@ Node2 - -create_polynomial + +create_polynomial Node1->Node2 - - + + Node3 - -display_polynomial + +display_polynomial Node1->Node3 - - + + Node4 - -free_poly + +free_poly Node1->Node4 - - + + Node5 - -poly_add + +poly_add Node1->Node5 - - + + diff --git a/d0/dd9/hexadecimal__to__octal2_8c.html b/d0/dd9/hexadecimal__to__octal2_8c.html index f75913320..e9b42ab8f 100644 --- a/d0/dd9/hexadecimal__to__octal2_8c.html +++ b/d0/dd9/hexadecimal__to__octal2_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: conversions/hexadecimal_to_octal2.c 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/dd9/hexadecimal__to__octal2_8c.html -
-
hexadecimal_to_octal2.c File Reference
+
hexadecimal_to_octal2.c File Reference
@@ -105,43 +104,43 @@ $(document).ready(function(){initNavTree('d0/dd9/hexadecimal__to__octal2_8c.html
Include dependency graph for hexadecimal_to_octal2.c:
-
+
- - -

+

Macros

+
#define MAX_OCT_STR_LEN   23 /* 17_7777_7777_7777_7777_7777 */
 
+
#define MAX_HEX_STR_LEN   17 /* FFFF_FFFF_FFFF_FFFF */
 
- - - - + + +

+

Functions

const char * hex_to_oct (const char *hex)
 for printf() and fgets() More...
 
const char * hex_to_oct (const char *hex)
 for printf() and fgets() More...
 
int main ()
 Main function. More...
 

Detailed Description

-

Convert hexadecimal number to octal number (with decimal intermediary)

-

The input is valid from 0 to 0xFFFF_FFFF_FFFF_FFFF.

-

At first, this program converts a hex string to an unsigned long long decimal, and then to an octal string.

-

When there is an invalid character in input string, this program stops parsing and converts the string until that character.

+

Convert hexadecimal number to octal number (with decimal intermediary)

+

The input is valid from 0 to 0xFFFF_FFFF_FFFF_FFFF.

+

At first, this program converts a hex string to an unsigned long long decimal, and then to an octal string.

+

When there is an invalid character in input string, this program stops parsing and converts the string until that character.

See also
hexadecimal_to_octal.c

Function Documentation

- -

◆ hex_to_oct()

+ +

◆ hex_to_oct()

- + @@ -151,92 +150,92 @@ Functions

for printf() and fgets()

-

for memset()

-

Convert a hexadecimal number to octal number.

Parameters
+

for memset()

+

Convert a hexadecimal number to octal number.

Parameters
const char* hex_to_oct const char * hex_to_oct ( const char *  hex)
hexHexadecimal number to convert.
Returns
A pointer to the converted octal string.
-
25 {
-
26 #define MAX_OCT_STR_LEN 23 /* 17_7777_7777_7777_7777_7777 */
-
27  static char octal[MAX_OCT_STR_LEN];
-
28  memset(octal, '\0', MAX_OCT_STR_LEN); // Initialize as NULL string
-
29 
-
30  unsigned long long decimal = 0;
-
31  int i = 0;
-
32  int len;
-
33 
-
34  if (hex == NULL)
-
35  {
-
36  // Return an empty string
-
37  return octal;
-
38  }
-
39 
-
40  /* Hexadecimal to decimal conversion */
-
41  while (*hex != '\n' && *hex != '\0')
-
42  {
-
43  char ch = *hex;
-
44 
-
45  if (ch >= '0' && ch <= '9')
-
46  {
-
47  ch -= '0';
-
48  }
-
49  else if (ch >= 'a' && ch <= 'f')
-
50  {
-
51  ch = ch - 'a' + 10;
-
52  }
-
53  else if (ch >= 'A' && ch <= 'F')
-
54  {
-
55  ch = ch - 'A' + 10;
-
56  }
-
57  else
-
58  {
-
59  printf("Invalid hexadecimal input: %c\n", ch);
-
60  break;
-
61  }
-
62 
-
63  decimal *= 16;
-
64  decimal += ch;
-
65  hex++;
-
66  }
-
67 
-
68  /* Decimal to octal conversion */
-
69  if (decimal == 0)
-
70  {
-
71  octal[0] = '0';
-
72  len = 1;
-
73  }
-
74  else
-
75  {
-
76  i = 0;
-
77  while (decimal > 0)
-
78  {
-
79  octal[i] = '0' + decimal % 8;
-
80  i++;
-
81  decimal /= 8;
-
82  }
-
83 
-
84  len = i;
-
85  }
-
86 
-
87  octal[len] = '\0';
-
88 
-
89  /* Reverse the octal string */
-
90  for (i = 0; i < len / 2; i++)
-
91  {
-
92  char tmp = octal[i];
-
93  octal[i] = octal[len - i - 1];
-
94  octal[len - i - 1] = tmp;
-
95  }
-
96 
-
97  return octal;
-
98 }
+
25{
+
26#define MAX_OCT_STR_LEN 23 /* 17_7777_7777_7777_7777_7777 */
+
27 static char octal[MAX_OCT_STR_LEN];
+
28 memset(octal, '\0', MAX_OCT_STR_LEN); // Initialize as NULL string
+
29
+
30 unsigned long long decimal = 0;
+
31 int i = 0;
+
32 int len;
+
33
+
34 if (hex == NULL)
+
35 {
+
36 // Return an empty string
+
37 return octal;
+
38 }
+
39
+
40 /* Hexadecimal to decimal conversion */
+
41 while (*hex != '\n' && *hex != '\0')
+
42 {
+
43 char ch = *hex;
+
44
+
45 if (ch >= '0' && ch <= '9')
+
46 {
+
47 ch -= '0';
+
48 }
+
49 else if (ch >= 'a' && ch <= 'f')
+
50 {
+
51 ch = ch - 'a' + 10;
+
52 }
+
53 else if (ch >= 'A' && ch <= 'F')
+
54 {
+
55 ch = ch - 'A' + 10;
+
56 }
+
57 else
+
58 {
+
59 printf("Invalid hexadecimal input: %c\n", ch);
+
60 break;
+
61 }
+
62
+
63 decimal *= 16;
+
64 decimal += ch;
+
65 hex++;
+
66 }
+
67
+
68 /* Decimal to octal conversion */
+
69 if (decimal == 0)
+
70 {
+
71 octal[0] = '0';
+
72 len = 1;
+
73 }
+
74 else
+
75 {
+
76 i = 0;
+
77 while (decimal > 0)
+
78 {
+
79 octal[i] = '0' + decimal % 8;
+
80 i++;
+
81 decimal /= 8;
+
82 }
+
83
+
84 len = i;
+
85 }
+
86
+
87 octal[len] = '\0';
+
88
+
89 /* Reverse the octal string */
+
90 for (i = 0; i < len / 2; i++)
+
91 {
+
92 char tmp = octal[i];
+
93 octal[i] = octal[len - i - 1];
+
94 octal[len - i - 1] = tmp;
+
95 }
+
96
+
97 return octal;
+
98}
- +

◆ main()

@@ -254,22 +253,22 @@ Functions

Main function.

Returns
0 on exit
-
105 {
-
106 #define MAX_HEX_STR_LEN 17 /* FFFF_FFFF_FFFF_FFFF */
-
107  char hex[MAX_HEX_STR_LEN];
-
108 
-
109  /* Input hexadecimal number from user */
-
110  printf("Enter any hexadecimal number: ");
-
111  fgets(hex, MAX_HEX_STR_LEN, stdin);
-
112 
-
113  const char *octal = hex_to_oct(hex);
-
114 
-
115  printf("Hexadecimal number = %s\n", hex);
-
116  printf("Octal number = %s\n", octal);
-
117 
-
118  return 0;
-
119 }
-
const char * hex_to_oct(const char *hex)
for printf() and fgets()
Definition: hexadecimal_to_octal2.c:24
+
105{
+
106#define MAX_HEX_STR_LEN 17 /* FFFF_FFFF_FFFF_FFFF */
+
107 char hex[MAX_HEX_STR_LEN];
+
108
+
109 /* Input hexadecimal number from user */
+
110 printf("Enter any hexadecimal number: ");
+
111 fgets(hex, MAX_HEX_STR_LEN, stdin);
+
112
+
113 const char *octal = hex_to_oct(hex);
+
114
+
115 printf("Hexadecimal number = %s\n", hex);
+
116 printf("Octal number = %s\n", octal);
+
117
+
118 return 0;
+
119}
+
const char * hex_to_oct(const char *hex)
for printf() and fgets()
Definition: hexadecimal_to_octal2.c:24
@@ -279,7 +278,7 @@ Functions diff --git a/d0/dd9/hexadecimal__to__octal2_8c.js b/d0/dd9/hexadecimal__to__octal2_8c.js index 3303ad338..cf5047a38 100644 --- a/d0/dd9/hexadecimal__to__octal2_8c.js +++ b/d0/dd9/hexadecimal__to__octal2_8c.js @@ -1,7 +1,5 @@ var hexadecimal__to__octal2_8c = [ - [ "MAX_HEX_STR_LEN", "d0/dd9/hexadecimal__to__octal2_8c.html#ab64e6838b9026996a18766d334beea20", null ], - [ "MAX_OCT_STR_LEN", "d0/dd9/hexadecimal__to__octal2_8c.html#ad47196c6a06f99a1437e9569bae13c5f", null ], - [ "hex_to_oct", "d0/dd9/hexadecimal__to__octal2_8c.html#a4d7524efe6e2917b3674445b7269906b", null ], + [ "hex_to_oct", "d0/dd9/hexadecimal__to__octal2_8c.html#ab83549c0d43c88544be47fa6c4885ae4", null ], [ "main", "d0/dd9/hexadecimal__to__octal2_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] ]; \ No newline at end of file diff --git a/d0/df1/structhash__set__t.html b/d0/df1/structhash__set__t.html index 3151ad360..5778546c9 100644 --- a/d0/df1/structhash__set__t.html +++ b/d0/df1/structhash__set__t.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: hash_set_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() {
@@ -92,23 +92,22 @@ $(document).ready(function(){initNavTree('d0/df1/structhash__set__t.html','../..
-
-
hash_set_t Struct Reference
+
hash_set_t Struct Reference
- - - - -

+

Data Fields

+
unsigned capacity
 
+
unsigned length
 
+
void ** values
 
+
void ** keys
 
@@ -121,7 +120,7 @@ void ** keys diff --git a/d0/df1/structhash__set__t.js b/d0/df1/structhash__set__t.js deleted file mode 100644 index 0c0fa2a43..000000000 --- a/d0/df1/structhash__set__t.js +++ /dev/null @@ -1,7 +0,0 @@ -var structhash__set__t = -[ - [ "capacity", "d0/df1/structhash__set__t.html#a6f21e4fb262dbabac311dadc7936aa68", null ], - [ "keys", "d0/df1/structhash__set__t.html#a1b52c6b78642e398f574c2ec9ed22e8a", null ], - [ "length", "d0/df1/structhash__set__t.html#a5fd11ba3c74b2cc7fd161696fb951b82", null ], - [ "values", "d0/df1/structhash__set__t.html#a66e37043817e37030d2e49fd5bf81d7f", null ] -]; \ No newline at end of file diff --git a/d0/df1/threaded__binary__trees_8c__incl.map b/d0/df1/threaded__binary__trees_8c__incl.map index 55f7111d7..71f1c201e 100644 --- a/d0/df1/threaded__binary__trees_8c__incl.map +++ b/d0/df1/threaded__binary__trees_8c__incl.map @@ -1,5 +1,5 @@ - - - + + + diff --git a/d0/df1/threaded__binary__trees_8c__incl.svg b/d0/df1/threaded__binary__trees_8c__incl.svg index 19f4cf5e9..27e651f89 100644 --- a/d0/df1/threaded__binary__trees_8c__incl.svg +++ b/d0/df1/threaded__binary__trees_8c__incl.svg @@ -1,22 +1,22 @@ - - + data_structures/binary_trees/threaded_binary_trees.c - + Node1 - + data_structures/binary _trees/threaded_binary -_trees.c +_trees.c @@ -24,31 +24,31 @@ Node2 - -stdio.h + +stdio.h Node1->Node2 - - + + Node3 - -stdlib.h + +stdlib.h Node1->Node3 - - + + diff --git a/d1/d01/insertion__sort__recursive_8c__incl.map b/d1/d01/insertion__sort__recursive_8c__incl.map index 12e6efced..9d68b0178 100644 --- a/d1/d01/insertion__sort__recursive_8c__incl.map +++ b/d1/d01/insertion__sort__recursive_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/d1/d01/insertion__sort__recursive_8c__incl.svg b/d1/d01/insertion__sort__recursive_8c__incl.svg index ac4f95058..2aad13889 100644 --- a/d1/d01/insertion__sort__recursive_8c__incl.svg +++ b/d1/d01/insertion__sort__recursive_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - -sorting/insertion_sort + +sorting/insertion_sort _recursive.c diff --git a/d1/d07/sol4_8c__incl.map b/d1/d07/sol4_8c__incl.map index ae4f7d384..d173b4312 100644 --- a/d1/d07/sol4_8c__incl.map +++ b/d1/d07/sol4_8c__incl.map @@ -1,4 +1,4 @@ - - + + diff --git a/d1/d07/sol4_8c__incl.svg b/d1/d07/sol4_8c__incl.svg index 205d8ae66..779105c82 100644 --- a/d1/d07/sol4_8c__incl.svg +++ b/d1/d07/sol4_8c__incl.svg @@ -1,21 +1,21 @@ - - + project_euler/problem_1/sol4.c - + Node1 - + project_euler/problem -_1/sol4.c +_1/sol4.c @@ -23,16 +23,16 @@ Node2 - -stdio.h + +stdio.h Node1->Node2 - - + + diff --git a/d1/d10/structelem__coll__graph.svg b/d1/d10/structelem__coll__graph.svg index 78be42a92..261da46f1 100644 --- a/d1/d10/structelem__coll__graph.svg +++ b/d1/d10/structelem__coll__graph.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C: Simple generic Stack @@ -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('d1/d12/md_data_structures_stack__r_e_a -
-
-
Simple generic Stack
+
+
Simple generic Stack
-

This is a modular generic stack data-structure. The stack is self growing.

+

This is a modular generic stack data-structure. The stack is self growing.

Content

    @@ -103,29 +102,29 @@ Content
  • main.c framework program for testing.
  • stack_linkedlist: Another stack implementation by linkedlist
-

You need to only import the stack.h

+

You need to only import the stack.h

Public interface

void initStack();
-

Initializes the stack with a capacity of 10 elements.

-
void push(void * object);
+

Initializes the stack with a capacity of 10 elements.

+
void push(void * object);
void push(struct Stack *p, char ch)
push function
Definition: infix_to_postfix.c:55
-

pushs the argument onto the stack

-
void * pop();
+

pushs the argument onto the stack

+
void * pop();
char pop(struct Stack *p)
pop function
Definition: infix_to_postfix.c:72
-

pop: pops the top element of the stack from the stack.

assumes: stack not empty.
+

pop: pops the top element of the stack from the stack.

assumes: stack not empty.
 
int size();
-

gets the number of elements of the stack.

-
int isEmpty();
+

gets the number of elements of the stack.

+
int isEmpty();
int isEmpty(struct Stack s)
isEmpty function
Definition: infix_to_postfix.c:112
-

returns 1 if stack is empty otherwise 0.

+

returns 1 if stack is empty otherwise 0.

diff --git a/d1/d20/server_8c.html b/d1/d20/server_8c.html index 8920923ff..cc643a3f2 100644 --- a/d1/d20/server_8c.html +++ b/d1/d20/server_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: client_server/server.c 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/d20/server_8c.html','../../'); init -
-
server.c File Reference
+
server.c File Reference
@@ -110,42 +109,41 @@ $(document).ready(function(){initNavTree('d1/d20/server_8c.html','../../'); init
Include dependency graph for server.c:
-
+
- - + - +

+

Macros

#define MAX   80
 max. More...
 
-#define PORT   8080
+#define PORT   8080
 port number to connect to
 
-#define SA   struct sockaddr
+#define SA   struct sockaddr
 shortname for sockaddr
 
- - - + +

+

Functions

void func (int sockfd)
 Continuous loop to send and receive over the socket. More...
 
-int main ()
 Driver code.
int main ()
 Driver code. More...
 

Detailed Description

-

Server side implementation of Server-Client system.

-
Author
Nairit11
+

Server side implementation of Server-Client system.

+
Author
Nairit11
-Krishna Vedala
+Krishna Vedala
See also
client_server/client.c

Macro Definition Documentation

- +

◆ MAX

Function Documentation

-
+

◆ func()

@@ -180,45 +178,151 @@ int 

Continuous loop to send and receive over the socket.

-

Exits when "exit" is sent from commandline.

Parameters
+

Exits when "exit" is sent from commandline.

Parameters
sockfdsocket handle number
-
48 {
-
49  char buff[MAX];
-
50  int n;
-
51  // infinite loop for chat
-
52  for (;;)
-
53  {
-
54  bzero(buff, MAX);
-
55 
-
56  // read the message from client and copy it in buffer
-
57  read(sockfd, buff, sizeof(buff));
-
58  // print buffer which contains the client contents
-
59  printf("From client: %s\t To client : ", buff);
-
60  bzero(buff, MAX);
-
61  n = 0;
-
62  // copy server message in the buffer
-
63  while ((buff[n++] = getchar()) != '\n')
-
64  {
-
65  ;
-
66  }
-
67 
-
68  // and send that buffer to client
-
69  write(sockfd, buff, sizeof(buff));
-
70 
-
71  // if msg contains "Exit" then server exit and chat ended.
-
72  if (strncmp("exit", buff, 4) == 0)
-
73  {
-
74  printf("Server Exit...\n");
-
75  break;
-
76  }
-
77  }
-
78 }
+
48{
+
49 char buff[MAX];
+
50 int n;
+
51 // infinite loop for chat
+
52 for (;;)
+
53 {
+
54 bzero(buff, MAX);
+
55
+
56 // read the message from client and copy it in buffer
+
57 read(sockfd, buff, sizeof(buff));
+
58 // print buffer which contains the client contents
+
59 printf("From client: %s\t To client : ", buff);
+
60 bzero(buff, MAX);
+
61 n = 0;
+
62 // copy server message in the buffer
+
63 while ((buff[n++] = getchar()) != '\n')
+
64 {
+
65 ;
+
66 }
+
67
+
68 // and send that buffer to client
+
69 write(sockfd, buff, sizeof(buff));
+
70
+
71 // if msg contains "Exit" then server exit and chat ended.
+
72 if (strncmp("exit", buff, 4) == 0)
+
73 {
+
74 printf("Server Exit...\n");
+
75 break;
+
76 }
+
77 }
+
78}
#define MAX
max.
Definition: server.c:33
+
+
+ +

◆ main()

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

Driver code.

+
82{
+
83#ifdef _WIN32
+
84 // when using winsock2.h, startup required
+
85 WSADATA wsData;
+
86 if (WSAStartup(MAKEWORD(2, 2), &wsData) != 0)
+
87 {
+
88 perror("WSA Startup error: \n");
+
89 return 0;
+
90 }
+
91
+
92 atexit(cleanup); // register at-exit function
+
93#endif
+
94
+
95 int sockfd, connfd;
+
96 unsigned int len;
+
97 struct sockaddr_in servaddr, cli;
+
98
+
99 // socket create and verification
+
100 sockfd = socket(AF_INET, SOCK_STREAM, 0);
+
101 if (sockfd == -1)
+
102 {
+
103 perror("socket creation failed...\n");
+
104 exit(0);
+
105 }
+
106 else
+
107 {
+
108 printf("Socket successfully created..\n");
+
109 }
+
110 bzero(&servaddr, sizeof(servaddr));
+
111
+
112 // assign IP, PORT
+
113 servaddr.sin_family = AF_INET;
+
114 servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
+
115 servaddr.sin_port = htons(PORT);
+
116
+
117 // Binding newly created socket to given IP and verification
+
118 if ((bind(sockfd, (SA *)&servaddr, sizeof(servaddr))) != 0)
+
119 {
+
120 perror("socket bind failed...\n");
+
121 exit(0);
+
122 }
+
123 else
+
124 {
+
125 printf("Socket successfully binded..\n");
+
126 }
+
127
+
128 // Now server is ready to listen and verification
+
129 if ((listen(sockfd, 5)) != 0)
+
130 {
+
131 perror("Listen failed...\n");
+
132 exit(0);
+
133 }
+
134 else
+
135 {
+
136 printf("Server listening..\n");
+
137 }
+
138 len = sizeof(cli);
+
139
+
140 // Accept the data packet from client and verification
+
141 connfd = accept(sockfd, (SA *)&cli, &len);
+
142 if (connfd < 0)
+
143 {
+
144 perror("server acccept failed...\n");
+
145 exit(0);
+
146 }
+
147 else
+
148 {
+
149 printf("server acccept the client...\n");
+
150 }
+
151
+
152 // Function for chatting between client and server
+
153 func(connfd);
+
154
+
155 // After chatting close the socket
+
156 close(sockfd);
+
157 return 0;
+
158}
+
#define SA
shortname for sockaddr
Definition: server.c:35
+
#define PORT
port number to connect to
Definition: server.c:34
+
void func(int sockfd)
Continuous loop to send and receive over the socket.
Definition: server.c:47
+
+Here is the call graph for this function:
+
+
+
+
+
@@ -227,7 +331,7 @@ int  diff --git a/d1/d20/server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d1/d20/server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..993ff9091 --- /dev/null +++ b/d1/d20/server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/d1/d20/server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d1/d20/server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..2c4f7f708 --- /dev/null +++ b/d1/d20/server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +1156e56008b5b12d976a620574e78782 \ No newline at end of file diff --git a/d1/d20/server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d1/d20/server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..c4b4c02cd --- /dev/null +++ b/d1/d20/server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,37 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +func + + + + + +Node1->Node2 + + + + + diff --git a/d1/d2f/problem__7_2sol_8c.html b/d1/d2f/problem__7_2sol_8c.html index 658e31ddd..b044aeadb 100644 --- a/d1/d2f/problem__7_2sol_8c.html +++ b/d1/d2f/problem__7_2sol_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_7/sol.c 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,33 +92,32 @@ $(document).ready(function(){initNavTree('d1/d2f/problem__7_2sol_8c.html','../..
-
-
sol.c File Reference
+
sol.c File Reference
-

Problem 7 solution. +

Problem 7 solution. More...

#include <stdio.h>
#include <stdlib.h>
Include dependency graph for sol.c:
-
+
-

+

Functions

int main (void)
 Main function. More...
 

Detailed Description

-

Problem 7 solution.

+

Problem 7 solution.

See also
Another version: problem_7/sol2.c

Function Documentation

- +

◆ main()

@@ -136,34 +135,34 @@ Functions

Main function.

Returns
0 on exit
-
13 {
-
14  char *sieve;
-
15  size_t i;
-
16  unsigned count = 0;
-
17  size_t n = 1000000;
-
18  const unsigned target = 10001;
-
19 
-
20  sieve = (char *)calloc(n, sizeof(char));
-
21  for (i = 2; i < n; i++)
-
22  {
-
23  if (!sieve[i])
-
24  {
-
25  size_t j;
-
26  count++;
-
27  if (count == target)
-
28  {
-
29  printf("%lu\n", i);
-
30  break;
-
31  }
-
32  for (j = i * 2; j < n; j += i)
-
33  {
-
34  sieve[j] = 1;
-
35  }
-
36  }
-
37  }
-
38  free(sieve);
-
39  return 0;
-
40 }
+
13{
+
14 char *sieve;
+
15 size_t i;
+
16 unsigned count = 0;
+
17 size_t n = 1000000;
+
18 const unsigned target = 10001;
+
19
+
20 sieve = (char *)calloc(n, sizeof(char));
+
21 for (i = 2; i < n; i++)
+
22 {
+
23 if (!sieve[i])
+
24 {
+
25 size_t j;
+
26 count++;
+
27 if (count == target)
+
28 {
+
29 printf("%lu\n", i);
+
30 break;
+
31 }
+
32 for (j = i * 2; j < n; j += i)
+
33 {
+
34 sieve[j] = 1;
+
35 }
+
36 }
+
37 }
+
38 free(sieve);
+
39 return 0;
+
40}
int count(int *arr, const int size)
Count func counts the number of prime numbers.
Definition: prime_seive.c:42
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
#define calloc(elemCount, elemSize)
This macro replace the standard calloc function with calloc_dbg.
Definition: malloc_dbg.h:22
@@ -182,7 +181,7 @@ Here is the call graph for this function:
diff --git a/d1/d2f/problem__7_2sol_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg b/d1/d2f/problem__7_2sol_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg index 02f80aad6..f8efe1227 100644 --- a/d1/d2f/problem__7_2sol_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg +++ b/d1/d2f/problem__7_2sol_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C: observation 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() {
@@ -92,28 +92,27 @@ $(document).ready(function(){initNavTree('d1/d5e/structobservation.html','../../
- - + - + - +

+

Data Fields

-double x
+double x
 abscissa of 2D data point
 
-double y
+double y
 ordinate of 2D data point
 
-int group
+int group
 the group no in which this observation would go
 

Detailed Description

-

a class to store points in 2d plane the name observation is used to denote a random point in plane

+

a class to store points in 2d plane the name observation is used to denote a random point in plane


The documentation for this struct was generated from the following file: @@ -123,7 +122,7 @@ int 
diff --git a/d1/d6b/group__kohonen__2d.html b/d1/d6b/group__kohonen__2d.html index 314b3fcf0..5683586e9 100644 --- a/d1/d6b/group__kohonen__2d.html +++ b/d1/d6b/group__kohonen__2d.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Kohonen SOM topology 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() {
@@ -94,39 +94,38 @@ $(document).ready(function(){initNavTree('d1/d6b/group__kohonen__2d.html','../.. Data Structures | Macros | Functions
-
-
Kohonen SOM topology algorithm
+
Kohonen SOM topology algorithm
Collaboration diagram for Kohonen SOM topology algorithm:
-
+
-

+

Data Structures

struct  kohonen_array_3d
 to store info regarding 3D arrays More...
 
- - + - +

+

Macros

-#define max(a, b)   (((a) > (b)) ? (a) : (b))
+#define max(a, b)   (((a) > (b)) ? (a) : (b))
 shorthand for maximum value
 
-#define min(a, b)   (((a) < (b)) ? (a) : (b))
+#define min(a, b)   (((a) < (b)) ? (a) : (b))
 shorthand for minimum value
 
- - - - + + + @@ -134,7 +133,7 @@ Functions - + @@ -148,7 +147,7 @@ Functions

+

Functions

double * kohonen_data_3d (const struct kohonen_array_3d *arr, int x, int y, int z)
 Function that returns the pointer to (x, y, z) ^th location in the linear 3D array given by: More...
 
double * kohonen_data_3d (const struct kohonen_array_3d *arr, int x, int y, int z)
 Function that returns the pointer to (x, y, z) ^th location in the linear 3D array given by: More...
 
double _random (double a, double b)
 Helper function to generate a random number in a given interval. More...
 
 Save a given n-dimensional data martix to file. More...
 
int save_u_matrix (const char *fname, struct kohonen_array_3d *W)
 Create the distance matrix or U-matrix from the trained weights and save to disk. More...
 Create the distance matrix or U-matrix from the trained weights and save to disk. More...
 
void get_min_2d (double **X, int N, double *val, int *x_idx, int *y_idx)
 Get minimum value and index of the value in a matrix. More...

Detailed Description

Function Documentation

- +

◆ _random()

@@ -175,7 +174,7 @@ Functions

Helper function to generate a random number in a given interval.

-


+


Steps:

  1. r1 = rand() % 100 gets a random number between 0 and 99
  2. r2 = r1 / 100 converts random number to be between 0 and 0.99
  3. @@ -192,13 +191,13 @@ Functions
    Returns
    random number in the range \([a,b)\)
    -
    88 {
    -
    89  return ((b - a) * (rand() % 100) / 100.f) + a;
    -
    90 }
    +
    88{
    +
    89 return ((b - a) * (rand() % 100) / 100.f) + a;
    +
    90}
- +

◆ get_min_2d()

@@ -253,33 +252,33 @@ Functions -
205 {
-
206  val[0] = INFINITY; // initial min value
-
207 
-
208  for (int i = 0; i < N; i++) // traverse each x-index
-
209  {
-
210  for (int j = 0; j < N; j++) // traverse each y-index
-
211  {
-
212  if (X[i][j] < val[0]) // if a lower value is found
-
213  { // save the value and its index
-
214  x_idx[0] = i;
-
215  y_idx[0] = j;
-
216  val[0] = X[i][j];
-
217  }
-
218  }
-
219  }
-
220 }
+
205{
+
206 val[0] = INFINITY; // initial min value
+
207
+
208 for (int i = 0; i < N; i++) // traverse each x-index
+
209 {
+
210 for (int j = 0; j < N; j++) // traverse each y-index
+
211 {
+
212 if (X[i][j] < val[0]) // if a lower value is found
+
213 { // save the value and its index
+
214 x_idx[0] = i;
+
215 y_idx[0] = j;
+
216 val[0] = X[i][j];
+
217 }
+
218 }
+
219 }
+
220}
- -

◆ kohonen_data_3d()

+ +

◆ kohonen_data_3d()

- + @@ -324,17 +323,17 @@ Functions
Returns
pointer to (x,y,z)^th location of data
-
68 {
-
69  int offset = (x * arr->dim2 * arr->dim3) + (y * arr->dim3) + z;
-
70  return arr->data + offset;
-
71 }
+
68{
+
69 int offset = (x * arr->dim2 * arr->dim3) + (y * arr->dim3) + z;
+
70 return arr->data + offset;
+
71}
int dim3
lengths of thirddimension
Definition: kohonen_som_topology.c:51
int dim2
lengths of second dimension
Definition: kohonen_som_topology.c:50
double * data
pointer to data
Definition: kohonen_som_topology.c:52
- +

◆ kohonen_som()

@@ -396,53 +395,53 @@ Functions
double* kohonen_data_3d double * kohonen_data_3d ( const struct kohonen_array_3d *  arr,
-
316 {
-
317  int R = num_out >> 2, iter = 0;
-
318  double **D = (double **)malloc(num_out * sizeof(double *));
-
319  for (int i = 0; i < num_out; i++)
-
320  D[i] = (double *)malloc(num_out * sizeof(double));
-
321 
-
322  double dmin = 1.f; // average minimum distance of all samples
-
323 
-
324  // Loop alpha from 1 to slpha_min
-
325  for (double alpha = 1.f; alpha > alpha_min && dmin > 1e-3;
-
326  alpha -= 0.001, iter++)
-
327  {
-
328  dmin = 0.f;
-
329  // Loop for each sample pattern in the data set
-
330  for (int sample = 0; sample < num_samples; sample++)
-
331  {
-
332  // update weights for the current input pattern sample
-
333  dmin += kohonen_update_weights(X[sample], W, D, num_out,
-
334  num_features, alpha, R);
-
335  }
-
336 
-
337  // every 20th iteration, reduce the neighborhood range
-
338  if (iter % 100 == 0 && R > 1)
-
339  R--;
-
340 
-
341  dmin /= num_samples;
-
342  printf("iter: %5d\t alpha: %.4g\t R: %d\td_min: %.4g\r", iter, alpha, R,
-
343  dmin);
-
344  }
-
345  putchar('\n');
-
346 
-
347  for (int i = 0; i < num_out; i++) free(D[i]);
-
348  free(D);
-
349 }
+
316{
+
317 int R = num_out >> 2, iter = 0;
+
318 double **D = (double **)malloc(num_out * sizeof(double *));
+
319 for (int i = 0; i < num_out; i++)
+
320 D[i] = (double *)malloc(num_out * sizeof(double));
+
321
+
322 double dmin = 1.f; // average minimum distance of all samples
+
323
+
324 // Loop alpha from 1 to slpha_min
+
325 for (double alpha = 1.f; alpha > alpha_min && dmin > 1e-3;
+
326 alpha -= 0.001, iter++)
+
327 {
+
328 dmin = 0.f;
+
329 // Loop for each sample pattern in the data set
+
330 for (int sample = 0; sample < num_samples; sample++)
+
331 {
+
332 // update weights for the current input pattern sample
+
333 dmin += kohonen_update_weights(X[sample], W, D, num_out,
+
334 num_features, alpha, R);
+
335 }
+
336
+
337 // every 20th iteration, reduce the neighborhood range
+
338 if (iter % 100 == 0 && R > 1)
+
339 R--;
+
340
+
341 dmin /= num_samples;
+
342 printf("iter: %5d\t alpha: %.4g\t R: %d\td_min: %.4g\r", iter, alpha, R,
+
343 dmin);
+
344 }
+
345 putchar('\n');
+
346
+
347 for (int i = 0; i < num_out; i++) free(D[i]);
+
348 free(D);
+
349}
double kohonen_update_weights(const double *X, struct kohonen_array_3d *W, double **D, int num_out, int num_features, double alpha, int R)
Update weights of the SOM using Kohonen algorithm.
Definition: kohonen_som_topology.c:234
#define malloc(bytes)
This macro replace the standard malloc function with malloc_dbg.
Definition: malloc_dbg.h:18
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
Here is the call graph for this function:
-
+
- +

◆ kohonen_update_weights()

@@ -512,85 +511,85 @@ Here is the call graph for this function:
Returns
minimum distance of sample and trained weights
-
237 {
-
238  int x, y, k;
-
239  double d_min = 0.f;
-
240 
-
241 #ifdef _OPENMP
-
242 #pragma omp for
-
243 #endif
-
244  // step 1: for each 2D output point
-
245  for (x = 0; x < num_out; x++)
-
246  {
-
247  for (y = 0; y < num_out; y++)
-
248  {
-
249  D[x][y] = 0.f;
-
250  // compute Euclidian distance of each output
-
251  // point from the current sample
-
252  for (k = 0; k < num_features; k++)
-
253  {
-
254  double *w = kohonen_data_3d(W, x, y, k);
-
255  D[x][y] += (w[0] - X[k]) * (w[0] - X[k]);
-
256  }
-
257  D[x][y] = sqrt(D[x][y]);
-
258  }
-
259  }
-
260 
-
261  // step 2: get closest node i.e., node with smallest Euclidian distance to
-
262  // the current pattern
-
263  int d_min_x, d_min_y;
-
264  get_min_2d(D, num_out, &d_min, &d_min_x, &d_min_y);
-
265 
-
266  // step 3a: get the neighborhood range
-
267  int from_x = max(0, d_min_x - R);
-
268  int to_x = min(num_out, d_min_x + R + 1);
-
269  int from_y = max(0, d_min_y - R);
-
270  int to_y = min(num_out, d_min_y + R + 1);
-
271 
-
272  // step 3b: update the weights of nodes in the
-
273  // neighborhood
-
274 #ifdef _OPENMP
-
275 #pragma omp for
-
276 #endif
-
277  for (x = from_x; x < to_x; x++)
-
278  {
-
279  for (y = from_y; y < to_y; y++)
-
280  {
-
281  /* you can enable the following normalization if needed.
-
282  personally, I found it detrimental to convergence */
-
283  // const double s2pi = sqrt(2.f * M_PI);
-
284  // double normalize = 1.f / (alpha * s2pi);
-
285 
-
286  /* apply scaling inversely proportional to distance from the
-
287  current node */
-
288  double d2 =
-
289  (d_min_x - x) * (d_min_x - x) + (d_min_y - y) * (d_min_y - y);
-
290  double scale_factor = exp(-d2 / (2.f * alpha * alpha));
-
291 
-
292  for (k = 0; k < num_features; k++)
-
293  {
-
294  double *w = kohonen_data_3d(W, x, y, k);
-
295  // update weights of nodes in the neighborhood
-
296  w[0] += alpha * scale_factor * (X[k] - w[0]);
-
297  }
-
298  }
-
299  }
-
300  return d_min;
-
301 }
-
double * kohonen_data_3d(const struct kohonen_array_3d *arr, int x, int y, int z)
Function that returns the pointer to (x, y, z) ^th location in the linear 3D array given by:
Definition: kohonen_som_topology.c:67
+
237{
+
238 int x, y, k;
+
239 double d_min = 0.f;
+
240
+
241#ifdef _OPENMP
+
242#pragma omp for
+
243#endif
+
244 // step 1: for each 2D output point
+
245 for (x = 0; x < num_out; x++)
+
246 {
+
247 for (y = 0; y < num_out; y++)
+
248 {
+
249 D[x][y] = 0.f;
+
250 // compute Euclidian distance of each output
+
251 // point from the current sample
+
252 for (k = 0; k < num_features; k++)
+
253 {
+
254 double *w = kohonen_data_3d(W, x, y, k);
+
255 D[x][y] += (w[0] - X[k]) * (w[0] - X[k]);
+
256 }
+
257 D[x][y] = sqrt(D[x][y]);
+
258 }
+
259 }
+
260
+
261 // step 2: get closest node i.e., node with smallest Euclidian distance to
+
262 // the current pattern
+
263 int d_min_x, d_min_y;
+
264 get_min_2d(D, num_out, &d_min, &d_min_x, &d_min_y);
+
265
+
266 // step 3a: get the neighborhood range
+
267 int from_x = max(0, d_min_x - R);
+
268 int to_x = min(num_out, d_min_x + R + 1);
+
269 int from_y = max(0, d_min_y - R);
+
270 int to_y = min(num_out, d_min_y + R + 1);
+
271
+
272 // step 3b: update the weights of nodes in the
+
273 // neighborhood
+
274#ifdef _OPENMP
+
275#pragma omp for
+
276#endif
+
277 for (x = from_x; x < to_x; x++)
+
278 {
+
279 for (y = from_y; y < to_y; y++)
+
280 {
+
281 /* you can enable the following normalization if needed.
+
282 personally, I found it detrimental to convergence */
+
283 // const double s2pi = sqrt(2.f * M_PI);
+
284 // double normalize = 1.f / (alpha * s2pi);
+
285
+
286 /* apply scaling inversely proportional to distance from the
+
287 current node */
+
288 double d2 =
+
289 (d_min_x - x) * (d_min_x - x) + (d_min_y - y) * (d_min_y - y);
+
290 double scale_factor = exp(-d2 / (2.f * alpha * alpha));
+
291
+
292 for (k = 0; k < num_features; k++)
+
293 {
+
294 double *w = kohonen_data_3d(W, x, y, k);
+
295 // update weights of nodes in the neighborhood
+
296 w[0] += alpha * scale_factor * (X[k] - w[0]);
+
297 }
+
298 }
+
299 }
+
300 return d_min;
+
301}
#define min(a, b)
shorthand for minimum value
Definition: kohonen_som_topology.c:43
+
double * kohonen_data_3d(const struct kohonen_array_3d *arr, int x, int y, int z)
Function that returns the pointer to (x, y, z) ^th location in the linear 3D array given by:
Definition: kohonen_som_topology.c:67
void get_min_2d(double **X, int N, double *val, int *x_idx, int *y_idx)
Get minimum value and index of the value in a matrix.
Definition: kohonen_som_topology.c:204
#define max(a, b)
shorthand for maximum value
Definition: kohonen_som_topology.c:39
Here is the call graph for this function:
-
+
- +

◆ save_2d_data()

@@ -641,34 +640,34 @@ Here is the call graph for this function:
Returns
0 if all ok
-1 if file creation failed
-
104 {
-
105  FILE *fp = fopen(fname, "wt");
-
106  if (!fp) // error with fopen
-
107  {
-
108  char msg[120];
-
109  sprintf(msg, "File error (%s): ", fname);
-
110  perror(msg);
-
111  return -1;
-
112  }
-
113 
-
114  for (int i = 0; i < num_points; i++) // for each point in the array
-
115  {
-
116  for (int j = 0; j < num_features; j++) // for each feature in the array
-
117  {
-
118  fprintf(fp, "%.4g", X[i][j]); // print the feature value
-
119  if (j < num_features - 1) // if not the last feature
-
120  fputc(',', fp); // suffix comma
-
121  }
-
122  if (i < num_points - 1) // if not the last row
-
123  fputc('\n', fp); // start a new line
-
124  }
-
125  fclose(fp);
-
126  return 0;
-
127 }
+
104{
+
105 FILE *fp = fopen(fname, "wt");
+
106 if (!fp) // error with fopen
+
107 {
+
108 char msg[120];
+
109 sprintf(msg, "File error (%s): ", fname);
+
110 perror(msg);
+
111 return -1;
+
112 }
+
113
+
114 for (int i = 0; i < num_points; i++) // for each point in the array
+
115 {
+
116 for (int j = 0; j < num_features; j++) // for each feature in the array
+
117 {
+
118 fprintf(fp, "%.4g", X[i][j]); // print the feature value
+
119 if (j < num_features - 1) // if not the last feature
+
120 fputc(',', fp); // suffix comma
+
121 }
+
122 if (i < num_points - 1) // if not the last row
+
123 fputc('\n', fp); // start a new line
+
124 }
+
125 fclose(fp);
+
126 return 0;
+
127}
- +

◆ save_u_matrix()

@@ -694,7 +693,7 @@ Here is the call graph for this function:
-

Create the distance matrix or U-matrix from the trained weights and save to disk.

+

Create the distance matrix or U-matrix from the trained weights and save to disk.

Parameters
@@ -705,66 +704,66 @@ Here is the call graph for this function:
Returns
0 if all ok
-1 if file creation failed
-
140 {
-
141  FILE *fp = fopen(fname, "wt");
-
142  if (!fp) // error with fopen
-
143  {
-
144  char msg[120];
-
145  sprintf(msg, "File error (%s): ", fname);
-
146  perror(msg);
-
147  return -1;
-
148  }
-
149 
-
150  int R = max(W->dim1 >> 3, 2); /* neighborhood range */
-
151 
-
152  for (int i = 0; i < W->dim1; i++) // for each x
-
153  {
-
154  for (int j = 0; j < W->dim2; j++) // for each y
-
155  {
-
156  double distance = 0.f;
-
157  int k;
-
158 
-
159  int from_x = max(0, i - R);
-
160  int to_x = min(W->dim1, i + R + 1);
-
161  int from_y = max(0, j - R);
-
162  int to_y = min(W->dim2, j + R + 1);
-
163  int l;
-
164 #ifdef _OPENMP
-
165 #pragma omp parallel for reduction(+ : distance)
-
166 #endif
-
167  for (l = from_x; l < to_x; l++) // scan neighborhoor in x
-
168  {
-
169  for (int m = from_y; m < to_y; m++) // scan neighborhood in y
-
170  {
-
171  double d = 0.f;
-
172  for (k = 0; k < W->dim3; k++) // for each feature
-
173  {
-
174  double *w1 = kohonen_data_3d(W, i, j, k);
-
175  double *w2 = kohonen_data_3d(W, l, m, k);
-
176  d += (w1[0] - w2[0]) * (w1[0] - w2[0]);
-
177  // distance += w1[0] * w1[0];
-
178  }
-
179  distance += sqrt(d);
-
180  // distance += d;
-
181  }
-
182  }
-
183 
-
184  distance /= R * R; // mean distance from neighbors
-
185  fprintf(fp, "%.4g", distance); // print the mean separation
-
186  if (j < W->dim2 - 1) // if not the last column
-
187  fputc(',', fp); // suffix comma
-
188  }
-
189  if (i < W->dim1 - 1) // if not the last row
-
190  fputc('\n', fp); // start a new line
-
191  }
-
192  fclose(fp);
-
193  return 0;
-
194 }
+
140{
+
141 FILE *fp = fopen(fname, "wt");
+
142 if (!fp) // error with fopen
+
143 {
+
144 char msg[120];
+
145 sprintf(msg, "File error (%s): ", fname);
+
146 perror(msg);
+
147 return -1;
+
148 }
+
149
+
150 int R = max(W->dim1 >> 3, 2); /* neighborhood range */
+
151
+
152 for (int i = 0; i < W->dim1; i++) // for each x
+
153 {
+
154 for (int j = 0; j < W->dim2; j++) // for each y
+
155 {
+
156 double distance = 0.f;
+
157 int k;
+
158
+
159 int from_x = max(0, i - R);
+
160 int to_x = min(W->dim1, i + R + 1);
+
161 int from_y = max(0, j - R);
+
162 int to_y = min(W->dim2, j + R + 1);
+
163 int l;
+
164#ifdef _OPENMP
+
165#pragma omp parallel for reduction(+ : distance)
+
166#endif
+
167 for (l = from_x; l < to_x; l++) // scan neighborhoor in x
+
168 {
+
169 for (int m = from_y; m < to_y; m++) // scan neighborhood in y
+
170 {
+
171 double d = 0.f;
+
172 for (k = 0; k < W->dim3; k++) // for each feature
+
173 {
+
174 double *w1 = kohonen_data_3d(W, i, j, k);
+
175 double *w2 = kohonen_data_3d(W, l, m, k);
+
176 d += (w1[0] - w2[0]) * (w1[0] - w2[0]);
+
177 // distance += w1[0] * w1[0];
+
178 }
+
179 distance += sqrt(d);
+
180 // distance += d;
+
181 }
+
182 }
+
183
+
184 distance /= R * R; // mean distance from neighbors
+
185 fprintf(fp, "%.4g", distance); // print the mean separation
+
186 if (j < W->dim2 - 1) // if not the last column
+
187 fputc(',', fp); // suffix comma
+
188 }
+
189 if (i < W->dim1 - 1) // if not the last row
+
190 fputc('\n', fp); // start a new line
+
191 }
+
192 fclose(fp);
+
193 return 0;
+
194}
int dim1
lengths of first dimension
Definition: kohonen_som_topology.c:49
Here is the call graph for this function:
-
+
@@ -775,7 +774,7 @@ Here is the call graph for this function:
diff --git a/d1/d6b/group__kohonen__2d.js b/d1/d6b/group__kohonen__2d.js index ec880c62e..dd0eff2e0 100644 --- a/d1/d6b/group__kohonen__2d.js +++ b/d1/d6b/group__kohonen__2d.js @@ -10,7 +10,7 @@ var group__kohonen__2d = [ "min", "d1/d6b/group__kohonen__2d.html#gac6afabdc09a49a433ee19d8a9486056d", null ], [ "_random", "d1/d6b/group__kohonen__2d.html#gaf5ce14f026d6d231bef29161bac2b485", null ], [ "get_min_2d", "d1/d6b/group__kohonen__2d.html#gadc22d512c00a9f5799ee067f4fb90b4b", null ], - [ "kohonen_data_3d", "d1/d6b/group__kohonen__2d.html#ga8df35f04c1762a01dcf108fa13b897d6", null ], + [ "kohonen_data_3d", "d1/d6b/group__kohonen__2d.html#gac78022076d889bf2ebfb2c41d4527ceb", null ], [ "kohonen_som", "d1/d6b/group__kohonen__2d.html#gacb42eda8af6ebd6a141a34ab00a0b710", null ], [ "kohonen_update_weights", "d1/d6b/group__kohonen__2d.html#ga83abb572c60d202e100595a989dfe123", null ], [ "save_2d_data", "d1/d6b/group__kohonen__2d.html#ga6824dc6d973eb3339af7aef5fea78b0c", null ], diff --git a/d1/d6b/group__kohonen__2d.map b/d1/d6b/group__kohonen__2d.map index e09319bcb..90f133b8a 100644 --- a/d1/d6b/group__kohonen__2d.map +++ b/d1/d6b/group__kohonen__2d.map @@ -1,4 +1,4 @@ - - + + diff --git a/d1/d6b/group__kohonen__2d.svg b/d1/d6b/group__kohonen__2d.svg index 1b7215fe0..173a468c8 100644 --- a/d1/d6b/group__kohonen__2d.svg +++ b/d1/d6b/group__kohonen__2d.svg @@ -1,21 +1,21 @@ - - + Kohonen SOM topology algorithm - + Node1 - -Kohonen SOM topology - algorithm + +Kohonen SOM topology + algorithm @@ -23,16 +23,16 @@ Node2 - -Machine learning algorithms + +Machine learning algorithms Node2->Node1 - - + + diff --git a/d1/d6b/group__kohonen__2d_ga49d35f68f5d11d8ef6f8cce0d0e7bcba_cgraph.map b/d1/d6b/group__kohonen__2d_ga49d35f68f5d11d8ef6f8cce0d0e7bcba_cgraph.map index b7e2f2ceb..06c05bdbe 100644 --- a/d1/d6b/group__kohonen__2d_ga49d35f68f5d11d8ef6f8cce0d0e7bcba_cgraph.map +++ b/d1/d6b/group__kohonen__2d_ga49d35f68f5d11d8ef6f8cce0d0e7bcba_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/d1/d6b/group__kohonen__2d_ga49d35f68f5d11d8ef6f8cce0d0e7bcba_cgraph.md5 b/d1/d6b/group__kohonen__2d_ga49d35f68f5d11d8ef6f8cce0d0e7bcba_cgraph.md5 index 198ea067c..d8e7f0e7b 100644 --- a/d1/d6b/group__kohonen__2d_ga49d35f68f5d11d8ef6f8cce0d0e7bcba_cgraph.md5 +++ b/d1/d6b/group__kohonen__2d_ga49d35f68f5d11d8ef6f8cce0d0e7bcba_cgraph.md5 @@ -1 +1 @@ -6f9c00db544ffa502749c5b67ee67cf3 \ No newline at end of file +7f05e3fe20d6bafd9962355f34669b1c \ No newline at end of file diff --git a/d1/d6b/group__kohonen__2d_ga49d35f68f5d11d8ef6f8cce0d0e7bcba_cgraph.svg b/d1/d6b/group__kohonen__2d_ga49d35f68f5d11d8ef6f8cce0d0e7bcba_cgraph.svg index 0f55d8169..da4d463a5 100644 --- a/d1/d6b/group__kohonen__2d_ga49d35f68f5d11d8ef6f8cce0d0e7bcba_cgraph.svg +++ b/d1/d6b/group__kohonen__2d_ga49d35f68f5d11d8ef6f8cce0d0e7bcba_cgraph.svg @@ -1,37 +1,37 @@ - - + save_u_matrix - + Node1 - -save_u_matrix + +save_u_matrix Node2 - - -kohonen_data_3d + + +kohonen_data_3d Node1->Node2 - - + + diff --git a/d1/d6b/group__kohonen__2d_ga83abb572c60d202e100595a989dfe123_cgraph.map b/d1/d6b/group__kohonen__2d_ga83abb572c60d202e100595a989dfe123_cgraph.map index fa43dcdec..d70889bfd 100644 --- a/d1/d6b/group__kohonen__2d_ga83abb572c60d202e100595a989dfe123_cgraph.map +++ b/d1/d6b/group__kohonen__2d_ga83abb572c60d202e100595a989dfe123_cgraph.map @@ -1,5 +1,5 @@ - - - + + + diff --git a/d1/d6b/group__kohonen__2d_ga83abb572c60d202e100595a989dfe123_cgraph.md5 b/d1/d6b/group__kohonen__2d_ga83abb572c60d202e100595a989dfe123_cgraph.md5 index 8553496b7..fbca0e664 100644 --- a/d1/d6b/group__kohonen__2d_ga83abb572c60d202e100595a989dfe123_cgraph.md5 +++ b/d1/d6b/group__kohonen__2d_ga83abb572c60d202e100595a989dfe123_cgraph.md5 @@ -1 +1 @@ -0a56b8072c06dc78e5d8179fc24c709e \ No newline at end of file +76f24dfb7465d7d6c34e6ed50c626c4c \ No newline at end of file diff --git a/d1/d6b/group__kohonen__2d_ga83abb572c60d202e100595a989dfe123_cgraph.svg b/d1/d6b/group__kohonen__2d_ga83abb572c60d202e100595a989dfe123_cgraph.svg index 4c8b479e0..ab7861030 100644 --- a/d1/d6b/group__kohonen__2d_ga83abb572c60d202e100595a989dfe123_cgraph.svg +++ b/d1/d6b/group__kohonen__2d_ga83abb572c60d202e100595a989dfe123_cgraph.svg @@ -1,20 +1,20 @@ - - + kohonen_update_weights - + Node1 - -kohonen_update_weights + +kohonen_update_weights @@ -22,31 +22,31 @@ Node2 - -get_min_2d + +get_min_2d Node1->Node2 - - + + Node3 - - -kohonen_data_3d + + +kohonen_data_3d Node1->Node3 - - + + diff --git a/d1/d6b/group__kohonen__2d_gacb42eda8af6ebd6a141a34ab00a0b710_cgraph.map b/d1/d6b/group__kohonen__2d_gacb42eda8af6ebd6a141a34ab00a0b710_cgraph.map index 4bacaf22e..0f5db90a5 100644 --- a/d1/d6b/group__kohonen__2d_gacb42eda8af6ebd6a141a34ab00a0b710_cgraph.map +++ b/d1/d6b/group__kohonen__2d_gacb42eda8af6ebd6a141a34ab00a0b710_cgraph.map @@ -1,6 +1,6 @@ - - - - + + + + diff --git a/d1/d6b/group__kohonen__2d_gacb42eda8af6ebd6a141a34ab00a0b710_cgraph.md5 b/d1/d6b/group__kohonen__2d_gacb42eda8af6ebd6a141a34ab00a0b710_cgraph.md5 index eca324413..67d09954d 100644 --- a/d1/d6b/group__kohonen__2d_gacb42eda8af6ebd6a141a34ab00a0b710_cgraph.md5 +++ b/d1/d6b/group__kohonen__2d_gacb42eda8af6ebd6a141a34ab00a0b710_cgraph.md5 @@ -1 +1 @@ -bfefdf28a50bb12842785181b9640380 \ No newline at end of file +0464171a8cd7a5d3145c8323c2d735a4 \ No newline at end of file diff --git a/d1/d6b/group__kohonen__2d_gacb42eda8af6ebd6a141a34ab00a0b710_cgraph.svg b/d1/d6b/group__kohonen__2d_gacb42eda8af6ebd6a141a34ab00a0b710_cgraph.svg index 731d2d711..495f7e0f3 100644 --- a/d1/d6b/group__kohonen__2d_gacb42eda8af6ebd6a141a34ab00a0b710_cgraph.svg +++ b/d1/d6b/group__kohonen__2d_gacb42eda8af6ebd6a141a34ab00a0b710_cgraph.svg @@ -1,20 +1,20 @@ - - + kohonen_som - + Node1 - -kohonen_som + +kohonen_som @@ -22,46 +22,46 @@ Node2 - -kohonen_update_weights + +kohonen_update_weights Node1->Node2 - - + + Node3 - -get_min_2d + +get_min_2d Node2->Node3 - - + + Node4 - - -kohonen_data_3d + + +kohonen_data_3d Node2->Node4 - - + + diff --git a/d1/d6b/tcp__full__duplex__server_8c.html b/d1/d6b/tcp__full__duplex__server_8c.html new file mode 100644 index 000000000..705c7ac45 --- /dev/null +++ b/d1/d6b/tcp__full__duplex__server_8c.html @@ -0,0 +1,400 @@ + + + + + + + +Algorithms_in_C: client_server/tcp_full_duplex_server.c File Reference + + + + + + + + + + + + + + + +
+
+
[in]fnamefilename to save in (gets overwriten without confirmation)
+ + + + + +
+
Algorithms_in_C 1.0.0 +
+
Set of algorithms implemented in C.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
tcp_full_duplex_server.c File Reference
+
+
+ +

Server-side implementation of TCP Full Duplex Communication +More...

+
#include <arpa/inet.h>
+#include <netdb.h>
+#include <netinet/in.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+Include dependency graph for tcp_full_duplex_server.c:
+
+
+
+
+
+ + + + +

+Macros

#define PORT   10000
 For the type in_addr_t and in_port_t. More...
 
+ + + + + + + +

+Functions

void error ()
 Utility function used to print an error message to stderr. More...
 
int main ()
 Main function. More...
 
+

Detailed Description

+

Server-side implementation of TCP Full Duplex Communication

+
Author
NVombat
+
See also
tcp_full_duplex_server.c
+

The algorithm is based on the simple TCP client and server model. However, instead of the server only sending and the client only receiving data, The server and client can both send and receive data simultaneously. This is implemented by using the fork function call so that in the server the child process can recieve data and parent process can send data, and in the client the child process can send data and the parent process can receive data. It runs an infinite loop and can send and receive messages indefinitely until the user exits the loop. In this way, the Full Duplex Form of communication can be represented using the TCP server-client model & socket programming

+

Macro Definition Documentation

+ +

◆ PORT

+ +
+
+ + + + +
#define PORT   10000
+
+ +

For the type in_addr_t and in_port_t.

+

For structures returned by the network database library - formatted internet addresses and port numbers For in_addr and sockaddr_in structures For specific bit size values of variables Variable types, several macros, and various functions for performing input and output Variable types, several macros, and various functions for performing general functions Various functions for manipulating arrays of characters For macro definitions related to the creation of sockets For definitions to allow for the porting of BSD programs For miscellaneous symbolic constants and types, and miscellaneous functions

+ +
+
+

Function Documentation

+ +

◆ error()

+ +
+
+ + + + + + + +
void error ()
+
+ +

Utility function used to print an error message to stderr.

+

It prints str and an implementation-defined error message corresponding to the global variable errno.

Returns
void
+
40{
+
41 perror("Socket Creation Failed");
+
42 exit(EXIT_FAILURE);
+
43}
+
+
+
+ +

◆ main()

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

Main function.

+
Returns
0 on exit
+

Variable Declarations

+

< socket descriptors - Like file handles but for sockets

+

< character arrays to read and store string data for communication

+

< asic structures for all syscalls and functions that deal with internet addresses. Structures for handling internet addresses

+

size of address

+

The TCP socket is created using the socket function

+

AF_INET (Family) - it is an address family that is used to designate the type of addresses that your socket can communicate with

+

SOCK_STREAM (Type) - Indicates TCP Connection - A stream socket provides for the bidirectional, reliable, sequenced, and unduplicated flow of data without record boundaries. Aside from the bidirectionality of data flow, a pair of connected stream sockets provides an interface nearly identical to pipes

+

0 (Protocol) - Specifies a particular protocol to be used with the socket. Specifying a protocol of 0 causes socket() to use an unspecified default protocol appropriate for the requested socket type

+

< Error if the socket descriptor has a value lower than 0 - socket wasnt created

+

Server Address Information

+

The bzero() function erases the data in the n bytes of the memory starting at the location pointed to, by writing zeros (bytes containing '\0') to that area

+

We bind the server_addr to the internet address and port number thus giving our socket an identity with an address and port where it can listen for connections

+

htons - The htons() function translates a short integer from host byte order to network byte order

+

htonl - The htonl() function translates a long integer from host byte order to network byte order

+

These functions are necessary so that the binding of address and port takes place with data in the correct format

+

This binds the socket descriptor to the server thus enabling the server to listen for connections and communicate with other clients

+

If binding is unsuccessful

+

This is to listen for clients or connections made to the server

+

The limit is currently at 5 but can be increased to listen for more connections

+

It listens to connections through the socket descriptor

+

When a connection is found, a socket is created and connection is accepted and established through the socket descriptor

+

Communication between client and server

+

The bzero() function erases the data in the n bytes of the memory starting at the location pointed to, by writing zeros (bytes containing '\0') to that area. The variables are emptied and then ready for use

+

The fork function call is used to create a child and parent process which run and execute code simultaneously

+

The child process is used to receive data and after doing so sleeps for 5 seconds to wait for the parent to send data

+

The parent process is used to send data and after doing so sleeps for 5 seconds to wait for the child to receive data

+

The server and client can communicate indefinitely till one of them exits the connection

+

Since the exchange of information between the server and client takes place simultaneously this represents FULL DUPLEX COMMUNICATION

+

Value of 0 is for child process

+

Parent process

+

Close socket

+
50{
+
51 /** Variable Declarations */
+
52 uint32_t sockfd,
+
53 conn; ///< socket descriptors - Like file handles but for sockets
+
54 char recvbuff[1024],
+
55 sendbuff[1024]; ///< character arrays to read and store string data
+
56 /// for communication
+
57
+
58 struct sockaddr_in server_addr,
+
59 client_addr; ///< asic structures for all syscalls and functions that
+
60 /// deal with internet addresses. Structures for handling
+
61 /// internet addresses
+
62 socklen_t ClientLen; /// size of address
+
63
+
64 /**
+
65 * The TCP socket is created using the socket function
+
66 *
+
67 * AF_INET (Family) - it is an address family that is used to designate the
+
68 * type of addresses that your socket can communicate with
+
69 *
+
70 * SOCK_STREAM (Type) - Indicates TCP Connection - A stream socket provides
+
71 * for the bidirectional, reliable, sequenced, and unduplicated flow of data
+
72 * without record boundaries. Aside from the bidirectionality of data flow,
+
73 * a pair of connected stream sockets provides an interface nearly identical
+
74 * to pipes
+
75 *
+
76 * 0 (Protocol) - Specifies a particular protocol to be used with the
+
77 * socket. Specifying a protocol of 0 causes socket() to use an unspecified
+
78 * default protocol appropriate for the requested socket type
+
79 */
+
80 if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
+
81 {
+
82 error(); ///< Error if the socket descriptor has a value lower than 0 -
+
83 /// socket wasnt created
+
84 }
+
85
+
86 /**
+
87 * Server Address Information
+
88 *
+
89 * The bzero() function erases the data in the n bytes of the memory
+
90 * starting at the location pointed to, by writing zeros (bytes
+
91 * containing '\0') to that area
+
92 *
+
93 * We bind the server_addr to the internet address and port number thus
+
94 * giving our socket an identity with an address and port where it can
+
95 * listen for connections
+
96 *
+
97 * htons - The htons() function translates a short integer from host byte
+
98 * order to network byte order
+
99 *
+
100 * htonl - The htonl() function translates a long integer from host byte
+
101 * order to network byte order
+
102 *
+
103 * These functions are necessary so that the binding of address and port
+
104 * takes place with data in the correct format
+
105 */
+
106 bzero(&server_addr, sizeof(server_addr));
+
107 server_addr.sin_family = AF_INET;
+
108 server_addr.sin_port = htons(PORT);
+
109 server_addr.sin_addr.s_addr = htonl(INADDR_ANY);
+
110
+
111 printf("Server is running...\n");
+
112
+
113 /**
+
114 * This binds the socket descriptor to the server thus enabling the server
+
115 * to listen for connections and communicate with other clients
+
116 */
+
117 if (bind(sockfd, (struct sockaddr *)&server_addr, sizeof(server_addr)) < 0)
+
118 {
+
119 error(); /// If binding is unsuccessful
+
120 }
+
121 /**
+
122 * This is to listen for clients or connections made to the server
+
123 *
+
124 * The limit is currently at 5 but can be increased to listen for
+
125 * more connections
+
126 *
+
127 * It listens to connections through the socket descriptor
+
128 */
+
129 listen(sockfd, 5);
+
130
+
131 printf("Server is listening...\n");
+
132
+
133 /**
+
134 * When a connection is found, a socket is created and connection is
+
135 * accepted and established through the socket descriptor
+
136 */
+
137 conn = accept(sockfd, (struct sockaddr *)NULL, NULL);
+
138
+
139 printf("Server is connected...\n");
+
140
+
141 /**
+
142 * Communication between client and server
+
143 *
+
144 * The bzero() function erases the data in the n bytes of the memory
+
145 * starting at the location pointed to, by writing zeros (bytes
+
146 * containing '\0') to that area. The variables are emptied and then
+
147 * ready for use
+
148 *
+
149 * The fork function call is used to create a child and parent process
+
150 * which run and execute code simultaneously
+
151 *
+
152 * The child process is used to receive data and after doing so
+
153 * sleeps for 5 seconds to wait for the parent to send data
+
154 *
+
155 * The parent process is used to send data and after doing so
+
156 * sleeps for 5 seconds to wait for the child to receive data
+
157 *
+
158 * The server and client can communicate indefinitely till one of them
+
159 * exits the connection
+
160 *
+
161 * Since the exchange of information between the server and client takes
+
162 * place simultaneously this represents FULL DUPLEX COMMUNICATION
+
163 */
+
164 pid_t pid;
+
165 pid = fork();
+
166 if (pid == 0) /// Value of 0 is for child process
+
167 {
+
168 while (1)
+
169 {
+
170 bzero(&recvbuff, sizeof(recvbuff));
+
171 recv(conn, recvbuff, sizeof(recvbuff), 0);
+
172 printf("\nCLIENT : %s\n", recvbuff);
+
173 sleep(5);
+
174 // break;
+
175 }
+
176 }
+
177 else /// Parent process
+
178 {
+
179 while (1)
+
180 {
+
181 bzero(&sendbuff, sizeof(sendbuff));
+
182 printf("\nType message here: ");
+
183 fgets(sendbuff, 1024, stdin);
+
184 send(conn, sendbuff, strlen(sendbuff) + 1, 0);
+
185 printf("\nMessage Sent!\n");
+
186 sleep(5);
+
187 // break;
+
188 }
+
189 }
+
190
+
191 /// Close socket
+
192 close(sockfd);
+
193 printf("Server is offline...\n");
+
194 return 0;
+
195}
+
PID Controller.
Definition: pid.c:31
+
#define PORT
For the type in_addr_t and in_port_t.
Definition: tcp_full_duplex_server.c:31
+
void error()
Utility function used to print an error message to stderr.
Definition: tcp_full_duplex_server.c:39
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+
+
+ + + + diff --git a/d1/d6b/tcp__full__duplex__server_8c.js b/d1/d6b/tcp__full__duplex__server_8c.js new file mode 100644 index 000000000..fca5762d8 --- /dev/null +++ b/d1/d6b/tcp__full__duplex__server_8c.js @@ -0,0 +1,6 @@ +var tcp__full__duplex__server_8c = +[ + [ "PORT", "d1/d6b/tcp__full__duplex__server_8c.html#a614217d263be1fb1a5f76e2ff7be19a2", null ], + [ "error", "d1/d6b/tcp__full__duplex__server_8c.html#a7e15c8e2885871839fc2b820dfbdb4ce", null ], + [ "main", "d1/d6b/tcp__full__duplex__server_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/d1/d6b/tcp__full__duplex__server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d1/d6b/tcp__full__duplex__server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..1197ee9f2 --- /dev/null +++ b/d1/d6b/tcp__full__duplex__server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/d1/d6b/tcp__full__duplex__server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d1/d6b/tcp__full__duplex__server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..9bca116e7 --- /dev/null +++ b/d1/d6b/tcp__full__duplex__server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +d4594e5bf39aa614ac4eb0a1cc009cce \ No newline at end of file diff --git a/d1/d6b/tcp__full__duplex__server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d1/d6b/tcp__full__duplex__server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..442dabc1b --- /dev/null +++ b/d1/d6b/tcp__full__duplex__server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,37 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +error + + + + + +Node1->Node2 + + + + + diff --git a/d1/d6c/ode__forward__euler_8c__incl.map b/d1/d6c/ode__forward__euler_8c__incl.map index 89fa4e2ff..9c8134a0c 100644 --- a/d1/d6c/ode__forward__euler_8c__incl.map +++ b/d1/d6c/ode__forward__euler_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/d1/d6c/ode__forward__euler_8c__incl.svg b/d1/d6c/ode__forward__euler_8c__incl.svg index 41083f51e..0ed2d9966 100644 --- a/d1/d6c/ode__forward__euler_8c__incl.svg +++ b/d1/d6c/ode__forward__euler_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - -numerical_methods/ode + +numerical_methods/ode _forward_euler.c diff --git a/d1/d8d/struct_a_v_lnode__coll__graph.map b/d1/d8d/struct_a_v_lnode__coll__graph.map index a750e3776..554e01a50 100644 --- a/d1/d8d/struct_a_v_lnode__coll__graph.map +++ b/d1/d8d/struct_a_v_lnode__coll__graph.map @@ -1,3 +1,3 @@ - + diff --git a/d1/d8d/struct_a_v_lnode__coll__graph.svg b/d1/d8d/struct_a_v_lnode__coll__graph.svg index 5765a00bc..9f1e325e0 100644 --- a/d1/d8d/struct_a_v_lnode__coll__graph.svg +++ b/d1/d8d/struct_a_v_lnode__coll__graph.svg @@ -1,30 +1,30 @@ - - + AVLnode - + Node1 - -AVLnode + +AVLnode Node1->Node1 - - - left -right + + + left +right diff --git a/d1/d94/odd__even__sort_8c.html b/d1/d94/odd__even__sort_8c.html new file mode 100644 index 000000000..f76429890 --- /dev/null +++ b/d1/d94/odd__even__sort_8c.html @@ -0,0 +1,349 @@ + + + + + + + +Algorithms_in_C: sorting/odd_even_sort.c File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Algorithms_in_C 1.0.0 +
+
Set of algorithms implemented in C.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
odd_even_sort.c File Reference
+
+
+ +

Odd Even Sort implementation +More...

+
#include <assert.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+#include <inttypes.h>
+
+Include dependency graph for odd_even_sort.c:
+
+
+
+
+
+ + + + + + + + + + + + + +

+Functions

void swap (int32_t *first, int32_t *second)
 for assert More...
 
void oddEvenSort (int *arr, int size)
 oddEvenSort sorts the array using the algorithm described above. More...
 
static void test ()
 Self-test implementations. More...
 
int main ()
 Main function. More...
 
+

Detailed Description

+

Odd Even Sort implementation

+
Author
Edwin Ajong
+

This algorithm is divided into two phases- Odd and Even Phase. The algorithm runs until the array elements are sorted and in each iteration two phases occurs- Odd and Even Phases. In the odd phase, we perform a bubble sort on odd indexed elements and in the even phase, we perform a bubble sort on even indexed elements. Time Complexity: O(N ^ 2)

+

Function Documentation

+ +

◆ main()

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

Main function.

+
Returns
0 on exit
+
117{
+
118 test(); // run self-test implementations
+
119 return 0;
+
120}
+
static void test()
Self-test implementations.
Definition: odd_even_sort.c:90
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ oddEvenSort()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void oddEvenSort (int * arr,
int size 
)
+
+ +

oddEvenSort sorts the array using the algorithm described above.

+

A boolean varaible(isSorted) is declared and initialised to "false". In the while loop, the variable(isSorted) is then set to "true". During even phase the for loop loops through the array, touching just the even indexes. i.e arr[0], arr[2], arr[4] and so on. While during the odd phase, the for loop loops through the array, touching just the odd indexes. i.e arr[1], arr[3], arr[5] and so on. During these phases, if the if statement check if the interger at the current position in the array is greater than the interger at the next array index (i.e arr[index + 2], to make sure the index is odd during the odd phase and even during the even phase). If the condition is true, the function "swap" is called and address of the intergers in question are passed as parameters. After the swap is completed, "isSorted" is set to "false". The while loop will keep running till the array is propertly sorted.

Parameters
+ + + +
arrarray to be sorted
sizethe size of the array
+
+
+
Returns
void
+
53{
+
54 bool isSorted = false;
+
55 while(!isSorted)
+
56 {
+
57 isSorted = true;
+
58 int32_t i;
+
59
+
60 // Even phase
+
61 for(i = 0; i <= size - 2; i += 2)
+
62 {
+
63 if(arr[i] > arr[i + 1])
+
64 {
+
65 swap(&arr[i], &arr[i + 1]);
+
66 isSorted = false;
+
67 }
+
68 }
+
69
+
70 // Odd phase
+
71 for(i = 1; i <= size - 2; i += 2)
+
72 {
+
73 if(arr[i] > arr[i + 1])
+
74 {
+
75 swap(&arr[i], &arr[i + 1]);
+
76 isSorted = false;
+
77 }
+
78 }
+
79 }
+
80}
+
void swap(int32_t *first, int32_t *second)
for assert
Definition: odd_even_sort.c:26
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ swap()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void swap (int32_t * first,
int32_t * second 
)
+
+ +

for assert

+

for bool for IO operations for dynammic memory allocation for random number generation for int32_t types

+

Swap numbers by reference(using pointers)

Parameters
+ + + +
firstpointer to first number
secondpointer to second number
+
+
+
Returns
void
+
27{
+
28 int32_t temp = *first;
+
29 *first = *second;
+
30 *second = temp;
+
31}
+
+
+
+ +

◆ test()

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

Self-test implementations.

+

Two tests (unsorted) arrays were created and their corresponding solution(sorted) arrays were also created. The test arrays and their respective sizes are then passed in to the oddEvenSort function. To test if the algorithm works, a for loop is assigned to loop through the both arrays(test and solution) and check if the array elements of the test array correspond to the elements of the solution array.

Returns
void
+
91{
+
92 int32_t arr1[] = {-9, 2, 3, 1};
+
93 int32_t arr1Soln[] = {-9, 1, 2, 3};
+
94 int32_t arr2[] = {9, 7, 5, 3, 8, 2, 1, 4, 0, 6};
+
95 int32_t arr2Soln[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
+
96
+
97 oddEvenSort(arr1, 4);
+
98 oddEvenSort(arr2, 10);
+
99
+
100 for (int32_t i = 0; i < 4; i++)
+
101 {
+
102 assert(arr1[i] == arr1Soln[i]);
+
103 }
+
104
+
105 for (int32_t i = 0; i < 10; i++)
+
106 {
+
107 assert(arr2[i] == arr2Soln[i]);
+
108 }
+
109 printf("All tests have passed!\n");
+
110}
+
void oddEvenSort(int *arr, int size)
oddEvenSort sorts the array using the algorithm described above.
Definition: odd_even_sort.c:52
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+
+
+ + + + diff --git a/d1/d94/odd__even__sort_8c.js b/d1/d94/odd__even__sort_8c.js new file mode 100644 index 000000000..f8917f8e8 --- /dev/null +++ b/d1/d94/odd__even__sort_8c.js @@ -0,0 +1,7 @@ +var odd__even__sort_8c = +[ + [ "main", "d1/d94/odd__even__sort_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], + [ "oddEvenSort", "d1/d94/odd__even__sort_8c.html#a17761a0788916faded6e2ca1f478ad33", null ], + [ "swap", "d1/d94/odd__even__sort_8c.html#ac2eee54959bc040cfcb56d2d8047853a", null ], + [ "test", "d1/d94/odd__even__sort_8c.html#aa8dca7b867074164d5f45b0f3851269d", null ] +]; \ No newline at end of file diff --git a/d1/d94/odd__even__sort_8c_a17761a0788916faded6e2ca1f478ad33_cgraph.map b/d1/d94/odd__even__sort_8c_a17761a0788916faded6e2ca1f478ad33_cgraph.map new file mode 100644 index 000000000..2e8a250f2 --- /dev/null +++ b/d1/d94/odd__even__sort_8c_a17761a0788916faded6e2ca1f478ad33_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/d1/d94/odd__even__sort_8c_a17761a0788916faded6e2ca1f478ad33_cgraph.md5 b/d1/d94/odd__even__sort_8c_a17761a0788916faded6e2ca1f478ad33_cgraph.md5 new file mode 100644 index 000000000..ec755d2ea --- /dev/null +++ b/d1/d94/odd__even__sort_8c_a17761a0788916faded6e2ca1f478ad33_cgraph.md5 @@ -0,0 +1 @@ +4b858138ff80dc7af6ca2522cdbd7bbd \ No newline at end of file diff --git a/d1/d94/odd__even__sort_8c_a17761a0788916faded6e2ca1f478ad33_cgraph.svg b/d1/d94/odd__even__sort_8c_a17761a0788916faded6e2ca1f478ad33_cgraph.svg new file mode 100644 index 000000000..8423492af --- /dev/null +++ b/d1/d94/odd__even__sort_8c_a17761a0788916faded6e2ca1f478ad33_cgraph.svg @@ -0,0 +1,37 @@ + + + + + + +oddEvenSort + + + +Node1 + + +oddEvenSort + + + + + +Node2 + + +swap + + + + + +Node1->Node2 + + + + + diff --git a/d1/d94/odd__even__sort_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map b/d1/d94/odd__even__sort_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map new file mode 100644 index 000000000..e35db6ecf --- /dev/null +++ b/d1/d94/odd__even__sort_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/d1/d94/odd__even__sort_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 b/d1/d94/odd__even__sort_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 new file mode 100644 index 000000000..8f0a2e703 --- /dev/null +++ b/d1/d94/odd__even__sort_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 @@ -0,0 +1 @@ +7d5c1e402ed21ca64b904c7dd6e435ca \ No newline at end of file diff --git a/d1/d94/odd__even__sort_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/d1/d94/odd__even__sort_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg new file mode 100644 index 000000000..06ca8e8b4 --- /dev/null +++ b/d1/d94/odd__even__sort_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg @@ -0,0 +1,52 @@ + + + + + + +test + + + +Node1 + + +test + + + + + +Node2 + + +oddEvenSort + + + + + +Node1->Node2 + + + + + +Node3 + + +swap + + + + + +Node2->Node3 + + + + + diff --git a/d1/d94/odd__even__sort_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d1/d94/odd__even__sort_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..4d436bbf7 --- /dev/null +++ b/d1/d94/odd__even__sort_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/d1/d94/odd__even__sort_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d1/d94/odd__even__sort_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..24d3ca5ba --- /dev/null +++ b/d1/d94/odd__even__sort_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +d9737c9a38e2d635e4d3110f765e78c2 \ No newline at end of file diff --git a/d1/d94/odd__even__sort_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d1/d94/odd__even__sort_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..58a0237c4 --- /dev/null +++ b/d1/d94/odd__even__sort_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,67 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +test + + + + + +Node1->Node2 + + + + + +Node3 + + +oddEvenSort + + + + + +Node2->Node3 + + + + + +Node4 + + +swap + + + + + +Node3->Node4 + + + + + diff --git a/d1/d98/tcp__full__duplex__client_8c.html b/d1/d98/tcp__full__duplex__client_8c.html new file mode 100644 index 000000000..27bc11a99 --- /dev/null +++ b/d1/d98/tcp__full__duplex__client_8c.html @@ -0,0 +1,371 @@ + + + + + + + +Algorithms_in_C: client_server/tcp_full_duplex_client.c File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Algorithms_in_C 1.0.0 +
+
Set of algorithms implemented in C.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
tcp_full_duplex_client.c File Reference
+
+
+ +

Client-side implementation of TCP Full Duplex Communication +More...

+
#include <arpa/inet.h>
+#include <netdb.h>
+#include <netinet/in.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+Include dependency graph for tcp_full_duplex_client.c:
+
+
+
+
+
+ + + + +

+Macros

#define PORT   10000
 For the type in_addr_t and in_port_t. More...
 
+ + + + + + + +

+Functions

void error ()
 Utility function used to print an error message to stderr. More...
 
int main ()
 Main function. More...
 
+

Detailed Description

+

Client-side implementation of TCP Full Duplex Communication

+
Author
NVombat
+
See also
tcp_full_duplex_server.c
+

The algorithm is based on the simple TCP client and server model. However, instead of the server only sending and the client only receiving data, The server and client can both send and receive data simultaneously. This is implemented by using the fork function call so that in the server the child process can recieve data and parent process can send data, and in the client the child process can send data and the parent process can receive data. It runs an infinite loop and can send and receive messages indefinitely until the user exits the loop. In this way, the Full Duplex Form of communication can be represented using the TCP server-client model & socket programming

+

Macro Definition Documentation

+ +

◆ PORT

+ +
+
+ + + + +
#define PORT   10000
+
+ +

For the type in_addr_t and in_port_t.

+

For structures returned by the network database library - formatted internet addresses and port numbers For in_addr and sockaddr_in structures For specific bit size values of variables Variable types, several macros, and various functions for performing input and output Variable types, several macros, and various functions for performing general functions Various functions for manipulating arrays of characters For macro definitions related to the creation of sockets For definitions to allow for the porting of BSD programs For miscellaneous symbolic constants and types, and miscellaneous functions

+ +
+
+

Function Documentation

+ +

◆ error()

+ +
+
+ + + + + + + +
void error ()
+
+ +

Utility function used to print an error message to stderr.

+

It prints str and an implementation-defined error message corresponding to the global variable errno.

Returns
void
+
40{
+
41 perror("Socket Creation Failed");
+
42 exit(EXIT_FAILURE);
+
43}
+
+
+
+ +

◆ main()

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

Main function.

+
Returns
0 on exit
+

Variable Declarations

+

< socket descriptors - Like file handles but for sockets

+

< character arrays to read and store string data for communication

+

< asic structures for all syscalls and functions that deal with internet addresses. Structures for handling internet addresses

+

The TCP socket is created using the socket function.

+

AF_INET (Family) - it is an address family that is used to designate the type of addresses that your socket can communicate with

+

SOCK_STREAM (Type) - Indicates TCP Connection - A stream socket provides for the bidirectional, reliable, sequenced, and unduplicated flow of data without record boundaries. Aside from the bidirectionality of data flow, a pair of connected stream sockets provides an interface nearly identical to pipes.

+

0 (Protocol) - Specifies a particular protocol to be used with the socket. Specifying a protocol of 0 causes socket() to use an unspecified default protocol appropriate for the requested socket type.

+

Server Address Information

+

The bzero() function erases the data in the n bytes of the memory starting at the location pointed to, by writing zeros (bytes containing '\0') to that area.

+

We bind the server_addr to the internet address and port number thus giving our socket an identity with an address and port where it can listen for connections

+

htons - The htons() function translates a short integer from host byte order to network byte order

+

htonl - The htonl() function translates a long integer from host byte order to network byte order

+

These functions are necessary so that the binding of address and port takes place with data in the correct format

+

Connects the client to the server address using the socket descriptor This enables the two to communicate and exchange data

+

Communication between client and server

+

The bzero() function erases the data in the n bytes of the memory starting at the location pointed to, by writing zeros (bytes containing '\0') to that area. The variables are emptied and then ready for use

+

The fork function call is used to create a child and parent process which run and execute code simultaneously

+

The child process is used to send data and after doing so sleeps for 5 seconds to wait for the parent to receive data

+

The parent process is used to receive data and after doing so sleeps for 5 seconds to wait for the child to send data

+

The server and client can communicate indefinitely till one of them exits the connection

+

Since the exchange of information between the server and client takes place simultaneously this represents FULL DUPLEX COMMUNICATION

+

Value of 0 is for child process

+

Parent Process

+

Close Socket

+
50{
+
51 /** Variable Declarations */
+
52 uint32_t
+
53 sockfd; ///< socket descriptors - Like file handles but for sockets
+
54 char sendbuff[1024],
+
55 recvbuff[1024]; ///< character arrays to read and store string data
+
56 /// for communication
+
57
+
58 struct sockaddr_in
+
59 server_addr; ///< asic structures for all syscalls and functions that
+
60 /// deal with internet addresses. Structures for handling
+
61 /// internet addresses
+
62
+
63 /**
+
64 * The TCP socket is created using the socket function.
+
65 *
+
66 * AF_INET (Family) - it is an address family that is used to designate the
+
67 * type of addresses that your socket can communicate with
+
68 *
+
69 * SOCK_STREAM (Type) - Indicates TCP Connection - A stream socket provides
+
70 * for the bidirectional, reliable, sequenced, and unduplicated flow of data
+
71 * without record boundaries. Aside from the bidirectionality of data flow,
+
72 * a pair of connected stream sockets provides an interface nearly identical
+
73 * to pipes.
+
74 *
+
75 * 0 (Protocol) - Specifies a particular protocol to be used with the
+
76 * socket. Specifying a protocol of 0 causes socket() to use an unspecified
+
77 * default protocol appropriate for the requested socket type.
+
78 */
+
79 if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
+
80 {
+
81 error();
+
82 }
+
83
+
84 /**
+
85 * Server Address Information
+
86 *
+
87 * The bzero() function erases the data in the n bytes of the memory
+
88 * starting at the location pointed to, by writing zeros (bytes
+
89 * containing '\0') to that area.
+
90 *
+
91 * We bind the server_addr to the internet address and port number thus
+
92 * giving our socket an identity with an address and port where it can
+
93 * listen for connections
+
94 *
+
95 * htons - The htons() function translates a short integer from host byte
+
96 * order to network byte order
+
97 *
+
98 * htonl - The htonl() function translates a long integer from host byte
+
99 * order to network byte order
+
100 *
+
101 * These functions are necessary so that the binding of address and port
+
102 * takes place with data in the correct format
+
103 */
+
104 bzero(&server_addr, sizeof(server_addr));
+
105 server_addr.sin_family = AF_INET;
+
106 server_addr.sin_port = htons(PORT);
+
107 server_addr.sin_addr.s_addr = htonl(INADDR_ANY);
+
108
+
109 printf("Client is running...\n");
+
110
+
111 /**
+
112 * Connects the client to the server address using the socket descriptor
+
113 * This enables the two to communicate and exchange data
+
114 */
+
115 connect(sockfd, (struct sockaddr *)&server_addr, sizeof(server_addr));
+
116
+
117 printf("Client is connected...\n");
+
118
+
119 /**
+
120 * Communication between client and server
+
121 *
+
122 * The bzero() function erases the data in the n bytes of the memory
+
123 * starting at the location pointed to, by writing zeros (bytes
+
124 * containing '\0') to that area. The variables are emptied and then
+
125 * ready for use
+
126 *
+
127 * The fork function call is used to create a child and parent process
+
128 * which run and execute code simultaneously
+
129 *
+
130 * The child process is used to send data and after doing so
+
131 * sleeps for 5 seconds to wait for the parent to receive data
+
132 *
+
133 * The parent process is used to receive data and after doing so
+
134 * sleeps for 5 seconds to wait for the child to send data
+
135 *
+
136 * The server and client can communicate indefinitely till one of them
+
137 * exits the connection
+
138 *
+
139 * Since the exchange of information between the server and client takes
+
140 * place simultaneously this represents FULL DUPLEX COMMUNICATION
+
141 */
+
142 pid_t pid;
+
143 pid = fork();
+
144 if (pid == 0) /// Value of 0 is for child process
+
145 {
+
146 while (1)
+
147 {
+
148 bzero(&sendbuff, sizeof(sendbuff));
+
149 printf("\nType message here: ");
+
150 fgets(sendbuff, 1024, stdin);
+
151 send(sockfd, sendbuff, strlen(sendbuff) + 1, 0);
+
152 printf("\nMessage sent!\n");
+
153 sleep(5);
+
154 // break;
+
155 }
+
156 }
+
157 else /// Parent Process
+
158 {
+
159 while (1)
+
160 {
+
161 bzero(&recvbuff, sizeof(recvbuff));
+
162 recv(sockfd, recvbuff, sizeof(recvbuff), 0);
+
163 printf("\nSERVER: %s\n", recvbuff);
+
164 sleep(5);
+
165 // break;
+
166 }
+
167 }
+
168
+
169 /// Close Socket
+
170 close(sockfd);
+
171 printf("Client is offline...\n");
+
172 return 0;
+
173}
+
PID Controller.
Definition: pid.c:31
+
#define PORT
For the type in_addr_t and in_port_t.
Definition: tcp_full_duplex_client.c:31
+
void error()
Utility function used to print an error message to stderr.
Definition: tcp_full_duplex_client.c:39
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+
+
+ + + + diff --git a/d1/d98/tcp__full__duplex__client_8c.js b/d1/d98/tcp__full__duplex__client_8c.js new file mode 100644 index 000000000..dcf6404b2 --- /dev/null +++ b/d1/d98/tcp__full__duplex__client_8c.js @@ -0,0 +1,6 @@ +var tcp__full__duplex__client_8c = +[ + [ "PORT", "d1/d98/tcp__full__duplex__client_8c.html#a614217d263be1fb1a5f76e2ff7be19a2", null ], + [ "error", "d1/d98/tcp__full__duplex__client_8c.html#a7e15c8e2885871839fc2b820dfbdb4ce", null ], + [ "main", "d1/d98/tcp__full__duplex__client_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/d1/d98/tcp__full__duplex__client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d1/d98/tcp__full__duplex__client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..7f643ddeb --- /dev/null +++ b/d1/d98/tcp__full__duplex__client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/d1/d98/tcp__full__duplex__client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d1/d98/tcp__full__duplex__client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..e7f3540fe --- /dev/null +++ b/d1/d98/tcp__full__duplex__client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +2378b6c12221f5fed8bbdfb3f8d94f63 \ No newline at end of file diff --git a/d1/d98/tcp__full__duplex__client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d1/d98/tcp__full__duplex__client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..c3cdc10bf --- /dev/null +++ b/d1/d98/tcp__full__duplex__client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,37 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +error + + + + + +Node1->Node2 + + + + + diff --git a/d1/d99/structcluster.html b/d1/d99/structcluster.html index 15abdad98..cf2864cca 100644 --- a/d1/d99/structcluster.html +++ b/d1/d99/structcluster.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: cluster 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() {
@@ -92,28 +92,27 @@ $(document).ready(function(){initNavTree('d1/d99/structcluster.html','../../');
- - + - + - +

+

Data Fields

-double x
+double x
 abscissa centroid of this cluster
 
-double y
+double y
 ordinate of centroid of this cluster
 
-size_t count
+size_t count
 count of observations present in this cluster
 

Detailed Description

-

this class stores the coordinates of centroid of all the points in that cluster it also stores the count of observations belonging to this cluster

+

this class stores the coordinates of centroid of all the points in that cluster it also stores the count of observations belonging to this cluster


The documentation for this struct was generated from the following file: @@ -123,7 +122,7 @@ size_t 
    - +
diff --git a/d1/dac/doubly__linked__list_8c__incl.map b/d1/dac/doubly__linked__list_8c__incl.map index a0c7fa7e7..6a59c7a0a 100644 --- a/d1/dac/doubly__linked__list_8c__incl.map +++ b/d1/dac/doubly__linked__list_8c__incl.map @@ -1,5 +1,5 @@ - - - + + + diff --git a/d1/dac/doubly__linked__list_8c__incl.svg b/d1/dac/doubly__linked__list_8c__incl.svg index 541a59a34..82dbbdf19 100644 --- a/d1/dac/doubly__linked__list_8c__incl.svg +++ b/d1/dac/doubly__linked__list_8c__incl.svg @@ -1,21 +1,21 @@ - - + data_structures/linked_list/doubly_linked_list.c - + Node1 - + data_structures/linked -_list/doubly_linked_list.c +_list/doubly_linked_list.c @@ -23,31 +23,31 @@ Node2 - -stdio.h + +stdio.h Node1->Node2 - - + + Node3 - -stdlib.h + +stdlib.h Node1->Node3 - - + + diff --git a/d1/dba/decimal__to__any__base_8c.html b/d1/dba/decimal__to__any__base_8c.html new file mode 100644 index 000000000..bf8fce9b6 --- /dev/null +++ b/d1/dba/decimal__to__any__base_8c.html @@ -0,0 +1,507 @@ + + + + + + + +Algorithms_in_C: conversions/decimal_to_any_base.c File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Algorithms_in_C 1.0.0 +
+
Set of algorithms implemented in C.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
decimal_to_any_base.c File Reference
+
+
+ +

Decimal to any-base is a C function wich convert positive decimal integer to any positive ascii base with the base's alphabet given in input and return it in a dynamically allocated string(recursive way) +More...

+
#include <stdio.h>
+#include <string.h>
+#include <stdint.h>
+#include <stdbool.h>
+#include <assert.h>
+#include <stdlib.h>
+
+Include dependency graph for decimal_to_any_base.c:
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + +

+Functions

bool isbad_alphabet (const char *alphabet)
 for IO operations More...
 
uint64_t converted_len (uint64_t nb, short base)
 Calculate the final length of the converted number. More...
 
void convertion (uint64_t nb, const char *alphabet, short base, char *converted)
 Convert positive decimal integer into anybase recursively. More...
 
char * decimal_to_anybase (uint64_t nb, const char *alphabet)
 decimal_to_anybase ensure the validity of the parameters and convert any unsigned integers into any ascii positive base More...
 
static void test ()
 Self-test implementations. More...
 
int main ()
 Main function. More...
 
+

Detailed Description

+

Decimal to any-base is a C function wich convert positive decimal integer to any positive ascii base with the base's alphabet given in input and return it in a dynamically allocated string(recursive way)

+
Author
jucollet972
+

Function Documentation

+ +

◆ converted_len()

+ +
+
+ + + + + + + + + + + + + + + + + + +
uint64_t converted_len (uint64_t nb,
short base 
)
+
+ +

Calculate the final length of the converted number.

+
Parameters
+ + + +
nbto convert
basecalculated from alphabet
+
+
+
Returns
Converted nb string length
+
42 {
+
43 /* Counting the number of characters translated to the base*/
+
44 if (nb > base - 1) {
+
45 return (converted_len(nb/base, base) + 1);
+
46 }
+
47 return 1;
+
48}
+
uint64_t converted_len(uint64_t nb, short base)
Calculate the final length of the converted number.
Definition: decimal_to_any_base.c:42
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ convertion()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void convertion (uint64_t nb,
const char * alphabet,
short base,
char * converted 
)
+
+ +

Convert positive decimal integer into anybase recursively.

+
Parameters
+ + + + + +
nbto convert
alphabetinputed by user used for base convertion
basecalculated from alphabet
convertedstring filled with the convertion's result
+
+
+
Returns
void
+
58 {
+
59 /* Recursive convertion */
+
60 *(converted) = *(alphabet + nb%base);
+
61 if (nb > base - 1) {
+
62 convertion(nb/base, alphabet, base, --converted);
+
63 }
+
64}
+
void convertion(uint64_t nb, const char *alphabet, short base, char *converted)
Convert positive decimal integer into anybase recursively.
Definition: decimal_to_any_base.c:58
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ decimal_to_anybase()

+ +
+
+ + + + + + + + + + + + + + + + + + +
char * decimal_to_anybase (uint64_t nb,
const char * alphabet 
)
+
+ +

decimal_to_anybase ensure the validity of the parameters and convert any unsigned integers into any ascii positive base

+
Parameters
+ + + +
nbto convert
base'salphabet
+
+
+
Returns
nb converted on success
+
+NULL on error
+
73 {
+
74 char* converted;
+
75
+
76 /* Verify that alphabet is valid */
+
77 if (isbad_alphabet(alphabet)) {
+
78 return NULL;
+
79 }
+
80 /* Convertion */
+
81 uint64_t base = strlen(alphabet);
+
82 uint64_t final_len = converted_len(nb, base);
+
83 converted = malloc(sizeof(char) * (final_len + 1));
+
84 converted[final_len] = 0;
+
85 convertion(nb, alphabet, base, converted + final_len - 1);
+
86 return converted;
+
87}
+
bool isbad_alphabet(const char *alphabet)
for IO operations
Definition: decimal_to_any_base.c:20
+
#define malloc(bytes)
This macro replace the standard malloc function with malloc_dbg.
Definition: malloc_dbg.h:18
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ isbad_alphabet()

+ +
+
+ + + + + + + + +
bool isbad_alphabet (const char * alphabet)
+
+ +

for IO operations

+

for strchr and strlen for CPU arch's optimized int types for boolean types for assert for malloc and free

+

Checking if alphabet is valid

Parameters
+ + +
basealphabet inputed by user
+
+
+
Returns
int64_t as success or not
+
20 {
+
21 uint64_t len = strlen(alphabet);
+
22
+
23 /* Checking th lenght */
+
24 if (len < 2) {
+
25 return true;
+
26 }
+
27 /* Browse the alphabet */
+
28 for (int i = 0; i < len ; i++) {
+
29 /* Searching for duplicates */
+
30 if (strchr(alphabet + i + 1, alphabet[i]))
+
31 return true;
+
32 }
+
33 return false;
+
34}
+
+
+
+ +

◆ main()

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

Main function.

+
Returns
0 on exit
+
166{
+
167 test(); // run self-test implementations
+
168 return 0;
+
169}
+
static void test()
Self-test implementations.
Definition: decimal_to_any_base.c:94
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ test()

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

Self-test implementations.

+
Returns
void
+
95{
+
96 char* ret = NULL;
+
97 char* reference = NULL;
+
98
+
99 /* min dec*/
+
100 reference = "0";
+
101 ret = decimal_to_anybase(0, "0123456789");
+
102 for (int i = 0; i < strlen(reference) && i < strlen(ret); i++) {
+
103 assert(ret[i] == reference[i]);
+
104 }
+
105 if (ret != NULL) {
+
106 free(ret);
+
107 }
+
108
+
109 /* max dec*/
+
110 reference = "18446744073709551615";
+
111 ret = decimal_to_anybase(18446744073709551615, "0123456789");
+
112 for (int i = 0; i < strlen(reference) && i < strlen(ret); i++) {
+
113 assert(ret[i] == reference[i]);
+
114 }
+
115 if (ret != NULL) {
+
116 free(ret);
+
117 }
+
118
+
119 /* negative dec*/
+
120 reference = "18446744073709551615";
+
121 ret = decimal_to_anybase(-1, "0123456789");
+
122 for (int i = 0; i < strlen(reference) && i < strlen(ret); i++) {
+
123 assert(ret[i] == reference[i]);
+
124 }
+
125 if (ret != NULL) {
+
126 free(ret);
+
127 }
+
128
+
129 /* bin */
+
130 reference = "101010";
+
131 ret = decimal_to_anybase(42, "01");
+
132 for (int i = 0; i < strlen(reference) && i < strlen(ret); i++) {
+
133 assert(ret[i] == reference[i]);
+
134 }
+
135 if (ret != NULL) {
+
136 free(ret);
+
137 }
+
138
+
139 /* octal */
+
140 reference = "52";
+
141 ret = decimal_to_anybase(42, "01234567");
+
142 for (int i = 0; i < strlen(reference) && i < strlen(ret); i++) {
+
143 assert(ret[i] == reference[i]);
+
144 }
+
145 if (ret != NULL) {
+
146 free(ret);
+
147 }
+
148
+
149 /* hexa */
+
150 reference = "2A";
+
151 ret = decimal_to_anybase(42, "0123456789ABCDEF");
+
152 for (int i = 0; i < strlen(reference) && i < strlen(ret); i++) {
+
153 assert(ret[i] == reference[i]);
+
154 }
+
155 if (ret != NULL) {
+
156 free(ret);
+
157 }
+
158 printf("[+] All tests have successfully passed!\n");
+
159}
+
char * decimal_to_anybase(uint64_t nb, const char *alphabet)
decimal_to_anybase ensure the validity of the parameters and convert any unsigned integers into any a...
Definition: decimal_to_any_base.c:73
+
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+
+
+ + + + diff --git a/d1/dba/decimal__to__any__base_8c.js b/d1/dba/decimal__to__any__base_8c.js new file mode 100644 index 000000000..0f540823b --- /dev/null +++ b/d1/dba/decimal__to__any__base_8c.js @@ -0,0 +1,9 @@ +var decimal__to__any__base_8c = +[ + [ "converted_len", "d1/dba/decimal__to__any__base_8c.html#a899b3a7e0f1fac5a465eac0d4b10d711", null ], + [ "convertion", "d1/dba/decimal__to__any__base_8c.html#a0c5ccb926a23bc0050f213ba3408e18d", null ], + [ "decimal_to_anybase", "d1/dba/decimal__to__any__base_8c.html#a3e4a7cfc97a528faa4d6e5741461109c", null ], + [ "isbad_alphabet", "d1/dba/decimal__to__any__base_8c.html#ae071f62d704823751bf9a085bf0a1bd7", null ], + [ "main", "d1/dba/decimal__to__any__base_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], + [ "test", "d1/dba/decimal__to__any__base_8c.html#aa8dca7b867074164d5f45b0f3851269d", null ] +]; \ No newline at end of file diff --git a/d1/dba/decimal__to__any__base_8c_a0c5ccb926a23bc0050f213ba3408e18d_cgraph.map b/d1/dba/decimal__to__any__base_8c_a0c5ccb926a23bc0050f213ba3408e18d_cgraph.map new file mode 100644 index 000000000..60d837426 --- /dev/null +++ b/d1/dba/decimal__to__any__base_8c_a0c5ccb926a23bc0050f213ba3408e18d_cgraph.map @@ -0,0 +1,3 @@ + + + diff --git a/d1/dba/decimal__to__any__base_8c_a0c5ccb926a23bc0050f213ba3408e18d_cgraph.md5 b/d1/dba/decimal__to__any__base_8c_a0c5ccb926a23bc0050f213ba3408e18d_cgraph.md5 new file mode 100644 index 000000000..8bb58868a --- /dev/null +++ b/d1/dba/decimal__to__any__base_8c_a0c5ccb926a23bc0050f213ba3408e18d_cgraph.md5 @@ -0,0 +1 @@ +5dee8518c1b5c7f5417468b992e9daf5 \ No newline at end of file diff --git a/d1/dba/decimal__to__any__base_8c_a0c5ccb926a23bc0050f213ba3408e18d_cgraph.svg b/d1/dba/decimal__to__any__base_8c_a0c5ccb926a23bc0050f213ba3408e18d_cgraph.svg new file mode 100644 index 000000000..33c532cf2 --- /dev/null +++ b/d1/dba/decimal__to__any__base_8c_a0c5ccb926a23bc0050f213ba3408e18d_cgraph.svg @@ -0,0 +1,28 @@ + + + + + + +convertion + + + +Node1 + + +convertion + + + + + +Node1->Node1 + + + + + diff --git a/d1/dba/decimal__to__any__base_8c_a3e4a7cfc97a528faa4d6e5741461109c_cgraph.map b/d1/dba/decimal__to__any__base_8c_a3e4a7cfc97a528faa4d6e5741461109c_cgraph.map new file mode 100644 index 000000000..ba3c44079 --- /dev/null +++ b/d1/dba/decimal__to__any__base_8c_a3e4a7cfc97a528faa4d6e5741461109c_cgraph.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/d1/dba/decimal__to__any__base_8c_a3e4a7cfc97a528faa4d6e5741461109c_cgraph.md5 b/d1/dba/decimal__to__any__base_8c_a3e4a7cfc97a528faa4d6e5741461109c_cgraph.md5 new file mode 100644 index 000000000..a71c25cf6 --- /dev/null +++ b/d1/dba/decimal__to__any__base_8c_a3e4a7cfc97a528faa4d6e5741461109c_cgraph.md5 @@ -0,0 +1 @@ +3b7f090bcbb1af4d0e284722216e6077 \ No newline at end of file diff --git a/d1/dba/decimal__to__any__base_8c_a3e4a7cfc97a528faa4d6e5741461109c_cgraph.svg b/d1/dba/decimal__to__any__base_8c_a3e4a7cfc97a528faa4d6e5741461109c_cgraph.svg new file mode 100644 index 000000000..11906b5b0 --- /dev/null +++ b/d1/dba/decimal__to__any__base_8c_a3e4a7cfc97a528faa4d6e5741461109c_cgraph.svg @@ -0,0 +1,79 @@ + + + + + + +decimal_to_anybase + + + +Node1 + + +decimal_to_anybase + + + + + +Node2 + + +converted_len + + + + + +Node1->Node2 + + + + + +Node3 + + +convertion + + + + + +Node1->Node3 + + + + + +Node4 + + +isbad_alphabet + + + + + +Node1->Node4 + + + + + +Node2->Node2 + + + + + +Node3->Node3 + + + + + diff --git a/d1/dba/decimal__to__any__base_8c_a899b3a7e0f1fac5a465eac0d4b10d711_cgraph.map b/d1/dba/decimal__to__any__base_8c_a899b3a7e0f1fac5a465eac0d4b10d711_cgraph.map new file mode 100644 index 000000000..a00dec3f5 --- /dev/null +++ b/d1/dba/decimal__to__any__base_8c_a899b3a7e0f1fac5a465eac0d4b10d711_cgraph.map @@ -0,0 +1,3 @@ + + + diff --git a/d1/dba/decimal__to__any__base_8c_a899b3a7e0f1fac5a465eac0d4b10d711_cgraph.md5 b/d1/dba/decimal__to__any__base_8c_a899b3a7e0f1fac5a465eac0d4b10d711_cgraph.md5 new file mode 100644 index 000000000..2a9316f3f --- /dev/null +++ b/d1/dba/decimal__to__any__base_8c_a899b3a7e0f1fac5a465eac0d4b10d711_cgraph.md5 @@ -0,0 +1 @@ +48327413eee7bcd14d5090db1c4bb382 \ No newline at end of file diff --git a/d1/dba/decimal__to__any__base_8c_a899b3a7e0f1fac5a465eac0d4b10d711_cgraph.svg b/d1/dba/decimal__to__any__base_8c_a899b3a7e0f1fac5a465eac0d4b10d711_cgraph.svg new file mode 100644 index 000000000..040f07033 --- /dev/null +++ b/d1/dba/decimal__to__any__base_8c_a899b3a7e0f1fac5a465eac0d4b10d711_cgraph.svg @@ -0,0 +1,28 @@ + + + + + + +converted_len + + + +Node1 + + +converted_len + + + + + +Node1->Node1 + + + + + diff --git a/d1/dba/decimal__to__any__base_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map b/d1/dba/decimal__to__any__base_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map new file mode 100644 index 000000000..34b886553 --- /dev/null +++ b/d1/dba/decimal__to__any__base_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/d1/dba/decimal__to__any__base_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 b/d1/dba/decimal__to__any__base_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 new file mode 100644 index 000000000..4436731cb --- /dev/null +++ b/d1/dba/decimal__to__any__base_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 @@ -0,0 +1 @@ +468b1a7e5e09e063dc7a6529083d0a04 \ No newline at end of file diff --git a/d1/dba/decimal__to__any__base_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/d1/dba/decimal__to__any__base_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg new file mode 100644 index 000000000..f297b82af --- /dev/null +++ b/d1/dba/decimal__to__any__base_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg @@ -0,0 +1,94 @@ + + + + + + +test + + + +Node1 + + +test + + + + + +Node2 + + +decimal_to_anybase + + + + + +Node1->Node2 + + + + + +Node3 + + +converted_len + + + + + +Node2->Node3 + + + + + +Node4 + + +convertion + + + + + +Node2->Node4 + + + + + +Node5 + + +isbad_alphabet + + + + + +Node2->Node5 + + + + + +Node3->Node3 + + + + + +Node4->Node4 + + + + + diff --git a/d1/dba/decimal__to__any__base_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d1/dba/decimal__to__any__base_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..155e4dae9 --- /dev/null +++ b/d1/dba/decimal__to__any__base_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/d1/dba/decimal__to__any__base_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d1/dba/decimal__to__any__base_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..5d86c04e5 --- /dev/null +++ b/d1/dba/decimal__to__any__base_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +ae14ee447134515f220f9351889240f7 \ No newline at end of file diff --git a/d1/dba/decimal__to__any__base_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d1/dba/decimal__to__any__base_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..ea4299a9e --- /dev/null +++ b/d1/dba/decimal__to__any__base_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,109 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +test + + + + + +Node1->Node2 + + + + + +Node3 + + +decimal_to_anybase + + + + + +Node2->Node3 + + + + + +Node4 + + +converted_len + + + + + +Node3->Node4 + + + + + +Node5 + + +convertion + + + + + +Node3->Node5 + + + + + +Node6 + + +isbad_alphabet + + + + + +Node3->Node6 + + + + + +Node4->Node4 + + + + + +Node5->Node5 + + + + + diff --git a/d1/dbe/include_8h_source.html b/d1/dbe/include_8h_source.html new file mode 100644 index 000000000..5a36482ed --- /dev/null +++ b/d1/dbe/include_8h_source.html @@ -0,0 +1,138 @@ + + + + + + + +Algorithms_in_C: data_structures/queue/include.h Source File + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Algorithms_in_C 1.0.0 +
+
Set of algorithms implemented in C.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
include.h
+
+
+
1//////////////////////////////////////////////////////////////////////////////////////
+
2/// INCLUDES
+
3
+
4#include <stdio.h>
+
5#include <stdlib.h>
+
6////////////////////////////////////////////////////////////////////////////////
+
7// DATA STRUCTURES
+
8/**
+
9 * Defining the structure of the node which contains 'data' (type : integer),
+
10 * two pointers 'next' and 'pre' (type : struct node).
+
11 */
+
12
+
13struct node
+
14{
+
15 int data;
+
16 struct node *next;
+
17 struct node *pre;
+
18} * head, *tail, *tmp;
+
19
+
20////////////////////////////////////////////////////////////////////////////////
+
21// FORWARD DECLARATIONS
+
22
+
23void create();
+
24void enque(int x);
+
25int deque();
+
26int peek();
+
27int size();
+
28int isEmpty();
+
List * create(double value)
Create list function, a new list containing one node will be created.
Definition: doubly_linked_list.c:92
+
int isEmpty(struct Stack s)
isEmpty function
Definition: infix_to_postfix.c:112
+
Node, the basic data structure in the tree.
Definition: binary_search_tree.c:15
+
int data
data of the node
Definition: binary_search_tree.c:18
+
+
+ + + + diff --git a/d1/dc2/ode__midpoint__euler_8c.html b/d1/dc2/ode__midpoint__euler_8c.html index 29c716bf5..148f25aad 100644 --- a/d1/dc2/ode__midpoint__euler_8c.html +++ b/d1/dc2/ode__midpoint__euler_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: numerical_methods/ode_midpoint_euler.c 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/dc2/ode__midpoint__euler_8c.html',' -
-
ode_midpoint_euler.c File Reference
+
ode_midpoint_euler.c File Reference
-

Solve a multivariable first order ordinary differential equation (ODEs) using midpoint Euler method +

Solve a multivariable first order ordinary differential equation (ODEs) using midpoint Euler method More...

#include <math.h>
#include <stdio.h>
@@ -111,14 +110,14 @@ Include dependency graph for ode_midpoint_euler.c:
- - +

+

Macros

-#define order   2
+#define order   2
 number of dependent variables in problem
 
- @@ -132,14 +131,13 @@ Functions - - + +

+

Functions

void problem (const double *x, double *y, double *dy)
 Problem statement for a system with first-order differential equations. More...
double midpoint_euler (double dx, double x0, double x_max, double *y, char save_to_file)
 Compute approximation using the midpoint-Euler method in the given limits. More...
 
-int main (int argc, char *argv[])
 Main Function.
int main (int argc, char *argv[])
 Main Function. More...
 

Detailed Description

-

Solve a multivariable first order ordinary differential equation (ODEs) using midpoint Euler method

-
Authors
Krishna Vedala
+

Solve a multivariable first order ordinary differential equation (ODEs) using midpoint 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*}

@@ -147,12 +145,12 @@ int 

-

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_forward_euler.c, ode_semi_implicit_euler.c

Function Documentation

- +

◆ exact_solution()

@@ -179,7 +177,7 @@ int 

Exact solution of the problem.

-

Used for solution comparison.

+

Used for solution comparison.

Parameters
@@ -187,14 +185,97 @@ int 
[in]xindependent variable
68 {
-
69  y[0] = cos(x[0]);
-
70  y[1] = -sin(x[0]);
-
71 }
+
68{
+
69 y[0] = cos(x[0]);
+
70 y[1] = -sin(x[0]);
+
71}
- + +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char * argv[] 
)
+
+ +

Main Function.

+
145{
+
146 double X0 = 0.f; /* initial value of x0 */
+
147 double X_MAX = 10.F; /* upper limit of integration */
+
148 double Y0[] = {1.f, 0.f}; /* initial value Y = y(x = x_0) */
+
149 double step_size;
+
150
+
151 if (argc == 1)
+
152 {
+
153 printf("\nEnter the step size: ");
+
154 scanf("%lg", &step_size);
+
155 }
+
156 else
+
157 // use commandline argument as independent variable step size
+
158 step_size = atof(argv[1]);
+
159
+
160 // get approximate solution
+
161 double total_time = midpoint_euler(step_size, X0, X_MAX, Y0, 1);
+
162 printf("\tTime = %.6g ms\n", total_time);
+
163
+
164 /* compute exact solution for comparion */
+
165 FILE *fp = fopen("exact.csv", "w+");
+
166 if (fp == NULL)
+
167 {
+
168 perror("Error! ");
+
169 return -1;
+
170 }
+
171 double x = X0;
+
172 double *y = &(Y0[0]);
+
173 printf("Finding exact solution\n");
+
174 clock_t t1 = clock();
+
175
+
176 do
+
177 {
+
178 fprintf(fp, "%.4g,%.4g,%.4g\n", x, y[0], y[1]); // write to file
+
179 exact_solution(&x, y);
+
180 x += step_size;
+
181 } while (x <= X_MAX);
+
182
+
183 clock_t t2 = clock();
+
184 total_time = (t2 - t1) / CLOCKS_PER_SEC;
+
185 printf("\tTime = %.6g ms\n", total_time);
+
186 fclose(fp);
+
187
+
188 return 0;
+
189}
+
double midpoint_euler(double dx, double x0, double x_max, double *y, char save_to_file)
Compute approximation using the midpoint-Euler method in the given limits.
Definition: ode_midpoint_euler.c:106
+
void exact_solution(const double *x, double *y)
Exact solution of the problem.
Definition: ode_midpoint_euler.c:67
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+

◆ midpoint_euler()

@@ -250,50 +331,50 @@ int 
Returns
time taken for computation in seconds
-
108 {
-
109  double dy[order];
-
110 
-
111  FILE *fp = NULL;
-
112  if (save_to_file)
-
113  {
-
114  fp = fopen("midpoint_euler.csv", "w+");
-
115  if (fp == NULL)
-
116  {
-
117  perror("Error! ");
-
118  return -1;
-
119  }
-
120  }
-
121 
-
122  /* start integration */
-
123  clock_t t1 = clock();
-
124  double x = x0;
-
125  do // iterate for each step of independent variable
-
126  {
-
127  if (save_to_file && fp)
-
128  fprintf(fp, "%.4g,%.4g,%.4g\n", x, y[0], y[1]); // write to file
-
129  midpoint_euler_step(dx, &x, y, dy); // perform integration
-
130  x += dx; // update step
-
131  } while (x <= x_max); // till upper limit of independent variable
-
132  /* end of integration */
-
133  clock_t t2 = clock();
-
134 
-
135  if (save_to_file && fp)
-
136  fclose(fp);
-
137 
-
138  return (double)(t2 - t1) / CLOCKS_PER_SEC;
-
139 }
+
108{
+
109 double dy[order];
+
110
+
111 FILE *fp = NULL;
+
112 if (save_to_file)
+
113 {
+
114 fp = fopen("midpoint_euler.csv", "w+");
+
115 if (fp == NULL)
+
116 {
+
117 perror("Error! ");
+
118 return -1;
+
119 }
+
120 }
+
121
+
122 /* start integration */
+
123 clock_t t1 = clock();
+
124 double x = x0;
+
125 do // iterate for each step of independent variable
+
126 {
+
127 if (save_to_file && fp)
+
128 fprintf(fp, "%.4g,%.4g,%.4g\n", x, y[0], y[1]); // write to file
+
129 midpoint_euler_step(dx, &x, y, dy); // perform integration
+
130 x += dx; // update step
+
131 } while (x <= x_max); // till upper limit of independent variable
+
132 /* end of integration */
+
133 clock_t t2 = clock();
+
134
+
135 if (save_to_file && fp)
+
136 fclose(fp);
+
137
+
138 return (double)(t2 - t1) / CLOCKS_PER_SEC;
+
139}
#define order
number of dependent variables in problem
Definition: ode_midpoint_euler.c:43
void midpoint_euler_step(double dx, double *x, double *y, double *dy)
Compute next step approximation using the midpoint-Euler method.
Definition: ode_midpoint_euler.c:83
Here is the call graph for this function:
-
+
- +

◆ midpoint_euler_step()

@@ -344,28 +425,28 @@ Here is the call graph for this function:
-
84 {
-
85  problem(x, y, dy);
-
86  double tmp_x = (*x) + 0.5 * dx;
-
87  double tmp_y[order];
-
88  int o;
-
89  for (o = 0; o < order; o++) tmp_y[o] = y[o] + 0.5 * dx * dy[o];
-
90 
-
91  problem(&tmp_x, tmp_y, dy);
-
92 
-
93  for (o = 0; o < order; o++) y[o] += dx * dy[o];
-
94 }
+
84{
+
85 problem(x, y, dy);
+
86 double tmp_x = (*x) + 0.5 * dx;
+
87 double tmp_y[order];
+
88 int o;
+
89 for (o = 0; o < order; o++) tmp_y[o] = y[o] + 0.5 * dx * dy[o];
+
90
+
91 problem(&tmp_x, tmp_y, dy);
+
92
+
93 for (o = 0; o < order; o++) y[o] += dx * dy[o];
+
94}
void problem(const double *x, double *y, double *dy)
Problem statement for a system with first-order differential equations.
Definition: ode_midpoint_euler.c:54
Here is the call graph for this function:
-
+
- +

◆ problem()

@@ -398,7 +479,7 @@ Here is the call graph for this function:

Problem statement for a system with first-order differential equations.

-

Updates the system differential variables.

Note
This function can be updated to and ode of any order.
+

Updates the system differential variables.

Note
This function can be updated to and ode of any order.
Parameters
@@ -407,11 +488,11 @@ Here is the call graph for this function:
[in]xindependent variable(s)
-
55 {
-
56  const double omega = 1.F; // some const for the problem
-
57  dy[0] = y[1]; // x dot
-
58  dy[1] = -omega * omega * y[0]; // y dot
-
59 }
+
55{
+
56 const double omega = 1.F; // some const for the problem
+
57 dy[0] = y[1]; // x dot
+
58 dy[1] = -omega * omega * y[0]; // y dot
+
59}
@@ -421,7 +502,7 @@ Here is the call graph for this function:
diff --git a/d1/dc2/ode__midpoint__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map b/d1/dc2/ode__midpoint__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map new file mode 100644 index 000000000..5139357ad --- /dev/null +++ b/d1/dc2/ode__midpoint__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/d1/dc2/ode__midpoint__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 b/d1/dc2/ode__midpoint__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 new file mode 100644 index 000000000..cac75c5f1 --- /dev/null +++ b/d1/dc2/ode__midpoint__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 @@ -0,0 +1 @@ +c04bfa678d88e71a65652a979429f133 \ No newline at end of file diff --git a/d1/dc2/ode__midpoint__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg b/d1/dc2/ode__midpoint__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg new file mode 100644 index 000000000..cab21d181 --- /dev/null +++ b/d1/dc2/ode__midpoint__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg @@ -0,0 +1,82 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +exact_solution + + + + + +Node1->Node2 + + + + + +Node3 + + +midpoint_euler + + + + + +Node1->Node3 + + + + + +Node4 + + +midpoint_euler_step + + + + + +Node3->Node4 + + + + + +Node5 + + +problem + + + + + +Node4->Node5 + + + + + diff --git a/d1/dc2/ode__midpoint__euler_8c_a148003d8b261d040c1c41e73b40af1dd_cgraph.map b/d1/dc2/ode__midpoint__euler_8c_a148003d8b261d040c1c41e73b40af1dd_cgraph.map index aa7e518e9..b8d166209 100644 --- a/d1/dc2/ode__midpoint__euler_8c_a148003d8b261d040c1c41e73b40af1dd_cgraph.map +++ b/d1/dc2/ode__midpoint__euler_8c_a148003d8b261d040c1c41e73b40af1dd_cgraph.map @@ -1,5 +1,5 @@ - - - + + + diff --git a/d1/dc2/ode__midpoint__euler_8c_a148003d8b261d040c1c41e73b40af1dd_cgraph.svg b/d1/dc2/ode__midpoint__euler_8c_a148003d8b261d040c1c41e73b40af1dd_cgraph.svg index e8f26edb8..09ea3f186 100644 --- a/d1/dc2/ode__midpoint__euler_8c_a148003d8b261d040c1c41e73b40af1dd_cgraph.svg +++ b/d1/dc2/ode__midpoint__euler_8c_a148003d8b261d040c1c41e73b40af1dd_cgraph.svg @@ -1,20 +1,20 @@ - - + midpoint_euler - + Node1 - -midpoint_euler + +midpoint_euler @@ -22,31 +22,31 @@ Node2 - -midpoint_euler_step + +midpoint_euler_step Node1->Node2 - - + + Node3 - -problem + +problem Node2->Node3 - - + + diff --git a/d1/dc2/ode__midpoint__euler_8c_affe6cc2ab040b94a29e6c41782f72d51_cgraph.map b/d1/dc2/ode__midpoint__euler_8c_affe6cc2ab040b94a29e6c41782f72d51_cgraph.map index f21c8a3f8..c961542fc 100644 --- a/d1/dc2/ode__midpoint__euler_8c_affe6cc2ab040b94a29e6c41782f72d51_cgraph.map +++ b/d1/dc2/ode__midpoint__euler_8c_affe6cc2ab040b94a29e6c41782f72d51_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/d1/dc2/ode__midpoint__euler_8c_affe6cc2ab040b94a29e6c41782f72d51_cgraph.svg b/d1/dc2/ode__midpoint__euler_8c_affe6cc2ab040b94a29e6c41782f72d51_cgraph.svg index 1584ee767..395e1d22d 100644 --- a/d1/dc2/ode__midpoint__euler_8c_affe6cc2ab040b94a29e6c41782f72d51_cgraph.svg +++ b/d1/dc2/ode__midpoint__euler_8c_affe6cc2ab040b94a29e6c41782f72d51_cgraph.svg @@ -1,20 +1,20 @@ - - + midpoint_euler_step - + Node1 - -midpoint_euler_step + +midpoint_euler_step @@ -22,16 +22,16 @@ Node2 - -problem + +problem Node1->Node2 - - + + diff --git a/d1/dd3/problem__401_2sol1_8c__incl.map b/d1/dd3/problem__401_2sol1_8c__incl.map index c422ee503..18801fa7f 100644 --- a/d1/dd3/problem__401_2sol1_8c__incl.map +++ b/d1/dd3/problem__401_2sol1_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/d1/dd3/problem__401_2sol1_8c__incl.svg b/d1/dd3/problem__401_2sol1_8c__incl.svg index ef62bdd0a..9140b880e 100644 --- a/d1/dd3/problem__401_2sol1_8c__incl.svg +++ b/d1/dd3/problem__401_2sol1_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - -project_euler/problem + +project_euler/problem _401/sol1.c diff --git a/d1/de4/infix__to__postfix2_8c__incl.map b/d1/de4/infix__to__postfix2_8c__incl.map new file mode 100644 index 000000000..0f28888a5 --- /dev/null +++ b/d1/de4/infix__to__postfix2_8c__incl.map @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/d1/de4/infix__to__postfix2_8c__incl.md5 b/d1/de4/infix__to__postfix2_8c__incl.md5 new file mode 100644 index 000000000..c1e804d67 --- /dev/null +++ b/d1/de4/infix__to__postfix2_8c__incl.md5 @@ -0,0 +1 @@ +9b3ebc7aa3e40767194b48a35cc95b68 \ No newline at end of file diff --git a/d1/de4/infix__to__postfix2_8c__incl.svg b/d1/de4/infix__to__postfix2_8c__incl.svg new file mode 100644 index 000000000..233f535b8 --- /dev/null +++ b/d1/de4/infix__to__postfix2_8c__incl.svg @@ -0,0 +1,113 @@ + + + + + + +conversions/infix_to_postfix2.c + + + +Node1 + + +conversions/infix_to +_postfix2.c + + + + + +Node2 + + +stdio.h + + + + + +Node1->Node2 + + + + + +Node3 + + +string.h + + + + + +Node1->Node3 + + + + + +Node4 + + +ctype.h + + + + + +Node1->Node4 + + + + + +Node5 + + +stdlib.h + + + + + +Node1->Node5 + + + + + +Node6 + + +stdint.h + + + + + +Node1->Node6 + + + + + +Node7 + + +assert.h + + + + + +Node1->Node7 + + + + + diff --git a/d1/ded/group__misc.html b/d1/ded/group__misc.html index f7a7f8d77..b43d55460 100644 --- a/d1/ded/group__misc.html +++ b/d1/ded/group__misc.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Misc @@ -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('d1/ded/group__misc.html','../../'); in
-
-
Misc
+
Misc

variable upto which prime numbers are to be found out More...

- @@ -116,9 +115,9 @@ Functions

+

Functions

void prime (int *p)
 Prime Sieve works in O(nlogn) time. More...
 

Detailed Description

-

variable upto which prime numbers are to be found out

+

variable upto which prime numbers are to be found out

Function Documentation

- +

◆ count()

@@ -153,19 +152,19 @@ Functions
Returns
count of prime numbers
-
42  {
-
43  int k=0;
-
44  for(int i=0;i<=size;i++){
-
45  if(arr[i]==1){
-
46  k++;
-
47  }
-
48  }
-
49  return k;
-
50 }
+
42 {
+
43 int k=0;
+
44 for(int i=0;i<=size;i++){
+
45 if(arr[i]==1){
+
46 k++;
+
47 }
+
48 }
+
49 return k;
+
50}
- +

◆ main()

@@ -200,21 +199,21 @@ Functions
Returns
0 on exit
-
74 {
-
75  test(); // execute the tests
-
76  return 0;
-
77 }
+
74{
+
75 test(); // execute the tests
+
76 return 0;
+
77}
static void test()
Test implementations.
Definition: prime_seive.c:56
Here is the call graph for this function:
-
+
- +

◆ prime()

@@ -238,24 +237,24 @@ Here is the call graph for this function:
Returns
void
-
22 {
-
23  for(long long int i=3;i<=MAX_SIZE;i+=2) { p[i]=1; }
-
24  for(long long int i=3;i<=MAX_SIZE;i+=2)
-
25  {
-
26  if(p[i]==1) {
-
27  for(long long int j=i*i;j<=MAX_SIZE;j+=i) {
-
28  p[j]=0;
-
29  }
-
30  }
-
31  }
-
32  p[2]=1;
-
33  p[0]=p[1]=0;
-
34 }
+
22{
+
23 for(long long int i=3;i<=MAX_SIZE;i+=2) { p[i]=1; }
+
24 for(long long int i=3;i<=MAX_SIZE;i+=2)
+
25 {
+
26 if(p[i]==1) {
+
27 for(long long int j=i*i;j<=MAX_SIZE;j+=i) {
+
28 p[j]=0;
+
29 }
+
30 }
+
31 }
+
32 p[2]=1;
+
33 p[0]=p[1]=0;
+
34}
const unsigned long long MAX_SIZE
for assert for standard input output for general purpose standard library
Definition: prime_seive.c:11
- +

◆ test()

@@ -281,21 +280,21 @@ Here is the call graph for this function:

Test implementations.

Returns
void
-
57 {
-
58  // Test Case 1
-
59  const int size = 10; /* array size */
-
60  printf("Test Case 1...");
-
61  int arr[1000005]={0}; /* array to store prime numbers */
-
62  prime(arr);
-
63  assert(count(arr,size)==4);
-
64  printf("Passed\n");
-
65 }
+
57{
+
58 // Test Case 1
+
59 const int size = 10; /* array size */
+
60 printf("Test Case 1...");
+
61 int arr[1000005]={0}; /* array to store prime numbers */
+
62 prime(arr);
+
63 assert(count(arr,size)==4);
+
64 printf("Passed\n");
+
65}
int count(int *arr, const int size)
Count func counts the number of prime numbers.
Definition: prime_seive.c:42
void prime(int *p)
Prime Sieve works in O(nlogn) time.
Definition: prime_seive.c:21
Here is the call graph for this function:
-
+
@@ -306,7 +305,7 @@ Here is the call graph for this function:
diff --git a/d1/ded/group__misc_gaa8dca7b867074164d5f45b0f3851269d_cgraph.map b/d1/ded/group__misc_gaa8dca7b867074164d5f45b0f3851269d_cgraph.map index e11e45914..58540db4d 100644 --- a/d1/ded/group__misc_gaa8dca7b867074164d5f45b0f3851269d_cgraph.map +++ b/d1/ded/group__misc_gaa8dca7b867074164d5f45b0f3851269d_cgraph.map @@ -1,5 +1,5 @@ - - + + diff --git a/d1/ded/group__misc_gaa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/d1/ded/group__misc_gaa8dca7b867074164d5f45b0f3851269d_cgraph.svg index ff9812711..55dd209ff 100644 --- a/d1/ded/group__misc_gaa8dca7b867074164d5f45b0f3851269d_cgraph.svg +++ b/d1/ded/group__misc_gaa8dca7b867074164d5f45b0f3851269d_cgraph.svg @@ -1,14 +1,14 @@ - - + test - + Node1 @@ -22,31 +22,31 @@ Node2 - -count + +count Node1->Node2 - - + + Node3 - -prime + +prime Node1->Node3 - - + + diff --git a/d1/ded/group__misc_gac0f2228420376f4db7e1274f2b41667c_cgraph.map b/d1/ded/group__misc_gac0f2228420376f4db7e1274f2b41667c_cgraph.map index 255c0349e..4dbf0f128 100644 --- a/d1/ded/group__misc_gac0f2228420376f4db7e1274f2b41667c_cgraph.map +++ b/d1/ded/group__misc_gac0f2228420376f4db7e1274f2b41667c_cgraph.map @@ -1,6 +1,6 @@ - - + + diff --git a/d1/ded/group__misc_gac0f2228420376f4db7e1274f2b41667c_cgraph.svg b/d1/ded/group__misc_gac0f2228420376f4db7e1274f2b41667c_cgraph.svg index 914ea0d49..07a66882a 100644 --- a/d1/ded/group__misc_gac0f2228420376f4db7e1274f2b41667c_cgraph.svg +++ b/d1/ded/group__misc_gac0f2228420376f4db7e1274f2b41667c_cgraph.svg @@ -1,14 +1,14 @@ - - + main - + Node1 @@ -37,31 +37,31 @@ Node3 - -count + +count Node2->Node3 - - + + Node4 - -prime + +prime Node2->Node4 - - + + diff --git a/d1/df8/merge__sort_8c__incl.map b/d1/df8/merge__sort_8c__incl.map index 4fc79c082..d51529cb1 100644 --- a/d1/df8/merge__sort_8c__incl.map +++ b/d1/df8/merge__sort_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/d1/df8/merge__sort_8c__incl.svg b/d1/df8/merge__sort_8c__incl.svg index 1f018b820..9a24a87de 100644 --- a/d1/df8/merge__sort_8c__incl.svg +++ b/d1/df8/merge__sort_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - + sorting/merge_sort.c diff --git a/d1/df9/problem__26_2sol1_8c.html b/d1/df9/problem__26_2sol1_8c.html index 47b3461e6..c27f24512 100644 --- a/d1/df9/problem__26_2sol1_8c.html +++ b/d1/df9/problem__26_2sol1_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_26/sol1.c 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/df9/problem__26_2sol1_8c.html','../ -
-
sol1.c File Reference
+
sol1.c File Reference
-

Problem 26 solution +

Problem 26 solution More...

#include <stdio.h>
#include <stdlib.h>
@@ -111,38 +110,172 @@ Include dependency graph for sol1.c:
- - + - +

+

Macros

-#define MAX_DENO   2000
+#define MAX_DENO   2000
 limit of unit fractions
 
-#define MAX_LEN    (MAX_DENO + 10)
+#define MAX_LEN    (MAX_DENO + 10)
 length of resulting recurring fraction number
 
- - - + + - - + +

+

Functions

-int compare (const void *a, const void *b)
 comparison function for use with internal qsort algorithm
int compare (const void *a, const void *b)
 comparison function for use with internal qsort algorithm More...
 
-int main (int argc, char *argv[])
 Main function.
int main (int argc, char *argv[])
 Main function. More...
 

Detailed Description

-

Problem 26 solution

-
Author
Krishna Vedala
-
+

Problem 26 solution

+
Author
Krishna Vedala
+

Function Documentation

+ +

◆ compare()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int compare (const void * a,
const void * b 
)
+
+ +

comparison function for use with internal qsort algorithm

+
20{
+
21 return (*(unsigned short *)a - *(unsigned short *)b);
+
22}
+
+
+
+ +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char * argv[] 
)
+
+ +

Main function.

+
26{
+
27 unsigned short max_digits = 0, max_idx_number = 0;
+
28
+
29 clock_t start_time = clock();
+
30 short deno;
+
31#ifdef _OPENMP
+
32#pragma omp for
+
33#endif
+
34 for (deno = 2; deno < MAX_DENO; deno++)
+
35 {
+
36 unsigned short remainders[MAX_LEN];
+
37 unsigned short rem = 1, *rem_ptr = remainders;
+
38 memset(remainders, (unsigned short)-1,
+
39 MAX_LEN * sizeof(unsigned short));
+
40 // remainders[0] = 1;
+
41 // printf("1/%-4u\t ", deno);
+
42 unsigned short index = 0, num_digits;
+
43
+
44 while (rem != 0)
+
45 {
+
46 rem = (rem * 10) % deno;
+
47 if (rem == 0)
+
48 {
+
49 index = 0;
+
50 break;
+
51 }
+
52 rem_ptr = (unsigned short *)bsearch(
+
53 &rem, remainders, MAX_LEN, sizeof(unsigned short), compare);
+
54 // printf("%2d, ", rem);
+
55 // printf("(%14p), ", rem_ptr);
+
56 if (rem_ptr != NULL)
+
57 break;
+
58 remainders[index] = rem;
+
59 rem_ptr = remainders;
+
60 index++;
+
61 }
+
62
+
63 num_digits = index - (rem_ptr - remainders);
+
64 // printf("\n\t(%14p, %14p, %4u, %4u)\n", rem_ptr, remainders, index,
+
65 // num_digits);
+
66#ifdef _OPENMP
+
67#pragma omp critical
+
68 {
+
69#endif
+
70 if (num_digits > max_digits)
+
71 {
+
72 max_digits = num_digits;
+
73 max_idx_number = deno;
+
74 // printf("\t (%u, %u)\n ", max_digits, max_idx_number);
+
75 }
+
76#ifdef _OPENMP
+
77 }
+
78#endif
+
79 }
+
80 clock_t end_time = clock();
+
81
+
82 printf("Time taken: %.4g ms\n",
+
83 1e3 * (double)(end_time - start_time) / CLOCKS_PER_SEC);
+
84 printf("Maximum digits: %hu\t Denominator: %hu\n", max_digits,
+
85 max_idx_number);
+
86
+
87 return 0;
+
88}
+
#define MAX_DENO
limit of unit fractions
Definition: sol1.c:14
+
#define MAX_LEN
length of resulting recurring fraction number
Definition: sol1.c:15
+
int compare(const void *a, const void *b)
comparison function for use with internal qsort algorithm
Definition: sol1.c:19
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ diff --git a/d1/df9/problem__26_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map b/d1/df9/problem__26_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map new file mode 100644 index 000000000..ed66ea44f --- /dev/null +++ b/d1/df9/problem__26_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/d1/df9/problem__26_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 b/d1/df9/problem__26_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 new file mode 100644 index 000000000..42939367d --- /dev/null +++ b/d1/df9/problem__26_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 @@ -0,0 +1 @@ +2c4c699c2f761619e919b936ccbbe1f8 \ No newline at end of file diff --git a/d1/df9/problem__26_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg b/d1/df9/problem__26_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg new file mode 100644 index 000000000..2ce7b189d --- /dev/null +++ b/d1/df9/problem__26_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg @@ -0,0 +1,37 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +compare + + + + + +Node1->Node2 + + + + + diff --git a/d2/d36/structqueue.html b/d2/d36/structqueue.html index d86ce8a61..90e11bb15 100644 --- a/d2/d36/structqueue.html +++ b/d2/d36/structqueue.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: queue 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() {
@@ -92,32 +92,31 @@ $(document).ready(function(){initNavTree('d2/d36/structqueue.html','../../'); in
-
-
queue Struct Reference
+
queue Struct Reference
Collaboration diagram for queue:
-
+
[legend]
- - - - - -

+

Data Fields

+
int items [SIZE]
 
+
int front
 
+
int rear
 
+
struct node * front
 
+
struct node * rear
 
@@ -131,7 +130,7 @@ struct node * 
    - +
diff --git a/d2/d36/structqueue.js b/d2/d36/structqueue.js deleted file mode 100644 index cbca7a30d..000000000 --- a/d2/d36/structqueue.js +++ /dev/null @@ -1,8 +0,0 @@ -var structqueue = -[ - [ "front", "d2/d36/structqueue.html#a6c50c7c8bcd9c5962996ed8b1be8771c", null ], - [ "front", "d2/d36/structqueue.html#ade1be9c3ada77e8e182ee4fe1e1fff05", null ], - [ "items", "d2/d36/structqueue.html#a0da4061b8634159fd21e72b34f289e01", null ], - [ "rear", "d2/d36/structqueue.html#a473ab80725514ce07817f87ed1fb136f", null ], - [ "rear", "d2/d36/structqueue.html#aa5eb0f1e96748486046b9543ace2082a", null ] -]; \ No newline at end of file diff --git a/d2/d3e/structdual__quat____coll__graph.map b/d2/d3e/structdual__quat____coll__graph.map index 407c67c9c..fcdbb0ab8 100644 --- a/d2/d3e/structdual__quat____coll__graph.map +++ b/d2/d3e/structdual__quat____coll__graph.map @@ -1,5 +1,5 @@ - - - + + + diff --git a/d2/d3e/structdual__quat____coll__graph.svg b/d2/d3e/structdual__quat____coll__graph.svg index ce822361a..67898b6d9 100644 --- a/d2/d3e/structdual__quat____coll__graph.svg +++ b/d2/d3e/structdual__quat____coll__graph.svg @@ -1,20 +1,20 @@ - - + dual_quat_ - + Node1 - -dual_quat_ + +dual_quat_ @@ -22,34 +22,34 @@ Node2 - -quaternion_ + +quaternion_ Node2->Node1 - - - dual -real + + + dual +real Node3 - -vec_3d_ + +vec_3d_ Node3->Node2 - - - dual + + + dual diff --git a/d2/d42/tcp__full__duplex__server_8c__incl.map b/d2/d42/tcp__full__duplex__server_8c__incl.map new file mode 100644 index 000000000..804131376 --- /dev/null +++ b/d2/d42/tcp__full__duplex__server_8c__incl.map @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/d2/d42/tcp__full__duplex__server_8c__incl.md5 b/d2/d42/tcp__full__duplex__server_8c__incl.md5 new file mode 100644 index 000000000..0b8a501c3 --- /dev/null +++ b/d2/d42/tcp__full__duplex__server_8c__incl.md5 @@ -0,0 +1 @@ +661bd894b06f142afca656c09991645c \ No newline at end of file diff --git a/d2/d42/tcp__full__duplex__server_8c__incl.svg b/d2/d42/tcp__full__duplex__server_8c__incl.svg new file mode 100644 index 000000000..8234a437a --- /dev/null +++ b/d2/d42/tcp__full__duplex__server_8c__incl.svg @@ -0,0 +1,261 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +client_server/tcp_full_duplex_server.c + + + +Node1 + + +client_server/tcp_full +_duplex_server.c + + + + + +Node2 + + +arpa/inet.h + + + + + +Node1->Node2 + + + + + +Node3 + + +netdb.h + + + + + +Node1->Node3 + + + + + +Node4 + + +netinet/in.h + + + + + +Node1->Node4 + + + + + +Node5 + + +stdint.h + + + + + +Node1->Node5 + + + + + +Node6 + + +stdio.h + + + + + +Node1->Node6 + + + + + +Node7 + + +stdlib.h + + + + + +Node1->Node7 + + + + + +Node8 + + +string.h + + + + + +Node1->Node8 + + + + + +Node9 + + +sys/socket.h + + + + + +Node1->Node9 + + + + + +Node10 + + +sys/types.h + + + + + +Node1->Node10 + + + + + +Node11 + + +unistd.h + + + + + +Node1->Node11 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/d2/d42/tcp__full__duplex__server_8c__incl_org.svg b/d2/d42/tcp__full__duplex__server_8c__incl_org.svg new file mode 100644 index 000000000..70f7e0b71 --- /dev/null +++ b/d2/d42/tcp__full__duplex__server_8c__incl_org.svg @@ -0,0 +1,173 @@ + + + + + + +client_server/tcp_full_duplex_server.c + + + +Node1 + + +client_server/tcp_full +_duplex_server.c + + + + + +Node2 + + +arpa/inet.h + + + + + +Node1->Node2 + + + + + +Node3 + + +netdb.h + + + + + +Node1->Node3 + + + + + +Node4 + + +netinet/in.h + + + + + +Node1->Node4 + + + + + +Node5 + + +stdint.h + + + + + +Node1->Node5 + + + + + +Node6 + + +stdio.h + + + + + +Node1->Node6 + + + + + +Node7 + + +stdlib.h + + + + + +Node1->Node7 + + + + + +Node8 + + +string.h + + + + + +Node1->Node8 + + + + + +Node9 + + +sys/socket.h + + + + + +Node1->Node9 + + + + + +Node10 + + +sys/types.h + + + + + +Node1->Node10 + + + + + +Node11 + + +unistd.h + + + + + +Node1->Node11 + + + + + diff --git a/d2/d6a/struct_graph_rep.html b/d2/d6a/struct_graph_rep.html index dfaf58aff..b5c0d22a7 100644 --- a/d2/d6a/struct_graph_rep.html +++ b/d2/d6a/struct_graph_rep.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: GraphRep 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() {
@@ -92,20 +92,19 @@ $(document).ready(function(){initNavTree('d2/d6a/struct_graph_rep.html','../../'
-
-
GraphRep Struct Reference
+
GraphRep Struct Reference
- - - -

+

Data Fields

+
int ** edges
 
+
int nV
 
+
int nE
 
@@ -118,7 +117,7 @@ int nE diff --git a/d2/d6a/struct_graph_rep.js b/d2/d6a/struct_graph_rep.js deleted file mode 100644 index 7ed03e882..000000000 --- a/d2/d6a/struct_graph_rep.js +++ /dev/null @@ -1,6 +0,0 @@ -var struct_graph_rep = -[ - [ "edges", "d2/d6a/struct_graph_rep.html#aeb803dced884357ef0c7ea59525e382b", null ], - [ "nE", "d2/d6a/struct_graph_rep.html#aaf306e1727ca6c84cc03635ef4ac4888", null ], - [ "nV", "d2/d6a/struct_graph_rep.html#a081038f30741c196b7d84fe79b4732c9", null ] -]; \ No newline at end of file diff --git a/d2/d6d/bubble__sort__2_8c.html b/d2/d6d/bubble__sort__2_8c.html index b89e8f3cf..f8e87f9de 100644 --- a/d2/d6d/bubble__sort__2_8c.html +++ b/d2/d6d/bubble__sort__2_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: sorting/bubble_sort_2.c 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/d6d/bubble__sort__2_8c.html','../.. -
-
bubble_sort_2.c File Reference
+
bubble_sort_2.c File Reference
-

implementation of Bubble sort algorithm +

implementation of Bubble sort algorithm More...

#include <stdlib.h>
#include <assert.h>
@@ -106,17 +105,17 @@ $(document).ready(function(){initNavTree('d2/d6d/bubble__sort__2_8c.html','../..
Include dependency graph for bubble_sort_2.c:
-
+
-

+

Macros

#define MAX   20
 for rand() calls for assert(<expr>) More...
 
- @@ -129,13 +128,13 @@ Functions

+

Functions

void bubble_sort (int *array_sort)
 Bubble sort implementation. More...
 

Detailed Description

-

implementation of Bubble sort algorithm

-

worst-case: O(n^2) best-case: O(n) average-complexity: O(n^2)

+

implementation of Bubble sort algorithm

+

worst-case: O(n^2) best-case: O(n) average-complexity: O(n^2)

Author
Unknown author
-Gabriel Fioravante
+Gabriel Fioravante

Macro Definition Documentation

- +

◆ MAX

@@ -148,13 +147,13 @@ Functions

for rand() calls for assert(<expr>)

-

for boolean values: true, false
+

for boolean values: true, false

Function Documentation

- +

◆ bubble_sort()

@@ -178,39 +177,39 @@ Functions
Returns
void
-
25 {
-
26  bool is_sorted = false;
-
27 
-
28  /* keep iterating over entire array
-
29  * and swaping elements out of order
-
30  * until it is sorted */
-
31  while (!is_sorted)
-
32  {
-
33  is_sorted = true;
-
34 
-
35  /* iterate over all elements */
-
36  for (int i = 0; i < MAX - 1; i++)
-
37  {
-
38  /* check if adjacent elements are out of order */
-
39  if (array_sort[i] > array_sort[i + 1])
-
40  {
-
41  /* swap elements */
-
42  int change_place = array_sort[i];
-
43  array_sort[i] = array_sort[i + 1];
-
44  array_sort[i + 1] = change_place;
-
45  /* elements out of order were found
-
46  * so we reset the flag to keep ordering
-
47  * until no swap operations are executed */
-
48  is_sorted = false;
-
49  }
-
50  }
-
51  }
-
52 }
+
25{
+
26 bool is_sorted = false;
+
27
+
28 /* keep iterating over entire array
+
29 * and swaping elements out of order
+
30 * until it is sorted */
+
31 while (!is_sorted)
+
32 {
+
33 is_sorted = true;
+
34
+
35 /* iterate over all elements */
+
36 for (int i = 0; i < MAX - 1; i++)
+
37 {
+
38 /* check if adjacent elements are out of order */
+
39 if (array_sort[i] > array_sort[i + 1])
+
40 {
+
41 /* swap elements */
+
42 int change_place = array_sort[i];
+
43 array_sort[i] = array_sort[i + 1];
+
44 array_sort[i + 1] = change_place;
+
45 /* elements out of order were found
+
46 * so we reset the flag to keep ordering
+
47 * until no swap operations are executed */
+
48 is_sorted = false;
+
49 }
+
50 }
+
51 }
+
52}
#define MAX
for rand() calls for assert(<expr>)
Definition: bubble_sort_2.c:17
- +

◆ main()

@@ -228,21 +227,21 @@ Functions

Main function.

Returns
0 on exit
-
84 {
-
85  test(); // run self-test implementations
-
86  return 0;
-
87 }
+
84{
+
85 test(); // run self-test implementations
+
86 return 0;
+
87}
static void test()
Test implementations.
Definition: bubble_sort_2.c:58
Here is the call graph for this function:
-
+
- +

◆ test()

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

Test implementations.

Returns
void
-
58  {
-
59  /* simple int array for testing */
-
60  int array_sort[MAX] = {0};
-
61 
-
62  /* populate our test array with
-
63  * random integer numbers */
-
64  for (int i = 0; i < MAX; i++)
-
65  {
-
66  array_sort[i] = rand() % 101;
-
67  }
-
68 
-
69  /* sort array */
-
70  bubble_sort(array_sort);
-
71 
-
72  /* check if array ir correctly ordered */
-
73  for (int i = 0; i < MAX - 1; i++)
-
74  {
-
75  assert(array_sort[i] <= array_sort[i+1]);
-
76  }
-
77 }
+
58 {
+
59 /* simple int array for testing */
+
60 int array_sort[MAX] = {0};
+
61
+
62 /* populate our test array with
+
63 * random integer numbers */
+
64 for (int i = 0; i < MAX; i++)
+
65 {
+
66 array_sort[i] = rand() % 101;
+
67 }
+
68
+
69 /* sort array */
+
70 bubble_sort(array_sort);
+
71
+
72 /* check if array ir correctly ordered */
+
73 for (int i = 0; i < MAX - 1; i++)
+
74 {
+
75 assert(array_sort[i] <= array_sort[i+1]);
+
76 }
+
77}
void bubble_sort(int *array_sort)
Bubble sort implementation.
Definition: bubble_sort_2.c:24
Here is the call graph for this function:
-
+
@@ -304,7 +303,7 @@ Here is the call graph for this function:
diff --git a/d2/d6d/bubble__sort__2_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map b/d2/d6d/bubble__sort__2_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map index 070cc375d..c3a3617b4 100644 --- a/d2/d6d/bubble__sort__2_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map +++ b/d2/d6d/bubble__sort__2_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map @@ -1,4 +1,4 @@ - + diff --git a/d2/d6d/bubble__sort__2_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/d2/d6d/bubble__sort__2_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg index 3430b222a..6c3dea354 100644 --- a/d2/d6d/bubble__sort__2_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg +++ b/d2/d6d/bubble__sort__2_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg @@ -1,14 +1,14 @@ - - + test - + Node1 @@ -22,16 +22,16 @@ Node2 - -bubble_sort + +bubble_sort Node1->Node2 - - + + diff --git a/d2/d6d/bubble__sort__2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d2/d6d/bubble__sort__2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map index e7eb940f2..d6e269f6a 100644 --- a/d2/d6d/bubble__sort__2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map +++ b/d2/d6d/bubble__sort__2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -1,5 +1,5 @@ - + diff --git a/d2/d6d/bubble__sort__2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d2/d6d/bubble__sort__2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index d8da14a97..5c86fcda6 100644 --- a/d2/d6d/bubble__sort__2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/d2/d6d/bubble__sort__2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,14 +1,14 @@ - - + main - + Node1 @@ -37,16 +37,16 @@ Node3 - -bubble_sort + +bubble_sort Node2->Node3 - - + + diff --git a/d2/d71/struct_a_v_lnode.html b/d2/d71/struct_a_v_lnode.html index cda122648..59f7fc674 100644 --- a/d2/d71/struct_a_v_lnode.html +++ b/d2/d71/struct_a_v_lnode.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: AVLnode 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() {
@@ -92,29 +92,28 @@ $(document).ready(function(){initNavTree('d2/d71/struct_a_v_lnode.html','../../'
-
-
AVLnode Struct Reference
+
AVLnode Struct Reference
Collaboration diagram for AVLnode:
-
+
[legend]
- - - - -

+

Data Fields

+
int key
 
+
struct AVLnode * left
 
+
struct AVLnode * right
 
+
int height
 
@@ -127,7 +126,7 @@ int height diff --git a/d2/d71/struct_a_v_lnode.js b/d2/d71/struct_a_v_lnode.js deleted file mode 100644 index b48d34f20..000000000 --- a/d2/d71/struct_a_v_lnode.js +++ /dev/null @@ -1,7 +0,0 @@ -var struct_a_v_lnode = -[ - [ "height", "d2/d71/struct_a_v_lnode.html#af7b887a7fffb15778d53e167a95e40d9", null ], - [ "key", "d2/d71/struct_a_v_lnode.html#ab3391d72c5ace9f85889430ce18383ef", null ], - [ "left", "d2/d71/struct_a_v_lnode.html#a91349e8b477c6e9d45187997ca2e2a50", null ], - [ "right", "d2/d71/struct_a_v_lnode.html#aaf07c08df1ee92ae2512869a178a14d9", null ] -]; \ No newline at end of file diff --git a/d2/d83/merge__sort_8c.html b/d2/d83/merge__sort_8c.html index 5eb22e116..16d7aaba2 100644 --- a/d2/d83/merge__sort_8c.html +++ b/d2/d83/merge__sort_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: sorting/merge_sort.c 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/d83/merge__sort_8c.html','../../');
-
-
merge_sort.c File Reference
+
merge_sort.c File Reference
-

Implementation of merge sort algorithm. +

Implementation of merge sort algorithm. More...

#include <stdio.h>
#include <stdlib.h>
@@ -108,7 +107,7 @@ Include dependency graph for merge_sort.c:
- @@ -119,20 +118,68 @@ Functions - - + +

+

Functions

void swap (int *a, int *b)
 Swap two integer variables. More...
void merge_sort (int *a, int n, int l, int r)
 Merge sort algorithm implementation. More...
 
-int main (void)
 Main function.
int main (void)
 Main function. More...
 

Detailed Description

-

Implementation of merge sort algorithm.

-
+

Implementation of merge sort algorithm.

+

Function Documentation

+ +

◆ main()

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

Main function.

+
102{
+
103 int *a, n, i;
+
104 scanf("%d", &n);
+
105 a = (int *)malloc(n * sizeof(int));
+
106 for (i = 0; i < n; i++)
+
107 {
+
108 scanf("%d", &a[i]);
+
109 }
+
110
+
111 merge_sort(a, n, 0, n - 1);
+
112 for (i = 0; i < n; i++)
+
113 {
+
114 printf(" %d", a[i]);
+
115 }
+
116
+
117 free(a);
+
118
+
119 return 0;
+
120}
+
void merge_sort(int *a, int n, int l, int r)
Merge sort algorithm implementation.
Definition: merge_sort.c:82
+
#define malloc(bytes)
This macro replace the standard malloc function with malloc_dbg.
Definition: malloc_dbg.h:18
+
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ diff --git a/d2/d83/merge__sort_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map b/d2/d83/merge__sort_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map new file mode 100644 index 000000000..2e88eaa24 --- /dev/null +++ b/d2/d83/merge__sort_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/d2/d83/merge__sort_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.md5 b/d2/d83/merge__sort_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.md5 new file mode 100644 index 000000000..6a99eb1a0 --- /dev/null +++ b/d2/d83/merge__sort_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.md5 @@ -0,0 +1 @@ +5fe688e08ce4c4560194acea0cd48077 \ No newline at end of file diff --git a/d2/d83/merge__sort_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg b/d2/d83/merge__sort_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg new file mode 100644 index 000000000..c1a9d120e --- /dev/null +++ b/d2/d83/merge__sort_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg @@ -0,0 +1,73 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +merge_sort + + + + + +Node1->Node2 + + + + + +Node2->Node2 + + + + + +Node3 + + +merge + + + + + +Node2->Node3 + + + + + +Node4 + + +swap + + + + + +Node2->Node4 + + + + + diff --git a/d2/d93/problem__8_2sol2_8c.html b/d2/d93/problem__8_2sol2_8c.html index 42bff9cfd..90707a412 100644 --- a/d2/d93/problem__8_2sol2_8c.html +++ b/d2/d93/problem__8_2sol2_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_8/sol2.c 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/d93/problem__8_2sol2_8c.html','../.
-
-
sol2.c File Reference
+
sol2.c File Reference
-

Problem 8 solution +

Problem 8 solution More...

#include <stdio.h>
#include <stdlib.h>
@@ -109,23 +108,173 @@ Include dependency graph for sol2.c:
- - - + +

+

Functions

-int main (int argc, char *argv[])
 Main function.
int main (int argc, char *argv[])
 Main function. More...
 

Detailed Description

-

Problem 8 solution

-
Author
Krishna Vedala
-
+

Problem 8 solution

+
Author
Krishna Vedala
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char * argv[] 
)
+
+ +

Main function.

+
12{
+
13 int position = 0, num_bad_chars = 0;
+
14 int num_digits = 4;
+
15 char ch;
+
16 unsigned char num, num_prev;
+
17 unsigned char *buffer = NULL;
+
18 long long int prod = 1, max_prod = 0;
+
19
+
20 /* if second command-line argument is given,
+
21 * use it as the number of digits to compute
+
22 * successive product for
+
23 */
+
24 if (argc == 2)
+
25 num_digits = atoi(argv[1]);
+
26
+
27 /* allocate memory to store past values */
+
28 buffer = calloc(num_digits, sizeof(unsigned char));
+
29 if (!buffer)
+
30 {
+
31 perror("Unable to allocate memory for buffer");
+
32 return -1;
+
33 }
+
34
+
35 /* open file to read digits from */
+
36 FILE *fp = fopen("digits.txt", "rt");
+
37 if (!fp)
+
38 {
+
39 perror("Unable to open file");
+
40 free(buffer); /* free allocated memory */
+
41 return -1;
+
42 }
+
43
+
44 /* loop through all digits in the file */
+
45 do
+
46 {
+
47 /* get character from file */
+
48 ch = getc(fp);
+
49
+
50 /* the ASCII codes of digits is between 0x30 and 0x39.
+
51 * any character not in this range implies an invalid character
+
52 */
+
53 if (ch < 0x30 || ch > 0x39)
+
54 {
+
55 num_bad_chars++; /* this is used to get the bad characters in the
+
56 sequence of 13 characters */
+
57 continue;
+
58 }
+
59 else if (num_bad_chars > 0)
+
60 num_bad_chars--;
+
61
+
62 num = ch - 0x30; /* convert character digit to number */
+
63 num_prev = buffer[0]; /* previous n^th digit */
+
64
+
65 /* left shift the buffer -
+
66 * using a for loop or a faster memory move
+
67 */
+
68 memmove(buffer, buffer + 1, num_digits - 1);
+
69 /*
+
70 for (int i = 1; i < num_digits; i++)
+
71 buffer[i-1] = buffer[i];
+
72 */
+
73
+
74 buffer[num_digits - 1] = num; /* save the latest number in buffer */
+
75
+
76 if (num_prev != 0)
+
77 {
+
78 /* since product is accumulated, the new product can be obtained by
+
79 * simply multiplying the new digit and dividing with the oldest
+
80 * digit
+
81 */
+
82 prod /= num_prev; /* divide first to avoid over-flows */
+
83 prod *= num;
+
84 }
+
85 else
+
86 {
+
87 prod = 1;
+
88 for (int i = 0; i < num_digits; i++)
+
89 {
+
90 if (buffer[i] == 0)
+
91 {
+
92 prod = 0;
+
93 break; /* break innermost for-loop */
+
94 }
+
95 prod *= buffer[i];
+
96 }
+
97 }
+
98
+
99 /* check if a new maxima was found */
+
100 if (prod > max_prod)
+
101 {
+
102 max_prod = prod;
+
103 position = ftell(fp) - num_bad_chars - num_digits - 1;
+
104 }
+
105 } while (!feof(fp)); /* loop till end of file is reached */
+
106
+
107 printf("Maximum product: %lld\t Location: %d^th position\n\t", max_prod,
+
108 position);
+
109 fseek(fp, position,
+
110 SEEK_SET); /* move cursor to identified position in file */
+
111 /* loop through all digits */
+
112 for (; num_digits > 0; num_digits--)
+
113 {
+
114 char ch = getc(fp); /* get character */
+
115 /* skip invalid character */
+
116 if (ch < 0x30 || ch > 0x39)
+
117 continue;
+
118 if (num_digits > 1)
+
119 printf("%c x ", ch);
+
120 else
+
121 printf("%c = %lld\n", ch, max_prod);
+
122 }
+
123
+
124 fclose(fp); /* close file */
+
125 free(buffer); /* free allocated memory */
+
126
+
127 return 0;
+
128}
+
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
+
#define calloc(elemCount, elemSize)
This macro replace the standard calloc function with calloc_dbg.
Definition: malloc_dbg.h:22
+
struct used to store character in certain times
Definition: min_printf.h:31
+
+
+
+ diff --git a/d2/d97/palindrome_8c__incl.map b/d2/d97/palindrome_8c__incl.map index 868a5bc67..52085a2f0 100644 --- a/d2/d97/palindrome_8c__incl.map +++ b/d2/d97/palindrome_8c__incl.map @@ -1,6 +1,6 @@ - + - - + + diff --git a/d2/d97/palindrome_8c__incl.svg b/d2/d97/palindrome_8c__incl.svg index 102db03b3..f92e900e8 100644 --- a/d2/d97/palindrome_8c__incl.svg +++ b/d2/d97/palindrome_8c__incl.svg @@ -1,20 +1,20 @@ - - + misc/palindrome.c - + Node1 - -misc/palindrome.c + +misc/palindrome.c @@ -30,38 +30,38 @@ Node1->Node2 - - + + Node3 - -stdbool.h + +stdbool.h Node1->Node3 - - + + Node4 - -stdio.h + +stdio.h Node1->Node4 - - + + diff --git a/d2/d9b/floyd__cycle__detection__algorithm_8c.html b/d2/d9b/floyd__cycle__detection__algorithm_8c.html new file mode 100644 index 000000000..189a598db --- /dev/null +++ b/d2/d9b/floyd__cycle__detection__algorithm_8c.html @@ -0,0 +1,279 @@ + + + + + + + +Algorithms_in_C: searching/floyd_cycle_detection_algorithm.c File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Algorithms_in_C 1.0.0 +
+
Set of algorithms implemented in C.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
floyd_cycle_detection_algorithm.c File Reference
+
+
+ +

Implementation of Floyd's Cycle Detection algorithm. +More...

+
#include <assert.h>
+#include <inttypes.h>
+#include <stdio.h>
+
+Include dependency graph for floyd_cycle_detection_algorithm.c:
+
+
+
+
+
+ + + + + + + + + + +

+Functions

uint32_t duplicateNumber (const uint32_t *in_arr, size_t n)
 for assert More...
 
static void test ()
 Self-test implementations. More...
 
int main ()
 Main function. More...
 
+

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
+

Function Documentation

+ +

◆ duplicateNumber()

+ +
+
+ + + + + + + + + + + + + + + + + + +
uint32_t duplicateNumber (const uint32_t * in_arr,
size_t n 
)
+
+ +

for assert

+

for uint32_t for IO operations

+

The main function implements the search algorithm

Template Parameters
+ + +
Ttype of array
+
+
+
Parameters
+ + + +
in_arrthe input array
nsize of the array
+
+
+
Returns
the duplicate number
+

< variable tortoise is used for the longer jumps in the array

+

< variable hare is used for shorter jumps in the array

+
26{
+
27 if (n <= 1) { // to find duplicate in an array its size should be atleast 2
+
28 return -1;
+
29 }
+
30 uint32_t tortoise = in_arr[0]; ///< variable tortoise is used for the longer
+
31 ///< jumps in the array
+
32 uint32_t hare = in_arr[0]; ///< variable hare is used for shorter jumps in the array
+
33 do { // loop to enter the cycle
+
34 tortoise = in_arr[tortoise]; // tortoise is moving by one step
+
35 hare = in_arr[in_arr[hare]]; // hare is moving by two steps
+
36 } while (tortoise != hare);
+
37 tortoise = in_arr[0];
+
38 while (tortoise != hare) { // loop to find the entry point of cycle
+
39 tortoise = in_arr[tortoise];
+
40 hare = in_arr[hare];
+
41 }
+
42 return tortoise;
+
43}
+
+
+
+ +

◆ main()

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

Main function.

+
Returns
0 on exit
+
65{
+
66 test(); // run self-test implementations
+
67 return 0;
+
68}
+
static void test()
Self-test implementations.
Definition: floyd_cycle_detection_algorithm.c:49
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ test()

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

Self-test implementations.

+
Returns
void
+
50{
+
51 uint32_t arr[] = {1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610}; // input array
+
52 size_t n = sizeof(arr) / sizeof(int);
+
53
+
54 printf("1st test... ");
+
55 uint32_t index = duplicateNumber(arr, n); // calling the duplicateNumber function to check which number occurs twice in the array
+
56 assert(index == 1); // the number which occurs twice is 1 or not
+
57 printf("passed\n");
+
58}
+
uint32_t duplicateNumber(const uint32_t *in_arr, size_t n)
for assert
Definition: floyd_cycle_detection_algorithm.c:25
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+
+
+ + + + diff --git a/d2/d9b/floyd__cycle__detection__algorithm_8c.js b/d2/d9b/floyd__cycle__detection__algorithm_8c.js new file mode 100644 index 000000000..b77f13f75 --- /dev/null +++ b/d2/d9b/floyd__cycle__detection__algorithm_8c.js @@ -0,0 +1,6 @@ +var floyd__cycle__detection__algorithm_8c = +[ + [ "duplicateNumber", "d2/d9b/floyd__cycle__detection__algorithm_8c.html#ac7af29ae53c6659f2881fb080b080f9d", null ], + [ "main", "d2/d9b/floyd__cycle__detection__algorithm_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], + [ "test", "d2/d9b/floyd__cycle__detection__algorithm_8c.html#aa8dca7b867074164d5f45b0f3851269d", null ] +]; \ No newline at end of file diff --git a/d2/d9b/floyd__cycle__detection__algorithm_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map b/d2/d9b/floyd__cycle__detection__algorithm_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map new file mode 100644 index 000000000..c1c6b6a70 --- /dev/null +++ b/d2/d9b/floyd__cycle__detection__algorithm_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/d2/d9b/floyd__cycle__detection__algorithm_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 b/d2/d9b/floyd__cycle__detection__algorithm_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 new file mode 100644 index 000000000..3384c9a1f --- /dev/null +++ b/d2/d9b/floyd__cycle__detection__algorithm_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 @@ -0,0 +1 @@ +c0a31c0e89bae28a6da43a02865a9a04 \ No newline at end of file diff --git a/d2/d9b/floyd__cycle__detection__algorithm_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/d2/d9b/floyd__cycle__detection__algorithm_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg new file mode 100644 index 000000000..360b7ebee --- /dev/null +++ b/d2/d9b/floyd__cycle__detection__algorithm_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg @@ -0,0 +1,37 @@ + + + + + + +test + + + +Node1 + + +test + + + + + +Node2 + + +duplicateNumber + + + + + +Node1->Node2 + + + + + diff --git a/d2/d9b/floyd__cycle__detection__algorithm_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d2/d9b/floyd__cycle__detection__algorithm_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..1515ab011 --- /dev/null +++ b/d2/d9b/floyd__cycle__detection__algorithm_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/d2/d9b/floyd__cycle__detection__algorithm_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d2/d9b/floyd__cycle__detection__algorithm_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..3df2fab39 --- /dev/null +++ b/d2/d9b/floyd__cycle__detection__algorithm_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +ddd600b31a83f5d9d0b96ce345ce2d93 \ No newline at end of file diff --git a/d2/d9b/floyd__cycle__detection__algorithm_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d2/d9b/floyd__cycle__detection__algorithm_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..ea115b846 --- /dev/null +++ b/d2/d9b/floyd__cycle__detection__algorithm_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,52 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +test + + + + + +Node1->Node2 + + + + + +Node3 + + +duplicateNumber + + + + + +Node2->Node3 + + + + + diff --git a/d2/da8/bead__sort_8c.html b/d2/da8/bead__sort_8c.html index 1071b4a3b..432606114 100644 --- a/d2/da8/bead__sort_8c.html +++ b/d2/da8/bead__sort_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: sorting/bead_sort.c 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/da8/bead__sort_8c.html','../../'); -
-
bead_sort.c File Reference
+
bead_sort.c File Reference
-

Sorting of array list using bead sort +

Sorting of array list using bead sort More...

#include <stdio.h>
#include <stdlib.h>
@@ -109,14 +108,14 @@ Include dependency graph for bead_sort.c:
- +#define 

+

Macros

-#define BEAD(i, j)   beads[i * max + j]
BEAD(i, j)   beads[i * max + j]
 Create easy access of elements from a 2D matrix stored in memory as a 1D array.
 
- @@ -124,20 +123,84 @@ Functions - - + +

+

Functions

void display (const int *arr, int n)
 Displays the array, passed to this method. More...
void bead_sort (int *a, size_t len)
 This is where the sorting of the array takes place. More...
 
-int main (int argc, const char *argv[])
 Main function.
int main (int argc, const char *argv[])
 Main function. More...
 

Detailed Description

-

Sorting of array list using bead sort

-
+

Sorting of array list using bead sort

+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
const char * argv[] 
)
+
+ +

Main function.

+
76{
+
77 int n;
+
78 printf("Enter size of array:\n");
+
79 scanf("%d", &n); // E.g. 8 1 2 3
+
80
+
81 printf("Enter the elements of the array\n");
+
82 int i;
+
83 int *arr = (int *)malloc(n * sizeof(int));
+
84 for (i = 0; i < n; i++)
+
85 {
+
86 scanf("%d", &arr[i]);
+
87 }
+
88
+
89 printf("Original array: ");
+
90 display(arr, n);
+
91
+
92 bead_sort(arr, n);
+
93
+
94 printf("Sorted array: ");
+
95 display(arr, n);
+
96
+
97 free(arr);
+
98 return 0;
+
99}
+
void bead_sort(int *a, size_t len)
This is where the sorting of the array takes place.
Definition: bead_sort.c:37
+
void display(const int *arr, int n)
Displays the array, passed to this method.
Definition: bead_sort.c:23
+
#define malloc(bytes)
This macro replace the standard malloc function with malloc_dbg.
Definition: malloc_dbg.h:18
+
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ diff --git a/d2/da8/bead__sort_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.map b/d2/da8/bead__sort_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.map new file mode 100644 index 000000000..48ae66738 --- /dev/null +++ b/d2/da8/bead__sort_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/d2/da8/bead__sort_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.md5 b/d2/da8/bead__sort_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.md5 new file mode 100644 index 000000000..6c903d43a --- /dev/null +++ b/d2/da8/bead__sort_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.md5 @@ -0,0 +1 @@ +bb33ac3daab8b5bde6b0c523a80d751f \ No newline at end of file diff --git a/d2/da8/bead__sort_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.svg b/d2/da8/bead__sort_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.svg new file mode 100644 index 000000000..73d7e77d1 --- /dev/null +++ b/d2/da8/bead__sort_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.svg @@ -0,0 +1,52 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +bead_sort + + + + + +Node1->Node2 + + + + + +Node3 + + +display + + + + + +Node1->Node3 + + + + + diff --git a/d2/daa/structadaline.html b/d2/daa/structadaline.html index 2461073de..9a97c94fd 100644 --- a/d2/daa/structadaline.html +++ b/d2/daa/structadaline.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: adaline 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() {
@@ -92,31 +92,30 @@ $(document).ready(function(){initNavTree('d2/daa/structadaline.html','../../');

structure to hold adaline model parameters More...

- - + - + - +

+

Data Fields

-double eta
+double eta
 learning rate of the algorithm
 
-double * weights
+double * weights
 weights of the neural network
 
-int num_weights
+int num_weights
 number of weights of the neural network
 

Detailed Description

-

structure to hold adaline model parameters

+

structure to hold adaline model parameters


The documentation for this struct was generated from the following file: @@ -126,7 +125,7 @@ int 
    - +
diff --git a/d2/dae/problem__1_2sol2_8c.html b/d2/dae/problem__1_2sol2_8c.html index edf8fa723..bcd8f1aa8 100644 --- a/d2/dae/problem__1_2sol2_8c.html +++ b/d2/dae/problem__1_2sol2_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_1/sol2.c 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,39 +92,72 @@ $(document).ready(function(){initNavTree('d2/dae/problem__1_2sol2_8c.html','../.
-
-
sol2.c File Reference
+
sol2.c File Reference
-

Problem 1 solution +

Problem 1 solution More...

#include <stdio.h>
Include dependency graph for sol2.c:
-
+
- - - + +

+

Functions

-int main ()
 Main function.
int main ()
 Main function. More...
 

Detailed Description

-

Problem 1 solution

-

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3,5,6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below N.

-

This solution is based on the pattern that the successive numbers in the series follow: 0+3,+2,+1,+3,+1,+2,+3.

-
+

Problem 1 solution

+

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3,5,6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below N.

+

This solution is based on the pattern that the successive numbers in the series follow: 0+3,+2,+1,+3,+1,+2,+3.

+

Function Documentation

+ +

◆ main()

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

Main function.

+
16{
+
17 int n = 0;
+
18 int sum = 0;
+
19 scanf("%d", &n);
+
20
+
21 int terms = (n - 1) / 3;
+
22 sum += ((terms) * (6 + (terms - 1) * 3)) / 2; // sum of an A.P.
+
23 terms = (n - 1) / 5;
+
24 sum += ((terms) * (10 + (terms - 1) * 5)) / 2;
+
25 terms = (n - 1) / 15;
+
26 sum -= ((terms) * (30 + (terms - 1) * 15)) / 2;
+
27
+
28 printf("%d\n", sum);
+
29}
+
+
+
+
diff --git a/d2/dbc/problem__3_2sol2_8c.html b/d2/dbc/problem__3_2sol2_8c.html index e315e8b1f..617b97329 100644 --- a/d2/dbc/problem__3_2sol2_8c.html +++ b/d2/dbc/problem__3_2sol2_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_3/sol2.c 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,39 +92,84 @@ $(document).ready(function(){initNavTree('d2/dbc/problem__3_2sol2_8c.html','../.
-
-
sol2.c File Reference
+
sol2.c File Reference
-

Problem 3 solution +

Problem 3 solution More...

#include <stdio.h>
Include dependency graph for sol2.c:
-
+
- - - + +

+

Functions

-int main ()
 Main function.
int main ()
 Main function. More...
 

Detailed Description

-

Problem 3 solution

-

Problem:

-

The prime factors of 13195 are 5,7,13 and 29. What is the largest prime factor of a given number N? e.g. for 10, largest prime factor = 5. For 17, largest prime factor = 17.

-
+

Problem 3 solution

+

Problem:

+

The prime factors of 13195 are 5,7,13 and 29. What is the largest prime factor of a given number N? e.g. for 10, largest prime factor = 5. For 17, largest prime factor = 17.

+

Function Documentation

+ +

◆ main()

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

Main function.

+
15{
+
16 int n = 0;
+
17 scanf("%d", &n);
+
18 int prime = 1;
+
19 int i = 2;
+
20 while (i * i <= n)
+
21 {
+
22 while (n % i == 0)
+
23 {
+
24 prime = i;
+
25 n /= i;
+
26 }
+
27 i += 1;
+
28 }
+
29 if (n > 1)
+
30 prime = n;
+
31 printf("%d\n", prime);
+
32 return 0;
+
33}
+
void prime(int *p)
Prime Sieve works in O(nlogn) time.
Definition: prime_seive.c:21
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+
diff --git a/d2/dbc/problem__3_2sol2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d2/dbc/problem__3_2sol2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..90e47710d --- /dev/null +++ b/d2/dbc/problem__3_2sol2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/d2/dbc/problem__3_2sol2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d2/dbc/problem__3_2sol2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..196086d4f --- /dev/null +++ b/d2/dbc/problem__3_2sol2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +cb4fcd0fb7ac8ec60393930a15637493 \ No newline at end of file diff --git a/d2/dbc/problem__3_2sol2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d2/dbc/problem__3_2sol2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..bd4c8f030 --- /dev/null +++ b/d2/dbc/problem__3_2sol2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,37 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +prime + + + + + +Node1->Node2 + + + + + diff --git a/d2/dc3/carray_8h_source.html b/d2/dc3/carray_8h_source.html index b71e7c823..fbcea884b 100644 --- a/d2/dc3/carray_8h_source.html +++ b/d2/dc3/carray_8h_source.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: data_structures/array/carray.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,95 +90,94 @@ $(document).ready(function(){initNavTree('d2/dc3/carray_8h_source.html','../../'
-
-
carray.h
+
carray.h
-
1 /*
-
2  * CArray.h
-
3  *
-
4  * Author: Leonardo Vencovsky
-
5  * Created on 18/03/2018
-
6  *
-
7  * Modified by: Leonardo Vencovsky
-
8  * Last modified: 19/03/2018
-
9  *
-
10  * Header for Array in C
-
11  *
-
12  * Compiled in Visual Studio 2017
-
13  *
-
14  */
-
15 
-
16 #pragma once
-
17 
-
18 #ifdef __cplusplus
-
19 extern "C"
-
20 {
-
21 #endif
-
22 
-
23 #define ARRAY_ERASED -1
-
24 #define SUCCESS 0
-
25 #define INVALID_POSITION 1
-
26 #define POSITION_INIT 2
-
27 #define POSITION_NOT_INIT 3
-
28 #define POSITION_EMPTY 4
-
29 #define ARRAY_FULL 5
-
30 
-
31  typedef struct CArray
-
32  {
-
33  int *array;
-
34  int size;
-
35  } CArray;
-
36 
-
37  // +-------------------------------------+
-
38  // | Returns array |
-
39  // +-------------------------------------+
-
40  CArray *getCArray(int size);
-
41  CArray *getCopyCArray(CArray *array);
-
42 
-
43  // +-------------------------------------+
-
44  // | Input / Output |
-
45  // +-------------------------------------+
-
46  int insertValueCArray(CArray *array, int position, int value);
-
47  int removeValueCArray(CArray *array, int position);
-
48  int pushValueCArray(CArray *array, int value);
-
49  int updateValueCArray(CArray *array, int position, int value);
-
50 
-
51  // +-------------------------------------+
-
52  // | Erase |
-
53  // +-------------------------------------+
-
54  int eraseCArray(CArray *array);
-
55 
-
56  // +-------------------------------------+
-
57  // | Switching |
-
58  // +-------------------------------------+
-
59  int switchValuesCArray(CArray *array, int position1, int position2);
-
60  int reverseCArray(CArray *array);
-
61 
-
62  // +-------------------------------------+
-
63  // | Sorting |
-
64  // +-------------------------------------+
-
65  int bubbleSortCArray(CArray *array);
-
66  int selectionSortCArray(CArray *array);
-
67  int insertionSortCArray(CArray *array);
-
68  int blenderCArray(CArray *array);
-
69 
-
70  // +-------------------------------------+
-
71  // | Searching |
-
72  // +-------------------------------------+
-
73  int valueOcurranceCArray(CArray *array, int value);
-
74  CArray *valuePositionsCArray(CArray *array, int value);
-
75  int findMaxCArray(CArray *array);
-
76  int findMinCArray(CArray *array);
-
77 
-
78  // +-------------------------------------+
-
79  // | Display |
-
80  // +-------------------------------------+
-
81  int displayCArray(CArray *array);
-
82 
-
83 #ifdef __cplusplus
-
84 }
-
85 #endif
+
1/*
+
2 * CArray.h
+
3 *
+
4 * Author: Leonardo Vencovsky
+
5 * Created on 18/03/2018
+
6 *
+
7 * Modified by: Leonardo Vencovsky
+
8 * Last modified: 19/03/2018
+
9 *
+
10 * Header for Array in C
+
11 *
+
12 * Compiled in Visual Studio 2017
+
13 *
+
14 */
+
15
+
16#pragma once
+
17
+
18#ifdef __cplusplus
+
19extern "C"
+
20{
+
21#endif
+
22
+
23#define ARRAY_ERASED -1
+
24#define SUCCESS 0
+
25#define INVALID_POSITION 1
+
26#define POSITION_INIT 2
+
27#define POSITION_NOT_INIT 3
+
28#define POSITION_EMPTY 4
+
29#define ARRAY_FULL 5
+
30
+
31 typedef struct CArray
+
32 {
+
33 int *array;
+
34 int size;
+
35 } CArray;
+
36
+
37 // +-------------------------------------+
+
38 // | Returns array |
+
39 // +-------------------------------------+
+
40 CArray *getCArray(int size);
+
41 CArray *getCopyCArray(CArray *array);
+
42
+
43 // +-------------------------------------+
+
44 // | Input / Output |
+
45 // +-------------------------------------+
+
46 int insertValueCArray(CArray *array, int position, int value);
+
47 int removeValueCArray(CArray *array, int position);
+
48 int pushValueCArray(CArray *array, int value);
+
49 int updateValueCArray(CArray *array, int position, int value);
+
50
+
51 // +-------------------------------------+
+
52 // | Erase |
+
53 // +-------------------------------------+
+
54 int eraseCArray(CArray *array);
+
55
+
56 // +-------------------------------------+
+
57 // | Switching |
+
58 // +-------------------------------------+
+
59 int switchValuesCArray(CArray *array, int position1, int position2);
+
60 int reverseCArray(CArray *array);
+
61
+
62 // +-------------------------------------+
+
63 // | Sorting |
+
64 // +-------------------------------------+
+
65 int bubbleSortCArray(CArray *array);
+
66 int selectionSortCArray(CArray *array);
+
67 int insertionSortCArray(CArray *array);
+
68 int blenderCArray(CArray *array);
+
69
+
70 // +-------------------------------------+
+
71 // | Searching |
+
72 // +-------------------------------------+
+
73 int valueOcurranceCArray(CArray *array, int value);
+
74 CArray *valuePositionsCArray(CArray *array, int value);
+
75 int findMaxCArray(CArray *array);
+
76 int findMinCArray(CArray *array);
+
77
+
78 // +-------------------------------------+
+
79 // | Display |
+
80 // +-------------------------------------+
+
81 int displayCArray(CArray *array);
+
82
+
83#ifdef __cplusplus
+
84}
+
85#endif
Definition: carray.h:32
@@ -186,7 +185,7 @@ $(document).ready(function(){initNavTree('d2/dc3/carray_8h_source.html','../../' diff --git a/d2/dd8/problem__3_2sol1_8c__incl.map b/d2/dd8/problem__3_2sol1_8c__incl.map index 163b3cf36..974e1381b 100644 --- a/d2/dd8/problem__3_2sol1_8c__incl.map +++ b/d2/dd8/problem__3_2sol1_8c__incl.map @@ -1,5 +1,5 @@ - - - + + + diff --git a/d2/dd8/problem__3_2sol1_8c__incl.svg b/d2/dd8/problem__3_2sol1_8c__incl.svg index 7d1ce22c2..c0c1d3fc8 100644 --- a/d2/dd8/problem__3_2sol1_8c__incl.svg +++ b/d2/dd8/problem__3_2sol1_8c__incl.svg @@ -1,21 +1,21 @@ - - + project_euler/problem_3/sol1.c - + Node1 - -project_euler/problem -_3/sol1.c + +project_euler/problem +_3/sol1.c @@ -23,31 +23,31 @@ Node2 - -math.h + +math.h Node1->Node2 - - + + Node3 - -stdio.h + +stdio.h Node1->Node3 - - + + diff --git a/d2/ddd/malloc__dbg_8h.html b/d2/ddd/malloc__dbg_8h.html index 8f3eb3885..59347817a 100644 --- a/d2/ddd/malloc__dbg_8h.html +++ b/d2/ddd/malloc__dbg_8h.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: developer_tools/malloc_dbg.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,8 +93,7 @@ $(document).ready(function(){initNavTree('d2/ddd/malloc__dbg_8h.html','../../'); -
-
malloc_dbg.h File Reference
+
malloc_dbg.h File Reference
@@ -103,35 +102,35 @@ $(document).ready(function(){initNavTree('d2/ddd/malloc__dbg_8h.html','../../');
This graph shows which files directly or indirectly include this file:
-
+

Go to the source code of this file.

- - + - + - +

+

Macros

-#define malloc(bytes)   malloc_dbg(bytes, __LINE__, __FILE__, __FUNCTION__)
+#define malloc(bytes)   malloc_dbg(bytes, __LINE__, __FILE__, __FUNCTION__)
 This macro replace the standard malloc function with malloc_dbg.
 
-#define calloc(elemCount, elemSize)   calloc_dbg(elemCount, elemSize, __LINE__, __FILE__, __FUNCTION__)
+#define calloc(elemCount, elemSize)   calloc_dbg(elemCount, elemSize, __LINE__, __FILE__, __FUNCTION__)
 This macro replace the standard calloc function with calloc_dbg.
 
-#define free(ptr)   free_dbg(ptr)
+#define free(ptr)   free_dbg(ptr)
 This macro replace the standard free function with free_dbg.
 
- - - - - - - + + + + + + @@ -140,18 +139,18 @@ Functions

+

Functions

void * malloc_dbg (size_t bytes, int line, const char *filename, const char *functionName)
 malloc_dbg function is a wrapper around the malloc function. More...
 
void * calloc_dbg (size_t elementCount, size_t elementSize, int line, const char *filename, const char *functionName)
 calloc_dbg function is a wrapper around the calloc function. More...
 
void * malloc_dbg (size_t bytes, int line, const char *filename, const char *functionName)
 malloc_dbg function is a wrapper around the malloc function. More...
 
void * calloc_dbg (size_t elementCount, size_t elementSize, int line, const char *filename, const char *functionName)
 calloc_dbg function is a wrapper around the calloc function. More...
 
void free_dbg (void *ptrToFree)
 free_dbg function is used to free the memory allocated to a pointer. More...
 
 

Detailed Description

-

Header file that contains macros used to replace malloc/calloc and free.

-

Macros malloc, calloc and free respectively calls malloc_dbg, calloc_dbg and free_dbg. malloc_dbg and calloc_dbg allocates memory using the "real" malloc and calloc and store the pointer returned (with additional informations) in a linked list. Thanks to this linked list, it is possible to check memory leaks.

Author
tinouduart33
+

Header file that contains macros used to replace malloc/calloc and free.

+

Macros malloc, calloc and free respectively calls malloc_dbg, calloc_dbg and free_dbg. malloc_dbg and calloc_dbg allocates memory using the "real" malloc and calloc and store the pointer returned (with additional informations) in a linked list. Thanks to this linked list, it is possible to check memory leaks.

Author
tinouduart33
See also
malloc_dbg.c

Function Documentation

- -

◆ calloc_dbg()

+ +

◆ calloc_dbg()

- + @@ -189,7 +188,7 @@ Functions

calloc_dbg function is a wrapper around the calloc function.

-

This function calls calloc and allocates the number of bytes passed in the parameters. If the allocation succeeds then it add the pointer returned by malloc in the mem_info list.

Parameters
+

This function calls calloc and allocates the number of bytes passed in the parameters. If the allocation succeeds then it add the pointer returned by malloc in the mem_info list.

Parameters
void* calloc_dbg void * calloc_dbg ( size_t  elementCount,
@@ -200,46 +199,46 @@ Functions
Returns
Pointer returned by calloc if it's valid, NULL otherwhise.
-
175 {
-
176  void* ptrToReturn = calloc(elementCount, elementSize);
-
177  if (!ptrToReturn)
-
178  {
-
179  return NULL;
-
180  }
-
181 
-
182  // We must check atexitCalled value to know if we already called the function
-
183  if (!atexitCalled)
-
184  {
-
185  atexit(printLeaks); // Used to call printLeaks when the program exit
-
186  atexitCalled = 1;
-
187  }
-
188 
-
189  // Add a new element in the mem_info list
-
190  memoryInformation = addMemInfo(memoryInformation, ptrToReturn, elementCount * elementSize, line, filename, functionName);
-
191  if (!memoryInformation)
-
192  {
-
193  free(ptrToReturn);
-
194  return NULL;
-
195  }
-
196 
-
197  return ptrToReturn;
-
198 }
+
175{
+
176 void* ptrToReturn = calloc(elementCount, elementSize);
+
177 if (!ptrToReturn)
+
178 {
+
179 return NULL;
+
180 }
+
181
+
182 // We must check atexitCalled value to know if we already called the function
+
183 if (!atexitCalled)
+
184 {
+
185 atexit(printLeaks); // Used to call printLeaks when the program exit
+
186 atexitCalled = 1;
+
187 }
+
188
+
189 // Add a new element in the mem_info list
+
190 memoryInformation = addMemInfo(memoryInformation, ptrToReturn, elementCount * elementSize, line, filename, functionName);
+ +
192 {
+
193 free(ptrToReturn);
+
194 return NULL;
+
195 }
+
196
+
197 return ptrToReturn;
+
198}
+
mem_info * addMemInfo(mem_info *memoryInfo, void *ptrToReturn, size_t bytes, int line, const char *filename, const char *functionName)
addMemInfo function add a memory allocation in the memoryInfo list.
Definition: malloc_dbg.c:51
void printLeaks()
printLeaks function is used to print all the memory leaks.
Definition: malloc_dbg.c:264
int atexitCalled
Another global variable.
Definition: malloc_dbg.c:37
-
mem_info * addMemInfo(mem_info *memoryInfo, void *ptrToReturn, size_t bytes, int line, const char *filename, const char *functionName)
addMemInfo function add a memory allocation in the memoryInfo list.
Definition: malloc_dbg.c:51
mem_info * memoryInformation
We use a global variable for the list so we can use it at any time.
Definition: malloc_dbg.c:33
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
#define calloc(elemCount, elemSize)
This macro replace the standard calloc function with calloc_dbg.
Definition: malloc_dbg.h:22
Here is the call graph for this function:
-
+
- +

◆ free_dbg()

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

free_dbg function is used to free the memory allocated to a pointer.

-

This function free the memory pointed by the pointer passed in parameter. To free this pointer, we loop through the mem_info list and check if we find the pointer. Once it's found, the pointer is freed and the element is deleted from the list.

Parameters
+

This function free the memory pointed by the pointer passed in parameter. To free this pointer, we loop through the mem_info list and check if we find the pointer. Once it's found, the pointer is freed and the element is deleted from the list.

Parameters
elementCountnumber of element to allocate
elementSizeSize of each element
ptrToFreePointer that must be freed
Returns
Nothing.
-
209 {
- -
211  mem_info* toFree = NULL;
-
212  mem_info* previous = NULL;
-
213 
-
214  // Check if the head contains the pointer to free
-
215  if (tmp->ptr == ptrToFree)
-
216  {
-
217  toFree = tmp;
-
218  memoryInformation = tmp->next;
-
219  free(toFree->ptr);
-
220  free(toFree);
-
221  if (memoryInformation)
-
222  {
-
223  memoryInformation->previous = NULL;
-
224  }
-
225  return;
-
226  }
-
227 
-
228  // We can loop through the list without any problems, the head is not the pointer
-
229  while (tmp)
-
230  {
-
231  if (tmp->ptr == ptrToFree) // If we found the pointer that must be freed
-
232  {
-
233  toFree = tmp;
-
234  tmp = tmp->next;
-
235  previous = toFree->previous;
-
236 
-
237  if (previous)
-
238  {
-
239  previous->next = tmp;
-
240  }
-
241  if (tmp)
-
242  {
-
243  tmp->previous = previous;
-
244  }
-
245 
-
246  free(toFree->ptr);
-
247  if (toFree == memoryInformation)
-
248  {
-
249  memoryInformation = NULL;
-
250  }
-
251  free(toFree);
-
252  return;
-
253  }
-
254  tmp = tmp->next;
-
255  }
-
256 }
+
209{
+ +
211 mem_info* toFree = NULL;
+
212 mem_info* previous = NULL;
+
213
+
214 // Check if the head contains the pointer to free
+
215 if (tmp->ptr == ptrToFree)
+
216 {
+
217 toFree = tmp;
+
218 memoryInformation = tmp->next;
+
219 free(toFree->ptr);
+
220 free(toFree);
+ +
222 {
+ +
224 }
+
225 return;
+
226 }
+
227
+
228 // We can loop through the list without any problems, the head is not the pointer
+
229 while (tmp)
+
230 {
+
231 if (tmp->ptr == ptrToFree) // If we found the pointer that must be freed
+
232 {
+
233 toFree = tmp;
+
234 tmp = tmp->next;
+
235 previous = toFree->previous;
+
236
+
237 if (previous)
+
238 {
+
239 previous->next = tmp;
+
240 }
+
241 if (tmp)
+
242 {
+
243 tmp->previous = previous;
+
244 }
+
245
+
246 free(toFree->ptr);
+
247 if (toFree == memoryInformation)
+
248 {
+
249 memoryInformation = NULL;
+
250 }
+
251 free(toFree);
+
252 return;
+
253 }
+
254 tmp = tmp->next;
+
255 }
+
256}
For the malloc, calloc and free functions.
Definition: malloc_dbg.c:21
struct MEMORY_INFORMATION * previous
Previous element in the list.
Definition: malloc_dbg.c:28
void * ptr
Pointer returned by malloc / calloc.
Definition: malloc_dbg.c:22
@@ -318,14 +317,14 @@ Here is the call graph for this function:
- -

◆ malloc_dbg()

+ +

◆ malloc_dbg()

- + @@ -357,7 +356,7 @@ Here is the call graph for this function:

malloc_dbg function is a wrapper around the malloc function.

-

This function calls malloc and allocates the number of bytes passed in the parameters. If the allocation succeeds then it add the pointer returned by malloc in the mem_info list.

Parameters
+

This function calls malloc and allocates the number of bytes passed in the parameters. If the allocation succeeds then it add the pointer returned by malloc in the mem_info list.

Parameters
void* malloc_dbg void * malloc_dbg ( size_t  bytes,
@@ -366,51 +365,51 @@ Here is the call graph for this function:
Returns
Pointer returned by malloc if it's valid, NULL otherwhise.
-
130 {
-
131  void* ptrToReturn = malloc(bytes);
-
132  int pos = 0;
-
133  if (!ptrToReturn)
-
134  {
-
135  return NULL;
-
136  }
-
137 
-
138  // We must check atexitCalled value to know if we already called the function
-
139  if (!atexitCalled)
-
140  {
-
141  atexit(printLeaks); // Used to call printLeaks when the program exit
-
142  atexitCalled = 1;
-
143  }
-
144 
-
145  pos = inList(filename, line);
-
146  if (pos == -1)
-
147  {
-
148  // Add a new element in the mem_info list
-
149  memoryInformation = addMemInfo(memoryInformation, ptrToReturn, bytes, line, filename, functionName);
-
150  if (!memoryInformation)
-
151  {
-
152  free(ptrToReturn);
-
153  return NULL;
-
154  }
-
155  }
-
156  else
-
157  {
-
158  editInfo(pos, bytes);
-
159  }
-
160  return ptrToReturn;
-
161 }
+
130{
+
131 void* ptrToReturn = malloc(bytes);
+
132 int pos = 0;
+
133 if (!ptrToReturn)
+
134 {
+
135 return NULL;
+
136 }
+
137
+
138 // We must check atexitCalled value to know if we already called the function
+
139 if (!atexitCalled)
+
140 {
+
141 atexit(printLeaks); // Used to call printLeaks when the program exit
+
142 atexitCalled = 1;
+
143 }
+
144
+
145 pos = inList(filename, line);
+
146 if (pos == -1)
+
147 {
+
148 // Add a new element in the mem_info list
+
149 memoryInformation = addMemInfo(memoryInformation, ptrToReturn, bytes, line, filename, functionName);
+ +
151 {
+
152 free(ptrToReturn);
+
153 return NULL;
+
154 }
+
155 }
+
156 else
+
157 {
+
158 editInfo(pos, bytes);
+
159 }
+
160 return ptrToReturn;
+
161}
void editInfo(int elemPos, size_t bytes)
editInfo function is used to edit an element in the memoryInfo list.
Definition: malloc_dbg.c:107
int inList(const char *filename, int line)
inList function is used to know if an element is already in the memoryInfo list.
Definition: malloc_dbg.c:79
#define malloc(bytes)
This macro replace the standard malloc function with malloc_dbg.
Definition: malloc_dbg.h:18
Here is the call graph for this function:
-
+
- +

◆ printLeaks()

@@ -427,32 +426,32 @@ Here is the call graph for this function:

printLeaks function is used to print all the memory leaks.

-

This function is called when the program exits. It loop through the mem_info list and if it's not empty, it prints the memory leaks.

Returns
Nothing.
-
265 {
- -
267  mem_info* previous = NULL;
-
268  size_t sum = 0;
-
269  int nbBlocks = 0;
-
270 
-
271  if (tmp)
-
272  {
-
273  printf("Memory Leaks detected.\n");
-
274  }
-
275 
-
276  while (tmp)
-
277  {
-
278  previous = tmp;
-
279  printf("\n%ld bytes lost\n", tmp->bytes);
-
280  printf("address : 0x%p in %s\t%s:%d\n", tmp->ptr, tmp->functionName, tmp->fileName, tmp->line);
-
281  printf("\n====================================\n");
-
282  sum += tmp->bytes;
-
283  tmp = tmp->next;
-
284  free(previous);
-
285  nbBlocks++;
-
286  }
-
287 
-
288  printf("SUMMARY :\n%ld bytes lost in %d blocks\n", sum, nbBlocks);
-
289 }
+

This function is called when the program exits. It loop through the mem_info list and if it's not empty, it prints the memory leaks.

Returns
Nothing.
+
265{
+ +
267 mem_info* previous = NULL;
+
268 size_t sum = 0;
+
269 int nbBlocks = 0;
+
270
+
271 if (tmp)
+
272 {
+
273 printf("Memory Leaks detected.\n");
+
274 }
+
275
+
276 while (tmp)
+
277 {
+
278 previous = tmp;
+
279 printf("\n%ld bytes lost\n", tmp->bytes);
+
280 printf("address : 0x%p in %s\t%s:%d\n", tmp->ptr, tmp->functionName, tmp->fileName, tmp->line);
+
281 printf("\n====================================\n");
+
282 sum += tmp->bytes;
+
283 tmp = tmp->next;
+
284 free(previous);
+
285 nbBlocks++;
+
286 }
+
287
+
288 printf("SUMMARY :\n%ld bytes lost in %d blocks\n", sum, nbBlocks);
+
289}
@@ -462,7 +461,7 @@ Here is the call graph for this function: diff --git a/d2/ddd/malloc__dbg_8h.js b/d2/ddd/malloc__dbg_8h.js index 56736e204..274369964 100644 --- a/d2/ddd/malloc__dbg_8h.js +++ b/d2/ddd/malloc__dbg_8h.js @@ -3,8 +3,8 @@ var malloc__dbg_8h = [ "calloc", "d2/ddd/malloc__dbg_8h.html#afdddaa949a93c1ef559a638e98f9c21b", null ], [ "free", "d2/ddd/malloc__dbg_8h.html#a9cc854374299a1dd933bf62029761768", null ], [ "malloc", "d2/ddd/malloc__dbg_8h.html#a725f50ecaf1959d96de79b36b4788fee", null ], - [ "calloc_dbg", "d2/ddd/malloc__dbg_8h.html#aec6b5ee323e5338f23a1ce6fe9974f25", null ], + [ "calloc_dbg", "d2/ddd/malloc__dbg_8h.html#ab07f946b77155ca78d0e14e231a99f5d", null ], [ "free_dbg", "d2/ddd/malloc__dbg_8h.html#a3f9195a04ac8e8a9868ee3e416db7e8c", null ], - [ "malloc_dbg", "d2/ddd/malloc__dbg_8h.html#a10238aaeea60178d31fbb74347e941aa", null ], + [ "malloc_dbg", "d2/ddd/malloc__dbg_8h.html#a37914d05ba1fe8848aa1b48cda719422", null ], [ "printLeaks", "d2/ddd/malloc__dbg_8h.html#abfd0a4452069af4cfefe4a5d037e92ef", null ] ]; \ No newline at end of file diff --git a/d2/ddd/malloc__dbg_8h_a10238aaeea60178d31fbb74347e941aa_cgraph.md5 b/d2/ddd/malloc__dbg_8h_a10238aaeea60178d31fbb74347e941aa_cgraph.md5 deleted file mode 100644 index 41d2cfb14..000000000 --- a/d2/ddd/malloc__dbg_8h_a10238aaeea60178d31fbb74347e941aa_cgraph.md5 +++ /dev/null @@ -1 +0,0 @@ -883964604d5a2e6efe014e00549c992a \ No newline at end of file diff --git a/d2/ddd/malloc__dbg_8h_a10238aaeea60178d31fbb74347e941aa_cgraph.svg b/d2/ddd/malloc__dbg_8h_a10238aaeea60178d31fbb74347e941aa_cgraph.svg deleted file mode 100644 index d18bec242..000000000 --- a/d2/ddd/malloc__dbg_8h_a10238aaeea60178d31fbb74347e941aa_cgraph.svg +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - -malloc_dbg - - - -Node1 - - -malloc_dbg - - - - - -Node2 - - -addMemInfo - - - - - -Node1->Node2 - - - - - -Node3 - - -editInfo - - - - - -Node1->Node3 - - - - - -Node4 - - -inList - - - - - -Node1->Node4 - - - - - -Node5 - - -printLeaks - - - - - -Node1->Node5 - - - - - diff --git a/d2/ddd/malloc__dbg_8h_a10238aaeea60178d31fbb74347e941aa_cgraph.map b/d2/ddd/malloc__dbg_8h_a37914d05ba1fe8848aa1b48cda719422_cgraph.map similarity index 75% rename from d2/ddd/malloc__dbg_8h_a10238aaeea60178d31fbb74347e941aa_cgraph.map rename to d2/ddd/malloc__dbg_8h_a37914d05ba1fe8848aa1b48cda719422_cgraph.map index 05c8f8e31..978fff1c8 100644 --- a/d2/ddd/malloc__dbg_8h_a10238aaeea60178d31fbb74347e941aa_cgraph.map +++ b/d2/ddd/malloc__dbg_8h_a37914d05ba1fe8848aa1b48cda719422_cgraph.map @@ -1,7 +1,7 @@ - - - - - + + + + + diff --git a/d2/ddd/malloc__dbg_8h_a37914d05ba1fe8848aa1b48cda719422_cgraph.md5 b/d2/ddd/malloc__dbg_8h_a37914d05ba1fe8848aa1b48cda719422_cgraph.md5 new file mode 100644 index 000000000..3d8de952c --- /dev/null +++ b/d2/ddd/malloc__dbg_8h_a37914d05ba1fe8848aa1b48cda719422_cgraph.md5 @@ -0,0 +1 @@ +e4bbeeb6a12e95bff435929e543e0d4a \ No newline at end of file diff --git a/d2/ddd/malloc__dbg_8h_a37914d05ba1fe8848aa1b48cda719422_cgraph.svg b/d2/ddd/malloc__dbg_8h_a37914d05ba1fe8848aa1b48cda719422_cgraph.svg new file mode 100644 index 000000000..81ef784ef --- /dev/null +++ b/d2/ddd/malloc__dbg_8h_a37914d05ba1fe8848aa1b48cda719422_cgraph.svg @@ -0,0 +1,82 @@ + + + + + + +malloc_dbg + + + +Node1 + + +malloc_dbg + + + + + +Node2 + + +addMemInfo + + + + + +Node1->Node2 + + + + + +Node3 + + +editInfo + + + + + +Node1->Node3 + + + + + +Node4 + + +inList + + + + + +Node1->Node4 + + + + + +Node5 + + +printLeaks + + + + + +Node1->Node5 + + + + + diff --git a/d2/ddd/malloc__dbg_8h_aec6b5ee323e5338f23a1ce6fe9974f25_cgraph.map b/d2/ddd/malloc__dbg_8h_ab07f946b77155ca78d0e14e231a99f5d_cgraph.map similarity index 64% rename from d2/ddd/malloc__dbg_8h_aec6b5ee323e5338f23a1ce6fe9974f25_cgraph.map rename to d2/ddd/malloc__dbg_8h_ab07f946b77155ca78d0e14e231a99f5d_cgraph.map index f76eb08b2..c95d3a0e6 100644 --- a/d2/ddd/malloc__dbg_8h_aec6b5ee323e5338f23a1ce6fe9974f25_cgraph.map +++ b/d2/ddd/malloc__dbg_8h_ab07f946b77155ca78d0e14e231a99f5d_cgraph.map @@ -1,5 +1,5 @@ - - - + + + diff --git a/d2/ddd/malloc__dbg_8h_ab07f946b77155ca78d0e14e231a99f5d_cgraph.md5 b/d2/ddd/malloc__dbg_8h_ab07f946b77155ca78d0e14e231a99f5d_cgraph.md5 new file mode 100644 index 000000000..15b57be4a --- /dev/null +++ b/d2/ddd/malloc__dbg_8h_ab07f946b77155ca78d0e14e231a99f5d_cgraph.md5 @@ -0,0 +1 @@ +05191848183ce036223fb8421a225d5f \ No newline at end of file diff --git a/db/d84/malloc__dbg_8c_aec6b5ee323e5338f23a1ce6fe9974f25_cgraph.svg b/d2/ddd/malloc__dbg_8h_ab07f946b77155ca78d0e14e231a99f5d_cgraph.svg similarity index 51% rename from db/d84/malloc__dbg_8c_aec6b5ee323e5338f23a1ce6fe9974f25_cgraph.svg rename to d2/ddd/malloc__dbg_8h_ab07f946b77155ca78d0e14e231a99f5d_cgraph.svg index 379010c59..10b1be1df 100644 --- a/db/d84/malloc__dbg_8c_aec6b5ee323e5338f23a1ce6fe9974f25_cgraph.svg +++ b/d2/ddd/malloc__dbg_8h_ab07f946b77155ca78d0e14e231a99f5d_cgraph.svg @@ -1,52 +1,52 @@ - - + calloc_dbg - + Node1 - -calloc_dbg + +calloc_dbg Node2 - - -addMemInfo + + +addMemInfo Node1->Node2 - - + + Node3 - -printLeaks + +printLeaks Node1->Node3 - - + + diff --git a/d2/ddd/malloc__dbg_8h_aec6b5ee323e5338f23a1ce6fe9974f25_cgraph.md5 b/d2/ddd/malloc__dbg_8h_aec6b5ee323e5338f23a1ce6fe9974f25_cgraph.md5 deleted file mode 100644 index 3376b8c70..000000000 --- a/d2/ddd/malloc__dbg_8h_aec6b5ee323e5338f23a1ce6fe9974f25_cgraph.md5 +++ /dev/null @@ -1 +0,0 @@ -37df4a1dd5f2e169d982f7e139354d13 \ No newline at end of file diff --git a/d2/ddd/malloc__dbg_8h_source.html b/d2/ddd/malloc__dbg_8h_source.html index bf5d1f98c..d0621167f 100644 --- a/d2/ddd/malloc__dbg_8h_source.html +++ b/d2/ddd/malloc__dbg_8h_source.html @@ -2,8 +2,8 @@ - - + +Algorithms_in_C: developer_tools/malloc_dbg.h Source File @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ @@ -42,21 +41,22 @@
bytesSize of the allocation in bytes
filenameCaller file
-
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,57 +90,56 @@ $(document).ready(function(){initNavTree('d2/ddd/malloc__dbg_8h_source.html','..
-
-
malloc_dbg.h
+
malloc_dbg.h
-Go to the documentation of this file.
1 /**
-
2  * @file
-
3  * @brief Header file that contains macros used to replace malloc/calloc and free.
-
4  * @details
-
5  * Macros malloc, calloc and free respectively calls malloc_dbg, calloc_dbg and free_dbg.
-
6  * malloc_dbg and calloc_dbg allocates memory using the "real" malloc and calloc and store
-
7  * the pointer returned (with additional informations) in a linked list.
-
8  * Thanks to this linked list, it is possible to check memory leaks.
-
9  * @author [tinouduart33](https://github.com/tinouduart33)
-
10  * @see malloc_dbg.c
-
11  */
-
12 
-
13 #ifndef MALLOC_DBG_H
-
14 #define MALLOC_DBG_H
-
15 
-
16  /** This macro replace the standard malloc function with malloc_dbg.
-
17  * */
-
18 #define malloc(bytes) malloc_dbg(bytes, __LINE__, __FILE__, __FUNCTION__)
-
19 
-
20  /** This macro replace the standard calloc function with calloc_dbg.
-
21  * */
-
22 #define calloc(elemCount, elemSize) calloc_dbg(elemCount, elemSize, __LINE__, __FILE__, __FUNCTION__)
-
23 
-
24  /** This macro replace the standard free function with free_dbg.
-
25  * */
-
26 #define free(ptr) free_dbg(ptr)
-
27 
-
28 void* malloc_dbg(size_t bytes, int line, const char* filename, const char* functionName);
-
29 
-
30 void* calloc_dbg(size_t elementCount, size_t elementSize, int line, const char* filename, const char* functionName);
-
31 
-
32 void free_dbg(void* ptrToFree);
-
33 
-
34 void printLeaks(void);
-
35 
-
36 #endif /* MALLOC_DBG_H */
-
void * malloc_dbg(size_t bytes, int line, const char *filename, const char *functionName)
malloc_dbg function is a wrapper around the malloc function.
Definition: malloc_dbg.c:129
+Go to the documentation of this file.
1/**
+
2 * @file
+
3 * @brief Header file that contains macros used to replace malloc/calloc and free.
+
4 * @details
+
5 * Macros malloc, calloc and free respectively calls malloc_dbg, calloc_dbg and free_dbg.
+
6 * malloc_dbg and calloc_dbg allocates memory using the "real" malloc and calloc and store
+
7 * the pointer returned (with additional informations) in a linked list.
+
8 * Thanks to this linked list, it is possible to check memory leaks.
+
9 * @author [tinouduart33](https://github.com/tinouduart33)
+
10 * @see malloc_dbg.c
+
11 */
+
12
+
13#ifndef MALLOC_DBG_H
+
14#define MALLOC_DBG_H
+
15
+
16 /** This macro replace the standard malloc function with malloc_dbg.
+
17 * */
+
18#define malloc(bytes) malloc_dbg(bytes, __LINE__, __FILE__, __FUNCTION__)
+
19
+
20 /** This macro replace the standard calloc function with calloc_dbg.
+
21 * */
+
22#define calloc(elemCount, elemSize) calloc_dbg(elemCount, elemSize, __LINE__, __FILE__, __FUNCTION__)
+
23
+
24 /** This macro replace the standard free function with free_dbg.
+
25 * */
+
26#define free(ptr) free_dbg(ptr)
+
27
+
28void* malloc_dbg(size_t bytes, int line, const char* filename, const char* functionName);
+
29
+
30void* calloc_dbg(size_t elementCount, size_t elementSize, int line, const char* filename, const char* functionName);
+
31
+
32void free_dbg(void* ptrToFree);
+
33
+
34void printLeaks(void);
+
35
+
36#endif /* MALLOC_DBG_H */
+
void * malloc_dbg(size_t bytes, int line, const char *filename, const char *functionName)
malloc_dbg function is a wrapper around the malloc function.
Definition: malloc_dbg.c:129
void free_dbg(void *ptrToFree)
free_dbg function is used to free the memory allocated to a pointer.
Definition: malloc_dbg.c:208
+
void * calloc_dbg(size_t elementCount, size_t elementSize, int line, const char *filename, const char *functionName)
calloc_dbg function is a wrapper around the calloc function.
Definition: malloc_dbg.c:174
void printLeaks(void)
printLeaks function is used to print all the memory leaks.
Definition: malloc_dbg.c:264
-
void * calloc_dbg(size_t elementCount, size_t elementSize, int line, const char *filename, const char *functionName)
calloc_dbg function is a wrapper around the calloc function.
Definition: malloc_dbg.c:174
diff --git a/d2/ddf/struct_l__coll__graph.svg b/d2/ddf/struct_l__coll__graph.svg index 119b9d714..866fd9686 100644 --- a/d2/ddf/struct_l__coll__graph.svg +++ b/d2/ddf/struct_l__coll__graph.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C: euler_ 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() {
@@ -92,8 +92,7 @@ $(document).ready(function(){initNavTree('d2/de8/structeuler__.html','../../');
@@ -102,47 +101,47 @@ $(document).ready(function(){initNavTree('d2/de8/structeuler__.html','../../');

#include <geometry_datatypes.h>

- - +   float   roll +   float   bank - +   float   pitch +   float   elevation - +   float   yaw +   float   heading

+

Data Fields

+
union {
-   float   roll
 or bank \(\phi\) = rotation about X axis
 
-   float   bank
 or roll \(\phi\) = rotation about X axis
 
}; 
 
+
union {
-   float   pitch
 or elevation \(\theta\) = rotation about Y axis
 
-   float   elevation
 or pitch \(\theta\) = rotation about Y axis
 
}; 
 
+
union {
-   float   yaw
 or heading \(\psi\) = rotation about Z axis
 
-   float   heading
 or yaw \(\psi\) = rotation about Z axis
 
}; 
 

Detailed Description

-

3D Euler or Tait-Bryan angles (in radian)

+

3D Euler or Tait-Bryan angles (in radian)


The documentation for this struct was generated from the following file: @@ -152,7 +151,7 @@ union { diff --git a/d2/de9/realtime__stats_8c__incl.map b/d2/de9/realtime__stats_8c__incl.map index e9e5693da..6a48d1e83 100644 --- a/d2/de9/realtime__stats_8c__incl.map +++ b/d2/de9/realtime__stats_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/d2/de9/realtime__stats_8c__incl.svg b/d2/de9/realtime__stats_8c__incl.svg index 48b12e2ec..6fd41b09e 100644 --- a/d2/de9/realtime__stats_8c__incl.svg +++ b/d2/de9/realtime__stats_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - -numerical_methods/realtime + +numerical_methods/realtime _stats.c diff --git a/d2/df6/kohonen__som__topology_8c.html b/d2/df6/kohonen__som__topology_8c.html index cfcfb8294..d7632314e 100644 --- a/d2/df6/kohonen__som__topology_8c.html +++ b/d2/df6/kohonen__som__topology_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: machine_learning/kohonen_som_topology.c 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/df6/kohonen__som__topology_8c.html' Data Structures | Macros | Functions -
-
kohonen_som_topology.c File Reference
+
kohonen_som_topology.c File Reference
-

Kohonen self organizing map (topological map) +

Kohonen self organizing map (topological map) More...

#include <math.h>
#include <stdio.h>
@@ -112,32 +111,32 @@ Include dependency graph for kohonen_som_topology.c:
-

+

Data Structures

struct  kohonen_array_3d
 to store info regarding 3D arrays More...
 
- - + +#define  +#define 

+

Macros

-#define _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES
 required for MS Visual C
 
-#define max(a, b)   (((a) > (b)) ? (a) : (b))
max(a, b)   (((a) > (b)) ? (a) : (b))
 shorthand for maximum value
 
-#define min(a, b)   (((a) < (b)) ? (a) : (b))
min(a, b)   (((a) < (b)) ? (a) : (b))
 shorthand for minimum value
 
- - - - + + + @@ -145,7 +144,7 @@ Functions - + @@ -177,18 +176,17 @@ Functions - - + +

+

Functions

double * kohonen_data_3d (const struct kohonen_array_3d *arr, int x, int y, int z)
 Function that returns the pointer to (x, y, z) ^th location in the linear 3D array given by: More...
 
double * kohonen_data_3d (const struct kohonen_array_3d *arr, int x, int y, int z)
 Function that returns the pointer to (x, y, z) ^th location in the linear 3D array given by: More...
 
double _random (double a, double b)
 Helper function to generate a random number in a given interval. More...
 
 Save a given n-dimensional data martix to file. More...
 
int save_u_matrix (const char *fname, struct kohonen_array_3d *W)
 Create the distance matrix or U-matrix from the trained weights and save to disk. More...
 Create the distance matrix or U-matrix from the trained weights and save to disk. More...
 
void get_min_2d (double **X, int N, double *val, int *x_idx, int *y_idx)
 Get minimum value and index of the value in a matrix. More...
double get_clock_diff (clock_t start_t, clock_t end_t)
 Convert clock cycle difference to time in seconds. More...
 
-int main (int argc, char **argv)
 Main function.
int main (int argc, char **argv)
 Main function. More...
 

Detailed Description

-

Kohonen self organizing map (topological map)

-

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 various data points in a much higher dimensional space by creating an equivalent in a 2-dimensional space. Trained topological maps for the test cases in the program

Author
Krishna Vedala
+

Kohonen self organizing map (topological map)

+

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 various data points in a much higher dimensional space by creating an equivalent in a 2-dimensional space. Trained topological maps for the test cases in the program

Author
Krishna Vedala
Warning
MSVC 2019 compiler generates code that does not execute as expected. However, MinGW, Clang for GCC and Clang for MSVC compilers on windows perform as expected. Any insights and suggestions should be directed to the author.
See also
kohonen_som_trace.c

Function Documentation

- +

◆ get_clock_diff()

@@ -223,13 +221,82 @@ int 
Returns
time difference in seconds
-
664 {
-
665  return (double)(end_t - start_t) / (double)CLOCKS_PER_SEC;
-
666 }
+
664{
+
665 return (double)(end_t - start_t) / (double)CLOCKS_PER_SEC;
+
666}
- + +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char ** argv 
)
+
+ +

Main function.

+
670{
+
671#ifdef _OPENMP
+
672 printf("Using OpenMP based parallelization\n");
+
673#else
+
674 printf("NOT using OpenMP based parallelization\n");
+
675#endif
+
676 clock_t start_clk, end_clk;
+
677
+
678 start_clk = clock();
+
679 test1();
+
680 end_clk = clock();
+
681 printf("Test 1 completed in %.4g sec\n",
+
682 get_clock_diff(start_clk, end_clk));
+
683
+
684 start_clk = clock();
+
685 test2();
+
686 end_clk = clock();
+
687 printf("Test 2 completed in %.4g sec\n",
+
688 get_clock_diff(start_clk, end_clk));
+
689
+
690 start_clk = clock();
+
691 test3();
+
692 end_clk = clock();
+
693 printf("Test 3 completed in %.4g sec\n",
+
694 get_clock_diff(start_clk, end_clk));
+
695
+
696 printf("(Note: Calculated times include: writing files to disk.)\n\n");
+
697 return 0;
+
698}
+
void test2()
Test that creates a random set of points distributed in 4 clusters in 3D space and trains an SOM that...
Definition: kohonen_som_topology.c:506
+
void test1()
Test that creates a random set of points distributed in four clusters in 2D space and trains an SOM t...
Definition: kohonen_som_topology.c:406
+
double get_clock_diff(clock_t start_t, clock_t end_t)
Convert clock cycle difference to time in seconds.
Definition: kohonen_som_topology.c:663
+
void test3()
Test that creates a random set of points distributed in eight clusters in 3D space and trains an SOM ...
Definition: kohonen_som_topology.c:609
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+

◆ test1()

@@ -245,61 +312,61 @@ int 

Test that creates a random set of points distributed in four clusters in 2D space and trains an SOM that finds the topological pattern.

-

The following CSV files are created to validate the execution:

    +

    The following CSV files are created to validate the execution:

    • test1.csv: random test samples points with a circular pattern
    • w11.csv: initial random U-matrix
    • w12.csv: trained SOM U-matrix
    -
    407 {
    -
    408  int j, N = 300;
    -
    409  int features = 2;
    -
    410  int num_out = 30; // image size - N x N
    -
    411 
    -
    412  // 2D space, hence size = number of rows * 2
    -
    413  double **X = (double **)malloc(N * sizeof(double *));
    -
    414 
    -
    415  // cluster nodex in 'x' * cluster nodes in 'y' * 2
    -
    416  struct kohonen_array_3d W;
    -
    417  W.dim1 = num_out;
    -
    418  W.dim2 = num_out;
    -
    419  W.dim3 = features;
    -
    420  W.data = (double *)malloc(num_out * num_out * features *
    -
    421  sizeof(double)); // assign rows
    -
    422 
    -
    423  for (int i = 0; i < max(num_out, N); i++) // loop till max(N, num_out)
    -
    424  {
    -
    425  if (i < N) // only add new arrays if i < N
    -
    426  X[i] = (double *)malloc(features * sizeof(double));
    -
    427  if (i < num_out) // only add new arrays if i < num_out
    -
    428  {
    -
    429  for (int k = 0; k < num_out; k++)
    -
    430  {
    -
    431 #ifdef _OPENMP
    -
    432 #pragma omp for
    -
    433 #endif
    -
    434  // preallocate with random initial weights
    -
    435  for (j = 0; j < features; j++)
    -
    436  {
    -
    437  double *w = kohonen_data_3d(&W, i, k, j);
    -
    438  w[0] = _random(-5, 5);
    -
    439  }
    -
    440  }
    -
    441  }
    -
    442  }
    -
    443 
    -
    444  test_2d_classes(X, N); // create test data around circumference of a circle
    -
    445  save_2d_data("test1.csv", X, N, features); // save test data points
    -
    446  save_u_matrix("w11.csv", &W); // save initial random weights
    -
    447  kohonen_som(X, &W, N, features, num_out, 1e-4); // train the SOM
    -
    448  save_u_matrix("w12.csv", &W); // save the resultant weights
    -
    449 
    -
    450  for (int i = 0; i < N; i++) free(X[i]);
    -
    451  free(X);
    -
    452  free(W.data);
    -
    453 }
    +
    407{
    +
    408 int j, N = 300;
    +
    409 int features = 2;
    +
    410 int num_out = 30; // image size - N x N
    +
    411
    +
    412 // 2D space, hence size = number of rows * 2
    +
    413 double **X = (double **)malloc(N * sizeof(double *));
    +
    414
    +
    415 // cluster nodex in 'x' * cluster nodes in 'y' * 2
    +
    416 struct kohonen_array_3d W;
    +
    417 W.dim1 = num_out;
    +
    418 W.dim2 = num_out;
    +
    419 W.dim3 = features;
    +
    420 W.data = (double *)malloc(num_out * num_out * features *
    +
    421 sizeof(double)); // assign rows
    +
    422
    +
    423 for (int i = 0; i < max(num_out, N); i++) // loop till max(N, num_out)
    +
    424 {
    +
    425 if (i < N) // only add new arrays if i < N
    +
    426 X[i] = (double *)malloc(features * sizeof(double));
    +
    427 if (i < num_out) // only add new arrays if i < num_out
    +
    428 {
    +
    429 for (int k = 0; k < num_out; k++)
    +
    430 {
    +
    431#ifdef _OPENMP
    +
    432#pragma omp for
    +
    433#endif
    +
    434 // preallocate with random initial weights
    +
    435 for (j = 0; j < features; j++)
    +
    436 {
    +
    437 double *w = kohonen_data_3d(&W, i, k, j);
    +
    438 w[0] = _random(-5, 5);
    +
    439 }
    +
    440 }
    +
    441 }
    +
    442 }
    +
    443
    +
    444 test_2d_classes(X, N); // create test data around circumference of a circle
    +
    445 save_2d_data("test1.csv", X, N, features); // save test data points
    +
    446 save_u_matrix("w11.csv", &W); // save initial random weights
    +
    447 kohonen_som(X, &W, N, features, num_out, 1e-4); // train the SOM
    +
    448 save_u_matrix("w12.csv", &W); // save the resultant weights
    +
    449
    +
    450 for (int i = 0; i < N; i++) free(X[i]);
    +
    451 free(X);
    +
    452 free(W.data);
    +
    453}
    int save_u_matrix(const char *fname, struct kohonen_array_3d *W)
    Create the distance matrix or U-matrix from the trained weights and save to disk.
    Definition: kohonen_som_topology.c:139
    int save_2d_data(const char *fname, double **X, int num_points, int num_features)
    Save a given n-dimensional data martix to file.
    Definition: kohonen_som_topology.c:102
    -
    double * kohonen_data_3d(const struct kohonen_array_3d *arr, int x, int y, int z)
    Function that returns the pointer to (x, y, z) ^th location in the linear 3D array given by:
    Definition: kohonen_som_topology.c:67
    +
    double * kohonen_data_3d(const struct kohonen_array_3d *arr, int x, int y, int z)
    Function that returns the pointer to (x, y, z) ^th location in the linear 3D array given by:
    Definition: kohonen_som_topology.c:67
    void kohonen_som(double **X, struct kohonen_array_3d *W, int num_samples, int num_features, int num_out, double alpha_min)
    Apply incremental algorithm with updating neighborhood and learning rates on all samples in the given...
    Definition: kohonen_som_topology.c:314
    double _random(double a, double b)
    Helper function to generate a random number in a given interval.
    Definition: kohonen_som_topology.c:87
    #define max(a, b)
    shorthand for maximum value
    Definition: kohonen_som_topology.c:39
    @@ -311,13 +378,13 @@ int  Here is the call graph for this function:
    -
    +
    - +

    ◆ test2()

    @@ -333,68 +400,68 @@ 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:

    +

    The following CSV files are created to validate the execution:

    • test2.csv: random test samples points
    • w21.csv: initial random U-matrix
    • w22.csv: trained SOM U-matrix
    -
    507 {
    -
    508  int j, N = 500;
    -
    509  int features = 3;
    -
    510  int num_out = 30; // image size - N x N
    -
    511 
    -
    512  // 3D space, hence size = number of rows * 3
    -
    513  double **X = (double **)malloc(N * sizeof(double *));
    -
    514 
    -
    515  // cluster nodex in 'x' * cluster nodes in 'y' * 2
    -
    516  struct kohonen_array_3d W;
    -
    517  W.dim1 = num_out;
    -
    518  W.dim2 = num_out;
    -
    519  W.dim3 = features;
    -
    520  W.data = (double *)malloc(num_out * num_out * features *
    -
    521  sizeof(double)); // assign rows
    -
    522 
    -
    523  for (int i = 0; i < max(num_out, N); i++) // loop till max(N, num_out)
    -
    524  {
    -
    525  if (i < N) // only add new arrays if i < N
    -
    526  X[i] = (double *)malloc(features * sizeof(double));
    -
    527  if (i < num_out) // only add new arrays if i < num_out
    -
    528  {
    -
    529  for (int k = 0; k < num_out; k++)
    -
    530  {
    -
    531 #ifdef _OPENMP
    -
    532 #pragma omp for
    -
    533 #endif
    -
    534  for (j = 0; j < features; j++)
    -
    535  { // preallocate with random initial weights
    -
    536  double *w = kohonen_data_3d(&W, i, k, j);
    -
    537  w[0] = _random(-5, 5);
    -
    538  }
    -
    539  }
    -
    540  }
    -
    541  }
    -
    542 
    -
    543  test_3d_classes1(X, N); // create test data
    -
    544  save_2d_data("test2.csv", X, N, features); // save test data points
    -
    545  save_u_matrix("w21.csv", &W); // save initial random weights
    -
    546  kohonen_som(X, &W, N, features, num_out, 1e-4); // train the SOM
    -
    547  save_u_matrix("w22.csv", &W); // save the resultant weights
    -
    548 
    -
    549  for (int i = 0; i < N; i++) free(X[i]);
    -
    550  free(X);
    -
    551  free(W.data);
    -
    552 }
    +
    507{
    +
    508 int j, N = 500;
    +
    509 int features = 3;
    +
    510 int num_out = 30; // image size - N x N
    +
    511
    +
    512 // 3D space, hence size = number of rows * 3
    +
    513 double **X = (double **)malloc(N * sizeof(double *));
    +
    514
    +
    515 // cluster nodex in 'x' * cluster nodes in 'y' * 2
    +
    516 struct kohonen_array_3d W;
    +
    517 W.dim1 = num_out;
    +
    518 W.dim2 = num_out;
    +
    519 W.dim3 = features;
    +
    520 W.data = (double *)malloc(num_out * num_out * features *
    +
    521 sizeof(double)); // assign rows
    +
    522
    +
    523 for (int i = 0; i < max(num_out, N); i++) // loop till max(N, num_out)
    +
    524 {
    +
    525 if (i < N) // only add new arrays if i < N
    +
    526 X[i] = (double *)malloc(features * sizeof(double));
    +
    527 if (i < num_out) // only add new arrays if i < num_out
    +
    528 {
    +
    529 for (int k = 0; k < num_out; k++)
    +
    530 {
    +
    531#ifdef _OPENMP
    +
    532#pragma omp for
    +
    533#endif
    +
    534 for (j = 0; j < features; j++)
    +
    535 { // preallocate with random initial weights
    +
    536 double *w = kohonen_data_3d(&W, i, k, j);
    +
    537 w[0] = _random(-5, 5);
    +
    538 }
    +
    539 }
    +
    540 }
    +
    541 }
    +
    542
    +
    543 test_3d_classes1(X, N); // create test data
    +
    544 save_2d_data("test2.csv", X, N, features); // save test data points
    +
    545 save_u_matrix("w21.csv", &W); // save initial random weights
    +
    546 kohonen_som(X, &W, N, features, num_out, 1e-4); // train the SOM
    +
    547 save_u_matrix("w22.csv", &W); // save the resultant weights
    +
    548
    +
    549 for (int i = 0; i < N; i++) free(X[i]);
    +
    550 free(X);
    +
    551 free(W.data);
    +
    552}
    void test_3d_classes1(double *const *data, int N)
    Creates a random set of points distributed in four clusters in 3D space with centroids at the points.
    Definition: kohonen_som_topology.c:465
    Here is the call graph for this function:
    -
    +
    - +

    ◆ test3()

    @@ -410,67 +477,67 @@ 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:

    +

    The following CSV files are created to validate the execution:

    • test3.csv: random test samples points
    • w31.csv: initial random U-matrix
    • w32.csv: trained SOM U-matrix
    -
    610 {
    -
    611  int j, N = 500;
    -
    612  int features = 3;
    -
    613  int num_out = 30;
    -
    614  double **X = (double **)malloc(N * sizeof(double *));
    -
    615 
    -
    616  // cluster nodex in 'x' * cluster nodes in 'y' * 2
    -
    617  struct kohonen_array_3d W;
    -
    618  W.dim1 = num_out;
    -
    619  W.dim2 = num_out;
    -
    620  W.dim3 = features;
    -
    621  W.data = (double *)malloc(num_out * num_out * features *
    -
    622  sizeof(double)); // assign rows
    -
    623 
    -
    624  for (int i = 0; i < max(num_out, N); i++) // loop till max(N, num_out)
    -
    625  {
    -
    626  if (i < N) // only add new arrays if i < N
    -
    627  X[i] = (double *)malloc(features * sizeof(double));
    -
    628  if (i < num_out) // only add new arrays if i < num_out
    -
    629  {
    -
    630  for (int k = 0; k < num_out; k++)
    -
    631  {
    -
    632 #ifdef _OPENMP
    -
    633 #pragma omp for
    -
    634 #endif
    -
    635  // preallocate with random initial weights
    -
    636  for (j = 0; j < features; j++)
    -
    637  {
    -
    638  double *w = kohonen_data_3d(&W, i, k, j);
    -
    639  w[0] = _random(-5, 5);
    -
    640  }
    -
    641  }
    -
    642  }
    -
    643  }
    -
    644 
    -
    645  test_3d_classes2(X, N); // create test data around the lamniscate
    -
    646  save_2d_data("test3.csv", X, N, features); // save test data points
    -
    647  save_u_matrix("w31.csv", &W); // save initial random weights
    -
    648  kohonen_som(X, &W, N, features, num_out, 0.01); // train the SOM
    -
    649  save_u_matrix("w32.csv", &W); // save the resultant weights
    -
    650 
    -
    651  for (int i = 0; i < N; i++) free(X[i]);
    -
    652  free(X);
    -
    653  free(W.data);
    -
    654 }
    +
    610{
    +
    611 int j, N = 500;
    +
    612 int features = 3;
    +
    613 int num_out = 30;
    +
    614 double **X = (double **)malloc(N * sizeof(double *));
    +
    615
    +
    616 // cluster nodex in 'x' * cluster nodes in 'y' * 2
    +
    617 struct kohonen_array_3d W;
    +
    618 W.dim1 = num_out;
    +
    619 W.dim2 = num_out;
    +
    620 W.dim3 = features;
    +
    621 W.data = (double *)malloc(num_out * num_out * features *
    +
    622 sizeof(double)); // assign rows
    +
    623
    +
    624 for (int i = 0; i < max(num_out, N); i++) // loop till max(N, num_out)
    +
    625 {
    +
    626 if (i < N) // only add new arrays if i < N
    +
    627 X[i] = (double *)malloc(features * sizeof(double));
    +
    628 if (i < num_out) // only add new arrays if i < num_out
    +
    629 {
    +
    630 for (int k = 0; k < num_out; k++)
    +
    631 {
    +
    632#ifdef _OPENMP
    +
    633#pragma omp for
    +
    634#endif
    +
    635 // preallocate with random initial weights
    +
    636 for (j = 0; j < features; j++)
    +
    637 {
    +
    638 double *w = kohonen_data_3d(&W, i, k, j);
    +
    639 w[0] = _random(-5, 5);
    +
    640 }
    +
    641 }
    +
    642 }
    +
    643 }
    +
    644
    +
    645 test_3d_classes2(X, N); // create test data around the lamniscate
    +
    646 save_2d_data("test3.csv", X, N, features); // save test data points
    +
    647 save_u_matrix("w31.csv", &W); // save initial random weights
    +
    648 kohonen_som(X, &W, N, features, num_out, 0.01); // train the SOM
    +
    649 save_u_matrix("w32.csv", &W); // save the resultant weights
    +
    650
    +
    651 for (int i = 0; i < N; i++) free(X[i]);
    +
    652 free(X);
    +
    653 free(W.data);
    +
    654}
    void test_3d_classes2(double *const *data, int N)
    Creates a random set of points distributed in four clusters in 3D space with centroids at the points.
    Definition: kohonen_som_topology.c:564
    Here is the call graph for this function:
    -
    +
    - +

    ◆ test_2d_classes()

    @@ -510,47 +577,47 @@ Here is the call graph for this function:
    -
    367 {
    -
    368  const double R = 0.3; // radius of cluster
    -
    369  int i;
    -
    370  const int num_classes = 4;
    -
    371  const double centres[][2] = {
    -
    372  // centres of each class cluster
    -
    373  {.5, .5}, // centre of class 1
    -
    374  {.5, -.5}, // centre of class 2
    -
    375  {-.5, .5}, // centre of class 3
    -
    376  {-.5, -.5} // centre of class 4
    -
    377  };
    -
    378 
    -
    379 #ifdef _OPENMP
    -
    380 #pragma omp for
    -
    381 #endif
    -
    382  for (i = 0; i < N; i++)
    -
    383  {
    -
    384  int class =
    -
    385  rand() % num_classes; // select a random class for the point
    -
    386 
    -
    387  // create random coordinates (x,y,z) around the centre of the class
    -
    388  data[i][0] = _random(centres[class][0] - R, centres[class][0] + R);
    -
    389  data[i][1] = _random(centres[class][1] - R, centres[class][1] + R);
    -
    390 
    -
    391  /* The follosing can also be used
    -
    392  for (int j = 0; j < 2; j++)
    -
    393  data[i][j] = _random(centres[class][j] - R, centres[class][j] + R);
    -
    394  */
    -
    395  }
    -
    396 }
    +
    367{
    +
    368 const double R = 0.3; // radius of cluster
    +
    369 int i;
    +
    370 const int num_classes = 4;
    +
    371 const double centres[][2] = {
    +
    372 // centres of each class cluster
    +
    373 {.5, .5}, // centre of class 1
    +
    374 {.5, -.5}, // centre of class 2
    +
    375 {-.5, .5}, // centre of class 3
    +
    376 {-.5, -.5} // centre of class 4
    +
    377 };
    +
    378
    +
    379#ifdef _OPENMP
    +
    380#pragma omp for
    +
    381#endif
    +
    382 for (i = 0; i < N; i++)
    +
    383 {
    +
    384 int class =
    +
    385 rand() % num_classes; // select a random class for the point
    +
    386
    +
    387 // create random coordinates (x,y,z) around the centre of the class
    +
    388 data[i][0] = _random(centres[class][0] - R, centres[class][0] + R);
    +
    389 data[i][1] = _random(centres[class][1] - R, centres[class][1] + R);
    +
    390
    +
    391 /* The follosing can also be used
    +
    392 for (int j = 0; j < 2; j++)
    +
    393 data[i][j] = _random(centres[class][j] - R, centres[class][j] + R);
    +
    394 */
    +
    395 }
    +
    396}
    Definition: prime_factoriziation.c:25
    Here is the call graph for this function:
    -
    +
    - +

    ◆ test_3d_classes1()

    @@ -590,47 +657,47 @@ Here is the call graph for this function:
    -
    466 {
    -
    467  const double R = 0.2; // radius of cluster
    -
    468  int i;
    -
    469  const int num_classes = 4;
    -
    470  const double centres[][3] = {
    -
    471  // centres of each class cluster
    -
    472  {.5, .5, .5}, // centre of class 1
    -
    473  {.5, -.5, -.5}, // centre of class 2
    -
    474  {-.5, .5, .5}, // centre of class 3
    -
    475  {-.5, -.5 - .5} // centre of class 4
    -
    476  };
    -
    477 
    -
    478 #ifdef _OPENMP
    -
    479 #pragma omp for
    -
    480 #endif
    -
    481  for (i = 0; i < N; i++)
    -
    482  {
    -
    483  int class =
    -
    484  rand() % num_classes; // select a random class for the point
    -
    485 
    -
    486  // create random coordinates (x,y,z) around the centre of the class
    -
    487  data[i][0] = _random(centres[class][0] - R, centres[class][0] + R);
    -
    488  data[i][1] = _random(centres[class][1] - R, centres[class][1] + R);
    -
    489  data[i][2] = _random(centres[class][2] - R, centres[class][2] + R);
    -
    490 
    -
    491  /* The follosing can also be used
    -
    492  for (int j = 0; j < 3; j++)
    -
    493  data[i][j] = _random(centres[class][j] - R, centres[class][j] + R);
    -
    494  */
    -
    495  }
    -
    496 }
    +
    466{
    +
    467 const double R = 0.2; // radius of cluster
    +
    468 int i;
    +
    469 const int num_classes = 4;
    +
    470 const double centres[][3] = {
    +
    471 // centres of each class cluster
    +
    472 {.5, .5, .5}, // centre of class 1
    +
    473 {.5, -.5, -.5}, // centre of class 2
    +
    474 {-.5, .5, .5}, // centre of class 3
    +
    475 {-.5, -.5 - .5} // centre of class 4
    +
    476 };
    +
    477
    +
    478#ifdef _OPENMP
    +
    479#pragma omp for
    +
    480#endif
    +
    481 for (i = 0; i < N; i++)
    +
    482 {
    +
    483 int class =
    +
    484 rand() % num_classes; // select a random class for the point
    +
    485
    +
    486 // create random coordinates (x,y,z) around the centre of the class
    +
    487 data[i][0] = _random(centres[class][0] - R, centres[class][0] + R);
    +
    488 data[i][1] = _random(centres[class][1] - R, centres[class][1] + R);
    +
    489 data[i][2] = _random(centres[class][2] - R, centres[class][2] + R);
    +
    490
    +
    491 /* The follosing can also be used
    +
    492 for (int j = 0; j < 3; j++)
    +
    493 data[i][j] = _random(centres[class][j] - R, centres[class][j] + R);
    +
    494 */
    +
    495 }
    +
    496}
    Here is the call graph for this function:
    -
    +
    - +

    ◆ test_3d_classes2()

    @@ -670,45 +737,45 @@ Here is the call graph for this function:
    -
    565 {
    -
    566  const double R = 0.2; // radius of cluster
    -
    567  int i;
    -
    568  const int num_classes = 8;
    -
    569  const double centres[][3] = {
    -
    570  // centres of each class cluster
    -
    571  {.5, .5, .5}, // centre of class 1
    -
    572  {.5, .5, -.5}, // centre of class 2
    -
    573  {.5, -.5, .5}, // centre of class 3
    -
    574  {.5, -.5, -.5}, // centre of class 4
    -
    575  {-.5, .5, .5}, // centre of class 5
    -
    576  {-.5, .5, -.5}, // centre of class 6
    -
    577  {-.5, -.5, .5}, // centre of class 7
    -
    578  {-.5, -.5, -.5} // centre of class 8
    -
    579  };
    -
    580 
    -
    581 #ifdef _OPENMP
    -
    582 #pragma omp for
    -
    583 #endif
    -
    584  for (i = 0; i < N; i++)
    -
    585  {
    -
    586  int class =
    -
    587  rand() % num_classes; // select a random class for the point
    -
    588 
    -
    589  // create random coordinates (x,y,z) around the centre of the class
    -
    590  data[i][0] = _random(centres[class][0] - R, centres[class][0] + R);
    -
    591  data[i][1] = _random(centres[class][1] - R, centres[class][1] + R);
    -
    592  data[i][2] = _random(centres[class][2] - R, centres[class][2] + R);
    -
    593 
    -
    594  /* The follosing can also be used
    -
    595  for (int j = 0; j < 3; j++)
    -
    596  data[i][j] = _random(centres[class][j] - R, centres[class][j] + R);
    -
    597  */
    -
    598  }
    -
    599 }
    +
    565{
    +
    566 const double R = 0.2; // radius of cluster
    +
    567 int i;
    +
    568 const int num_classes = 8;
    +
    569 const double centres[][3] = {
    +
    570 // centres of each class cluster
    +
    571 {.5, .5, .5}, // centre of class 1
    +
    572 {.5, .5, -.5}, // centre of class 2
    +
    573 {.5, -.5, .5}, // centre of class 3
    +
    574 {.5, -.5, -.5}, // centre of class 4
    +
    575 {-.5, .5, .5}, // centre of class 5
    +
    576 {-.5, .5, -.5}, // centre of class 6
    +
    577 {-.5, -.5, .5}, // centre of class 7
    +
    578 {-.5, -.5, -.5} // centre of class 8
    +
    579 };
    +
    580
    +
    581#ifdef _OPENMP
    +
    582#pragma omp for
    +
    583#endif
    +
    584 for (i = 0; i < N; i++)
    +
    585 {
    +
    586 int class =
    +
    587 rand() % num_classes; // select a random class for the point
    +
    588
    +
    589 // create random coordinates (x,y,z) around the centre of the class
    +
    590 data[i][0] = _random(centres[class][0] - R, centres[class][0] + R);
    +
    591 data[i][1] = _random(centres[class][1] - R, centres[class][1] + R);
    +
    592 data[i][2] = _random(centres[class][2] - R, centres[class][2] + R);
    +
    593
    +
    594 /* The follosing can also be used
    +
    595 for (int j = 0; j < 3; j++)
    +
    596 data[i][j] = _random(centres[class][j] - R, centres[class][j] + R);
    +
    597 */
    +
    598 }
    +
    599}
    Here is the call graph for this function:
    -
    +
    @@ -720,7 +787,7 @@ Here is the call graph for this function:
    diff --git a/d2/df6/kohonen__som__topology_8c.js b/d2/df6/kohonen__som__topology_8c.js index 4d23b7ea2..2b5510d6d 100644 --- a/d2/df6/kohonen__som__topology_8c.js +++ b/d2/df6/kohonen__som__topology_8c.js @@ -6,7 +6,7 @@ var kohonen__som__topology_8c = [ "_random", "d1/d6b/group__kohonen__2d.html#gaf5ce14f026d6d231bef29161bac2b485", null ], [ "get_clock_diff", "d2/df6/kohonen__som__topology_8c.html#a2256c10b16edba377b64a44b6c656908", null ], [ "get_min_2d", "d1/d6b/group__kohonen__2d.html#gadc22d512c00a9f5799ee067f4fb90b4b", null ], - [ "kohonen_data_3d", "d1/d6b/group__kohonen__2d.html#ga8df35f04c1762a01dcf108fa13b897d6", null ], + [ "kohonen_data_3d", "d1/d6b/group__kohonen__2d.html#gac78022076d889bf2ebfb2c41d4527ceb", null ], [ "kohonen_som", "d1/d6b/group__kohonen__2d.html#gacb42eda8af6ebd6a141a34ab00a0b710", null ], [ "kohonen_update_weights", "d1/d6b/group__kohonen__2d.html#ga83abb572c60d202e100595a989dfe123", null ], [ "main", "d2/df6/kohonen__som__topology_8c.html#a3c04138a5bfe5d72780bb7e82a18e627", null ], diff --git a/d2/df6/kohonen__som__topology_8c_a0283886819c7c140a023582b7269e2d0_cgraph.map b/d2/df6/kohonen__som__topology_8c_a0283886819c7c140a023582b7269e2d0_cgraph.map index 4cc270091..ade81074d 100644 --- a/d2/df6/kohonen__som__topology_8c_a0283886819c7c140a023582b7269e2d0_cgraph.map +++ b/d2/df6/kohonen__som__topology_8c_a0283886819c7c140a023582b7269e2d0_cgraph.map @@ -1,11 +1,11 @@ - - - - - - - - - + + + + + + + + + diff --git a/d2/df6/kohonen__som__topology_8c_a0283886819c7c140a023582b7269e2d0_cgraph.md5 b/d2/df6/kohonen__som__topology_8c_a0283886819c7c140a023582b7269e2d0_cgraph.md5 index 8f657b8e7..8606eef9f 100644 --- a/d2/df6/kohonen__som__topology_8c_a0283886819c7c140a023582b7269e2d0_cgraph.md5 +++ b/d2/df6/kohonen__som__topology_8c_a0283886819c7c140a023582b7269e2d0_cgraph.md5 @@ -1 +1 @@ -9ad97ea9ec9cfec723169a5376878a5c \ No newline at end of file +d9400d88a5ec8316a1afd011f13b4a8c \ No newline at end of file diff --git a/d2/df6/kohonen__som__topology_8c_a0283886819c7c140a023582b7269e2d0_cgraph.svg b/d2/df6/kohonen__som__topology_8c_a0283886819c7c140a023582b7269e2d0_cgraph.svg index cf5bed60a..a7f22f622 100644 --- a/d2/df6/kohonen__som__topology_8c_a0283886819c7c140a023582b7269e2d0_cgraph.svg +++ b/d2/df6/kohonen__som__topology_8c_a0283886819c7c140a023582b7269e2d0_cgraph.svg @@ -1,14 +1,14 @@ - - - + + test2 - + Node1 @@ -22,139 +22,139 @@ Node2 - -_random + +_random Node1->Node2 - - + + Node3 - - -kohonen_data_3d + + +kohonen_data_3d Node1->Node3 - - + + Node4 - -kohonen_som + +kohonen_som Node1->Node4 - - + + Node7 - -save_2d_data + +save_2d_data Node1->Node7 - - + + Node8 - -save_u_matrix + +save_u_matrix Node1->Node8 - - + + Node9 - -test_3d_classes1 + +test_3d_classes1 Node1->Node9 - - + + Node5 - -kohonen_update_weights + +kohonen_update_weights Node4->Node5 - - + + Node5->Node3 - - + + Node6 - -get_min_2d + +get_min_2d Node5->Node6 - - + + Node8->Node3 - - + + Node9->Node2 - - + + diff --git a/d2/df6/kohonen__som__topology_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.map b/d2/df6/kohonen__som__topology_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.map index 7f38d2a17..de6f197ed 100644 --- a/d2/df6/kohonen__som__topology_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.map +++ b/d2/df6/kohonen__som__topology_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.map @@ -1,11 +1,11 @@ - - - - - - - - - + + + + + + + + + diff --git a/d2/df6/kohonen__som__topology_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.md5 b/d2/df6/kohonen__som__topology_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.md5 index cf4dc0446..80cc7ac47 100644 --- a/d2/df6/kohonen__som__topology_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.md5 +++ b/d2/df6/kohonen__som__topology_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.md5 @@ -1 +1 @@ -b885f6a6cdfd05f409494bdce695a0d3 \ No newline at end of file +51b3cf40568ec612a81017e9d81910f0 \ No newline at end of file diff --git a/d2/df6/kohonen__som__topology_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg b/d2/df6/kohonen__som__topology_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg index 677d4d995..b3ed038ec 100644 --- a/d2/df6/kohonen__som__topology_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg +++ b/d2/df6/kohonen__som__topology_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg @@ -1,14 +1,14 @@ - - - + + test1 - + Node1 @@ -22,37 +22,37 @@ Node2 - -_random + +_random Node1->Node2 - - + + Node3 - - -kohonen_data_3d + + +kohonen_data_3d Node1->Node3 - - + + Node4 - + kohonen_som @@ -67,7 +67,7 @@ Node7 - + save_2d_data @@ -75,23 +75,23 @@ Node1->Node7 - - + + Node8 - -save_u_matrix + +save_u_matrix Node1->Node8 - - + + @@ -112,49 +112,49 @@ Node5 - -kohonen_update_weights + +kohonen_update_weights Node4->Node5 - - + + Node5->Node3 - - + + Node6 - -get_min_2d + +get_min_2d Node5->Node6 - - + + Node8->Node3 - - + + Node9->Node2 - - + + diff --git a/d2/df6/kohonen__som__topology_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map b/d2/df6/kohonen__som__topology_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map new file mode 100644 index 000000000..0fb7f6303 --- /dev/null +++ b/d2/df6/kohonen__som__topology_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/d2/df6/kohonen__som__topology_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 b/d2/df6/kohonen__som__topology_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 new file mode 100644 index 000000000..8658df9de --- /dev/null +++ b/d2/df6/kohonen__som__topology_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 @@ -0,0 +1 @@ +9a825e7b0f7a9af899059c691de17905 \ No newline at end of file diff --git a/d2/df6/kohonen__som__topology_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg b/d2/df6/kohonen__som__topology_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg new file mode 100644 index 000000000..918d1cc43 --- /dev/null +++ b/d2/df6/kohonen__som__topology_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg @@ -0,0 +1,410 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +get_clock_diff + + + + + +Node1->Node2 + + + + + +Node3 + + +test1 + + + + + +Node1->Node3 + + + + + +Node12 + + +test2 + + + + + +Node1->Node12 + + + + + +Node14 + + +test3 + + + + + +Node1->Node14 + + + + + +Node4 + + +_random + + + + + +Node3->Node4 + + + + + +Node5 + + +kohonen_data_3d + + + + + +Node3->Node5 + + + + + +Node6 + + +kohonen_som + + + + + +Node3->Node6 + + + + + +Node9 + + +save_2d_data + + + + + +Node3->Node9 + + + + + +Node10 + + +save_u_matrix + + + + + +Node3->Node10 + + + + + +Node11 + + +test_2d_classes + + + + + +Node3->Node11 + + + + + +Node7 + + +kohonen_update_weights + + + + + +Node6->Node7 + + + + + +Node7->Node5 + + + + + +Node8 + + +get_min_2d + + + + + +Node7->Node8 + + + + + +Node10->Node5 + + + + + +Node11->Node4 + + + + + +Node12->Node4 + + + + + +Node12->Node5 + + + + + +Node12->Node6 + + + + + +Node12->Node9 + + + + + +Node12->Node10 + + + + + +Node13 + + +test_3d_classes1 + + + + + +Node12->Node13 + + + + + +Node13->Node4 + + + + + +Node14->Node4 + + + + + +Node14->Node5 + + + + + +Node14->Node6 + + + + + +Node14->Node9 + + + + + +Node14->Node10 + + + + + +Node15 + + +test_3d_classes2 + + + + + +Node14->Node15 + + + + + +Node15->Node4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/d2/df6/kohonen__som__topology_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph_org.svg b/d2/df6/kohonen__som__topology_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph_org.svg new file mode 100644 index 000000000..2698e345f --- /dev/null +++ b/d2/df6/kohonen__som__topology_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph_org.svg @@ -0,0 +1,322 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +get_clock_diff + + + + + +Node1->Node2 + + + + + +Node3 + + +test1 + + + + + +Node1->Node3 + + + + + +Node12 + + +test2 + + + + + +Node1->Node12 + + + + + +Node14 + + +test3 + + + + + +Node1->Node14 + + + + + +Node4 + + +_random + + + + + +Node3->Node4 + + + + + +Node5 + + +kohonen_data_3d + + + + + +Node3->Node5 + + + + + +Node6 + + +kohonen_som + + + + + +Node3->Node6 + + + + + +Node9 + + +save_2d_data + + + + + +Node3->Node9 + + + + + +Node10 + + +save_u_matrix + + + + + +Node3->Node10 + + + + + +Node11 + + +test_2d_classes + + + + + +Node3->Node11 + + + + + +Node7 + + +kohonen_update_weights + + + + + +Node6->Node7 + + + + + +Node7->Node5 + + + + + +Node8 + + +get_min_2d + + + + + +Node7->Node8 + + + + + +Node10->Node5 + + + + + +Node11->Node4 + + + + + +Node12->Node4 + + + + + +Node12->Node5 + + + + + +Node12->Node6 + + + + + +Node12->Node9 + + + + + +Node12->Node10 + + + + + +Node13 + + +test_3d_classes1 + + + + + +Node12->Node13 + + + + + +Node13->Node4 + + + + + +Node14->Node4 + + + + + +Node14->Node5 + + + + + +Node14->Node6 + + + + + +Node14->Node9 + + + + + +Node14->Node10 + + + + + +Node15 + + +test_3d_classes2 + + + + + +Node14->Node15 + + + + + +Node15->Node4 + + + + + diff --git a/d2/df6/kohonen__som__topology_8c_a5bb02a8322d717ead1b11182c5f02a3a_cgraph.map b/d2/df6/kohonen__som__topology_8c_a5bb02a8322d717ead1b11182c5f02a3a_cgraph.map index 8a4cda6d0..f8901c3dc 100644 --- a/d2/df6/kohonen__som__topology_8c_a5bb02a8322d717ead1b11182c5f02a3a_cgraph.map +++ b/d2/df6/kohonen__som__topology_8c_a5bb02a8322d717ead1b11182c5f02a3a_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/d2/df6/kohonen__som__topology_8c_a5bb02a8322d717ead1b11182c5f02a3a_cgraph.svg b/d2/df6/kohonen__som__topology_8c_a5bb02a8322d717ead1b11182c5f02a3a_cgraph.svg index 6e4afe987..99cc3901b 100644 --- a/d2/df6/kohonen__som__topology_8c_a5bb02a8322d717ead1b11182c5f02a3a_cgraph.svg +++ b/d2/df6/kohonen__som__topology_8c_a5bb02a8322d717ead1b11182c5f02a3a_cgraph.svg @@ -1,20 +1,20 @@ - - + test_3d_classes2 - + Node1 - -test_3d_classes2 + +test_3d_classes2 @@ -22,16 +22,16 @@ Node2 - -_random + +_random Node1->Node2 - - + + diff --git a/d2/df6/kohonen__som__topology_8c_a6d0455dd5c30adda100e95f0423c786e_cgraph.map b/d2/df6/kohonen__som__topology_8c_a6d0455dd5c30adda100e95f0423c786e_cgraph.map index a0bbad1f3..4f981921b 100644 --- a/d2/df6/kohonen__som__topology_8c_a6d0455dd5c30adda100e95f0423c786e_cgraph.map +++ b/d2/df6/kohonen__som__topology_8c_a6d0455dd5c30adda100e95f0423c786e_cgraph.map @@ -1,11 +1,11 @@ - - - - - - - - - + + + + + + + + + diff --git a/d2/df6/kohonen__som__topology_8c_a6d0455dd5c30adda100e95f0423c786e_cgraph.md5 b/d2/df6/kohonen__som__topology_8c_a6d0455dd5c30adda100e95f0423c786e_cgraph.md5 index 583c821f9..340379bb8 100644 --- a/d2/df6/kohonen__som__topology_8c_a6d0455dd5c30adda100e95f0423c786e_cgraph.md5 +++ b/d2/df6/kohonen__som__topology_8c_a6d0455dd5c30adda100e95f0423c786e_cgraph.md5 @@ -1 +1 @@ -b3fb8ffb7de75378e8cb1aa1f0679d4f \ No newline at end of file +49f61e9d0b9dc796bb6a0c71aae7d7c7 \ No newline at end of file diff --git a/d2/df6/kohonen__som__topology_8c_a6d0455dd5c30adda100e95f0423c786e_cgraph.svg b/d2/df6/kohonen__som__topology_8c_a6d0455dd5c30adda100e95f0423c786e_cgraph.svg index 6c2521c51..ae5a31722 100644 --- a/d2/df6/kohonen__som__topology_8c_a6d0455dd5c30adda100e95f0423c786e_cgraph.svg +++ b/d2/df6/kohonen__som__topology_8c_a6d0455dd5c30adda100e95f0423c786e_cgraph.svg @@ -1,14 +1,14 @@ - - - + + test3 - + Node1 @@ -22,139 +22,139 @@ Node2 - -_random + +_random Node1->Node2 - - + + Node3 - - -kohonen_data_3d + + +kohonen_data_3d Node1->Node3 - - + + Node4 - -kohonen_som + +kohonen_som Node1->Node4 - - + + Node7 - -save_2d_data + +save_2d_data Node1->Node7 - - + + Node8 - -save_u_matrix + +save_u_matrix Node1->Node8 - - + + Node9 - -test_3d_classes2 + +test_3d_classes2 Node1->Node9 - - + + Node5 - -kohonen_update_weights + +kohonen_update_weights Node4->Node5 - - + + Node5->Node3 - - + + Node6 - -get_min_2d + +get_min_2d Node5->Node6 - - + + Node8->Node3 - - + + Node9->Node2 - - + + diff --git a/d2/df6/kohonen__som__topology_8c_ad9e25202bb8b481461f932668f249dbc_cgraph.map b/d2/df6/kohonen__som__topology_8c_ad9e25202bb8b481461f932668f249dbc_cgraph.map index 0e79c290b..99d6e34a6 100644 --- a/d2/df6/kohonen__som__topology_8c_ad9e25202bb8b481461f932668f249dbc_cgraph.map +++ b/d2/df6/kohonen__som__topology_8c_ad9e25202bb8b481461f932668f249dbc_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/d2/df6/kohonen__som__topology_8c_ad9e25202bb8b481461f932668f249dbc_cgraph.svg b/d2/df6/kohonen__som__topology_8c_ad9e25202bb8b481461f932668f249dbc_cgraph.svg index bf1bd173e..e61599e4f 100644 --- a/d2/df6/kohonen__som__topology_8c_ad9e25202bb8b481461f932668f249dbc_cgraph.svg +++ b/d2/df6/kohonen__som__topology_8c_ad9e25202bb8b481461f932668f249dbc_cgraph.svg @@ -1,20 +1,20 @@ - - + test_3d_classes1 - + Node1 - -test_3d_classes1 + +test_3d_classes1 @@ -22,16 +22,16 @@ Node2 - -_random + +_random Node1->Node2 - - + + diff --git a/d2/df6/kohonen__som__topology_8c_adb5ded007be1fd666fab9affe6764018_cgraph.map b/d2/df6/kohonen__som__topology_8c_adb5ded007be1fd666fab9affe6764018_cgraph.map index dc6facba8..9691e1d59 100644 --- a/d2/df6/kohonen__som__topology_8c_adb5ded007be1fd666fab9affe6764018_cgraph.map +++ b/d2/df6/kohonen__som__topology_8c_adb5ded007be1fd666fab9affe6764018_cgraph.map @@ -1,4 +1,4 @@ - + diff --git a/d2/df6/kohonen__som__topology_8c_adb5ded007be1fd666fab9affe6764018_cgraph.svg b/d2/df6/kohonen__som__topology_8c_adb5ded007be1fd666fab9affe6764018_cgraph.svg index cb7466e7d..ec4fec0e2 100644 --- a/d2/df6/kohonen__som__topology_8c_adb5ded007be1fd666fab9affe6764018_cgraph.svg +++ b/d2/df6/kohonen__som__topology_8c_adb5ded007be1fd666fab9affe6764018_cgraph.svg @@ -1,14 +1,14 @@ - - + test_2d_classes - + Node1 @@ -22,16 +22,16 @@ Node2 - -_random + +_random Node1->Node2 - - + + diff --git a/d3/d01/problem__21_2sol1_8c__incl.map b/d3/d01/problem__21_2sol1_8c__incl.map index 69f34dd72..54b8c9d6c 100644 --- a/d3/d01/problem__21_2sol1_8c__incl.map +++ b/d3/d01/problem__21_2sol1_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/d3/d01/problem__21_2sol1_8c__incl.svg b/d3/d01/problem__21_2sol1_8c__incl.svg index 41f829b9d..08bd3050f 100644 --- a/d3/d01/problem__21_2sol1_8c__incl.svg +++ b/d3/d01/problem__21_2sol1_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - -project_euler/problem + +project_euler/problem _21/sol1.c diff --git a/d3/d39/hash__adler32_8c.html b/d3/d39/hash__adler32_8c.html index 481442642..fdb67430e 100644 --- a/d3/d39/hash__adler32_8c.html +++ b/d3/d39/hash__adler32_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: hash/hash_adler32.c 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('d3/d39/hash__adler32_8c.html','../../'
-
-
hash_adler32.c File Reference
+
hash_adler32.c File Reference
-

32-bit Adler hash algorithm +

32-bit Adler hash algorithm More...

#include <assert.h>
#include <inttypes.h>
@@ -109,7 +108,7 @@ Include dependency graph for hash_adler32.c:
- @@ -117,21 +116,52 @@ Functions - - + +

+

Functions

uint32_t adler32 (const char *s)
 32-bit Adler algorithm implementation More...
void test_adler32 ()
 Test function for adler32. More...
 
-int main ()
 Main function.
int main ()
 Main function. More...
 

Detailed Description

-

32-bit Adler hash algorithm

-
Author
Christian Bender
-
+

32-bit Adler hash algorithm

+
Author
Christian Bender
+

Function Documentation

+ +

◆ main()

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

Main function.

+
51{
+ +
53 return 0;
+
54}
+
void test_adler32()
Test function for adler32.
Definition: hash_adler32.c:38
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ diff --git a/d3/d39/hash__adler32_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d3/d39/hash__adler32_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..a7099bdef --- /dev/null +++ b/d3/d39/hash__adler32_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/d3/d39/hash__adler32_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d3/d39/hash__adler32_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..85d3fb218 --- /dev/null +++ b/d3/d39/hash__adler32_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +4ecc4fc7fad196620d517de442111eb8 \ No newline at end of file diff --git a/d3/d39/hash__adler32_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d3/d39/hash__adler32_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..5616586fa --- /dev/null +++ b/d3/d39/hash__adler32_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,52 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +test_adler32 + + + + + +Node1->Node2 + + + + + +Node3 + + +adler32 + + + + + +Node2->Node3 + + + + + diff --git a/d3/d47/modified__binary__search_8c.html b/d3/d47/modified__binary__search_8c.html index 2b3ca31c4..8092da6af 100644 --- a/d3/d47/modified__binary__search_8c.html +++ b/d3/d47/modified__binary__search_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: searching/modified_binary_search.c 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('d3/d47/modified__binary__search_8c.htm
-
-
modified_binary_search.c File Reference
+
modified_binary_search.c File Reference
-

Modified binary search algorithm +

Modified binary search algorithm More...

#include <stdio.h>
#include <stdlib.h>
@@ -108,7 +107,7 @@ Include dependency graph for modified_binary_search.c:
- @@ -116,15 +115,14 @@ Functions - - + +

+

Functions

int binarySearch (const int **mat, int i, int j_low, int j_high, int x)
 This function does Binary search for x in i-th row from j_low to j_high. More...
void modifiedBinarySearch (const int **mat, int n, int m, int x)
 Function to perform binary search on the mid values of row to get the desired pair of rows where the element can be found. More...
 
-int main ()
 Main function.
int main ()
 Main function. More...
 

Detailed Description

-

Modified binary search algorithm

+

Function Documentation

- +

◆ binarySearch()

@@ -182,31 +180,83 @@ int 
Returns
column where x was found
-1 if value not found
-
19 {
-
20  while (j_low <= j_high)
-
21  {
-
22  int j_mid = (j_low + j_high) / 2;
-
23 
-
24  // Element found
-
25  if (mat[i][j_mid] == x)
-
26  {
-
27  printf("Found at (%d,%d)\n", i, j_mid);
-
28  return j_mid;
-
29  }
-
30  else if (mat[i][j_mid] > x)
-
31  j_high = j_mid - 1;
-
32  else
-
33  j_low = j_mid + 1;
-
34  }
-
35 
-
36  // element not found
-
37  printf("element not found\n");
-
38  return -1;
-
39 }
+
19{
+
20 while (j_low <= j_high)
+
21 {
+
22 int j_mid = (j_low + j_high) / 2;
+
23
+
24 // Element found
+
25 if (mat[i][j_mid] == x)
+
26 {
+
27 printf("Found at (%d,%d)\n", i, j_mid);
+
28 return j_mid;
+
29 }
+
30 else if (mat[i][j_mid] > x)
+
31 j_high = j_mid - 1;
+
32 else
+
33 j_low = j_mid + 1;
+
34 }
+
35
+
36 // element not found
+
37 printf("element not found\n");
+
38 return -1;
+
39}
- + +

◆ main()

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

Main function.

+
98{
+
99 int x; // element to be searched
+
100 int m, n; // m = columns, n = rows
+
101
+
102 scanf("%d %d %d\n", &n, &m, &x);
+
103
+
104 int **mat = (int **)malloc(n * sizeof(int *));
+
105 for (int i = 0; i < m; i++) mat[i] = (int *)malloc(m * sizeof(int));
+
106
+
107 for (int i = 0; i < n; i++)
+
108 {
+
109 for (int j = 0; j < m; j++)
+
110 {
+
111 scanf("%d", &mat[i][j]);
+
112 }
+
113 }
+
114
+
115 modifiedBinarySearch(mat, n, m, x);
+
116
+
117 for (int i = 0; i < n; i++) free(mat[i]);
+
118 free(mat);
+
119 return 0;
+
120}
+
#define malloc(bytes)
This macro replace the standard malloc function with malloc_dbg.
Definition: malloc_dbg.h:18
+
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
+
void modifiedBinarySearch(const int **mat, int n, int m, int x)
Function to perform binary search on the mid values of row to get the desired pair of rows where the ...
Definition: modified_binary_search.c:48
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+

◆ modifiedBinarySearch()

@@ -254,57 +304,57 @@ int 
49 { // If Single row matrix
-
50  if (n == 1)
-
51  {
-
52  binarySearch(mat, 0, 0, m - 1, x);
-
53  return;
-
54  }
-
55 
-
56  // Do binary search in middle column.
-
57  // Condition to terminate the loop when the 2 desired rows are found.
-
58  int i_low = 0, i_high = n - 1, j_mid = m / 2;
-
59  while ((i_low + 1) < i_high)
-
60  {
-
61  int i_mid = (i_low + i_high) / 2;
-
62  // element found
-
63  if (mat[i_mid][j_mid] == x)
-
64  {
-
65  printf("Found at (%d,%d)\n", i_mid, j_mid);
-
66  return;
-
67  }
-
68  else if (mat[i_mid][j_mid] > x)
-
69  i_high = i_mid;
-
70  else
-
71  i_low = i_mid;
-
72  }
-
73  // If element is present on the mid of the two rows
-
74  if (mat[i_low][j_mid] == x)
-
75  printf("Found at (%d,%d)\n", i_low, j_mid);
-
76  else if (mat[i_low + 1][j_mid] == x)
-
77  printf("Found at (%d,%d)\n", i_low + 1, j_mid);
-
78 
-
79  // Search element on 1st half of 1st row
-
80  else if (x <= mat[i_low][j_mid - 1])
-
81  binarySearch(mat, i_low, 0, j_mid - 1, x);
-
82 
-
83  // Search element on 2nd half of 1st row
-
84  else if (x >= mat[i_low][j_mid + 1] && x <= mat[i_low][m - 1])
-
85  binarySearch(mat, i_low, j_mid + 1, m - 1, x);
-
86 
-
87  // Search element on 1st half of 2nd row
-
88  else if (x <= mat[i_low + 1][j_mid - 1])
-
89  binarySearch(mat, i_low + 1, 0, j_mid - 1, x);
-
90 
-
91  // search element on 2nd half of 2nd row
-
92  else
-
93  binarySearch(mat, i_low + 1, j_mid + 1, m - 1, x);
-
94 }
+
49{ // If Single row matrix
+
50 if (n == 1)
+
51 {
+
52 binarySearch(mat, 0, 0, m - 1, x);
+
53 return;
+
54 }
+
55
+
56 // Do binary search in middle column.
+
57 // Condition to terminate the loop when the 2 desired rows are found.
+
58 int i_low = 0, i_high = n - 1, j_mid = m / 2;
+
59 while ((i_low + 1) < i_high)
+
60 {
+
61 int i_mid = (i_low + i_high) / 2;
+
62 // element found
+
63 if (mat[i_mid][j_mid] == x)
+
64 {
+
65 printf("Found at (%d,%d)\n", i_mid, j_mid);
+
66 return;
+
67 }
+
68 else if (mat[i_mid][j_mid] > x)
+
69 i_high = i_mid;
+
70 else
+
71 i_low = i_mid;
+
72 }
+
73 // If element is present on the mid of the two rows
+
74 if (mat[i_low][j_mid] == x)
+
75 printf("Found at (%d,%d)\n", i_low, j_mid);
+
76 else if (mat[i_low + 1][j_mid] == x)
+
77 printf("Found at (%d,%d)\n", i_low + 1, j_mid);
+
78
+
79 // Search element on 1st half of 1st row
+
80 else if (x <= mat[i_low][j_mid - 1])
+
81 binarySearch(mat, i_low, 0, j_mid - 1, x);
+
82
+
83 // Search element on 2nd half of 1st row
+
84 else if (x >= mat[i_low][j_mid + 1] && x <= mat[i_low][m - 1])
+
85 binarySearch(mat, i_low, j_mid + 1, m - 1, x);
+
86
+
87 // Search element on 1st half of 2nd row
+
88 else if (x <= mat[i_low + 1][j_mid - 1])
+
89 binarySearch(mat, i_low + 1, 0, j_mid - 1, x);
+
90
+
91 // search element on 2nd half of 2nd row
+
92 else
+
93 binarySearch(mat, i_low + 1, j_mid + 1, m - 1, x);
+
94}
int binarySearch(const int **mat, int i, int j_low, int j_high, int x)
This function does Binary search for x in i-th row from j_low to j_high.
Definition: modified_binary_search.c:18
Here is the call graph for this function:
-
+
@@ -316,7 +366,7 @@ Here is the call graph for this function:
diff --git a/d3/d47/modified__binary__search_8c_a7df9a198e30cded6229d79bef7591f8f_cgraph.map b/d3/d47/modified__binary__search_8c_a7df9a198e30cded6229d79bef7591f8f_cgraph.map index d07917389..6da827f49 100644 --- a/d3/d47/modified__binary__search_8c_a7df9a198e30cded6229d79bef7591f8f_cgraph.map +++ b/d3/d47/modified__binary__search_8c_a7df9a198e30cded6229d79bef7591f8f_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/d3/d47/modified__binary__search_8c_a7df9a198e30cded6229d79bef7591f8f_cgraph.svg b/d3/d47/modified__binary__search_8c_a7df9a198e30cded6229d79bef7591f8f_cgraph.svg index f4189fe44..b228640f3 100644 --- a/d3/d47/modified__binary__search_8c_a7df9a198e30cded6229d79bef7591f8f_cgraph.svg +++ b/d3/d47/modified__binary__search_8c_a7df9a198e30cded6229d79bef7591f8f_cgraph.svg @@ -1,20 +1,20 @@ - - + modifiedBinarySearch - + Node1 - -modifiedBinarySearch + +modifiedBinarySearch @@ -22,16 +22,16 @@ Node2 - -binarySearch + +binarySearch Node1->Node2 - - + + diff --git a/d3/d47/modified__binary__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d3/d47/modified__binary__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..be64f3ecc --- /dev/null +++ b/d3/d47/modified__binary__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/d3/d47/modified__binary__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d3/d47/modified__binary__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..62969df60 --- /dev/null +++ b/d3/d47/modified__binary__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +f74c7593e1eea2c9b32d26a2585ba693 \ No newline at end of file diff --git a/d3/d47/modified__binary__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d3/d47/modified__binary__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..d7f5d8997 --- /dev/null +++ b/d3/d47/modified__binary__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,52 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +modifiedBinarySearch + + + + + +Node1->Node2 + + + + + +Node3 + + +binarySearch + + + + + +Node2->Node3 + + + + + diff --git a/d3/d4e/selection__sort__recursive_8c__incl.map b/d3/d4e/selection__sort__recursive_8c__incl.map index a736df944..3ad84b85c 100644 --- a/d3/d4e/selection__sort__recursive_8c__incl.map +++ b/d3/d4e/selection__sort__recursive_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/d3/d4e/selection__sort__recursive_8c__incl.svg b/d3/d4e/selection__sort__recursive_8c__incl.svg index 5fc90526e..00f224db2 100644 --- a/d3/d4e/selection__sort__recursive_8c__incl.svg +++ b/d3/d4e/selection__sort__recursive_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - -sorting/selection_sort + +sorting/selection_sort _recursive.c diff --git a/d3/d5a/struct__large__num.html b/d3/d5a/struct__large__num.html index e8582f3a1..884770c08 100644 --- a/d3/d5a/struct__large__num.html +++ b/d3/d5a/struct__large__num.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: _large_num 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() {
@@ -92,27 +92,26 @@ $(document).ready(function(){initNavTree('d3/d5a/struct__large__num.html','../..
-
-
_large_num Struct Reference
+
_large_num Struct Reference

dynamically large number More...

- - + - +

+

Data Fields

-char * digits
+char * digits
 array to store individual digits
 
-unsigned int num_digits
+unsigned int num_digits
 number of digits in the number
 

Detailed Description

-

dynamically large number

+

dynamically large number


The documentation for this struct was generated from the following file: @@ -122,7 +121,7 @@ unsigned int 
diff --git a/d3/d60/union__find_8c__incl.map b/d3/d60/union__find_8c__incl.map index dda925cc6..280d82660 100644 --- a/d3/d60/union__find_8c__incl.map +++ b/d3/d60/union__find_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/d3/d60/union__find_8c__incl.svg b/d3/d60/union__find_8c__incl.svg index bd7e400c6..2815b5b5a 100644 --- a/d3/d60/union__find_8c__incl.svg +++ b/d3/d60/union__find_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - + misc/union_find.c diff --git a/d3/d61/problem__1_2sol1_8c__incl.map b/d3/d61/problem__1_2sol1_8c__incl.map index ea48c34f8..d23cc8ac9 100644 --- a/d3/d61/problem__1_2sol1_8c__incl.map +++ b/d3/d61/problem__1_2sol1_8c__incl.map @@ -1,4 +1,4 @@ - - + + diff --git a/d3/d61/problem__1_2sol1_8c__incl.svg b/d3/d61/problem__1_2sol1_8c__incl.svg index 5e637ca99..bace42390 100644 --- a/d3/d61/problem__1_2sol1_8c__incl.svg +++ b/d3/d61/problem__1_2sol1_8c__incl.svg @@ -1,21 +1,21 @@ - - + project_euler/problem_1/sol1.c - + Node1 - + project_euler/problem -_1/sol1.c +_1/sol1.c @@ -23,16 +23,16 @@ Node2 - -stdio.h + +stdio.h Node1->Node2 - - + + diff --git a/d3/d78/words__alphabetical_8c.html b/d3/d78/words__alphabetical_8c.html new file mode 100644 index 000000000..afcda862f --- /dev/null +++ b/d3/d78/words__alphabetical_8c.html @@ -0,0 +1,759 @@ + + + + + + + +Algorithms_in_C: data_structures/binary_trees/words_alphabetical.c File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Algorithms_in_C 1.0.0 +
+
Set of algorithms implemented in C.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
words_alphabetical.c File Reference
+
+
+ +

Printing the words contained in a file named file.txt in alphabetical order and also their frequencies in to another file "wordcount.txt". +More...

+
#include <assert.h>
+#include <ctype.h>
+#include <inttypes.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+Include dependency graph for words_alphabetical.c:
+
+
+
+
+
+ + + + +

+Data Structures

struct  Node
 Node, the basic data structure of the tree. More...
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

void endProgramAbruptly (char *errorMessage)
 Ends program due to an error. More...
 
void freeTreeMemory (struct Node *node)
 Frees memory when program is terminating. More...
 
char * getPointerToWord (char *word)
 Stores word in memory. More...
 
void closeFile (FILE *file)
 Closes the file after reading or writing. More...
 
struct Node * allocateMemoryForNode ()
 Reserves memory for new node. More...
 
void writeContentOfTreeToFile (struct Node *node, FILE *file)
 Writes contents of tree to another file alphabetically. More...
 
struct Node * addWordToTree (char *word, struct Node *currentNode)
 Adds word (node) to the correct position in tree. More...
 
struct Node * readWordsInFileToTree (FILE *file, struct Node *root)
 Reads words from file to tree. More...
 
static void test ()
 Self-test implementations. More...
 
int main ()
 Main function. More...
 
+

Detailed Description

+

Printing the words contained in a file named file.txt in alphabetical order and also their frequencies in to another file "wordcount.txt".

+

Given a file (file.txt) containing words (like a publication or a novel), where words are separated by a space, newline, or underscore. This program prints (writes or outputs) to another file (wordcount.txt), the individual words contained in 'file.txt' with their frequencies (number of occurences) each on a newline and in alphabetical order. This program uses the binary tree data structure to accomplish this task.

Author
Randy Kwalar
+

Function Documentation

+ +

◆ addWordToTree()

+ +
+
+ + + + + + + + + + + + + + + + + + +
struct Node * addWordToTree (char * word,
struct Node * currentNode 
)
+
+ +

Adds word (node) to the correct position in tree.

+
Parameters
+ + + +
wordword to be inserted in to the tree
currentNodenode which is being compared
+
+
+
Returns
a pointer to the root node
+

< holds compare state

+
145{
+
146 if (currentNode == NULL) // checks if `currentNode` is `NULL`
+
147 {
+
148 struct Node *currentNode =
+
149 allocateMemoryForNode(); // allocates memory for new node
+
150 currentNode->word = getPointerToWord(word); // stores `word` in memory
+
151 currentNode->frequency = 1; // initializes the word frequency to 1
+
152 currentNode->left = NULL; // sets left node to `NULL`
+
153 currentNode->right = NULL; // sets right node to `NULL`
+
154 return currentNode; // returns pointer to newly created node
+
155 }
+
156
+
157 int64_t compared = strcmp(word, currentNode->word); ///< holds compare state
+
158
+
159 if (compared > 0) {
+
160 currentNode->right = addWordToTree(word,
+
161 currentNode->right); // adds `word` to right sub tree if `word` is
+
162 // alphabetically greater than `currentNode->word`
+
163 }
+
164 else if (compared < 0) {
+
165 currentNode->left = addWordToTree(word,
+
166 currentNode->left); // adds `word` to left sub tree if `word` is
+
167 // alphabetically less than `currentNode->word`
+
168 }
+
169 else {
+
170 currentNode->frequency++; // increments `currentNode` frequency if `word` is the same as `currentNode->word`
+
171 }
+
172
+
173 return currentNode; // returns pointer to current node
+
174}
+
Node, the basic data structure of the tree.
Definition: threaded_binary_trees.c:27
+
uint64_t frequency
number of occurences of the word
Definition: words_alphabetical.c:31
+
struct Node * left
pointer to the left child node
Definition: words_alphabetical.c:32
+
struct Node * right
pointer to the right child node
Definition: words_alphabetical.c:33
+
char * word
the word (value) of the node
Definition: words_alphabetical.c:30
+
struct Node * addWordToTree(char *word, struct Node *currentNode)
Adds word (node) to the correct position in tree.
Definition: words_alphabetical.c:144
+
struct Node * allocateMemoryForNode()
Reserves memory for new node.
Definition: words_alphabetical.c:102
+
char * getPointerToWord(char *word)
Stores word in memory.
Definition: words_alphabetical.c:70
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ allocateMemoryForNode()

+ +
+
+ + + + + + + +
struct Node * allocateMemoryForNode ()
+
+ +

Reserves memory for new node.

+
Returns
a pointer to the newly allocated node if memory IS successfully reserved
+
+NULL if memory is NOT reserved
+

< pointer to the node

+
103{
+
104 struct Node *node =
+
105 (struct Node *)malloc(sizeof(struct Node)); ///< pointer to the node
+
106 if (node != NULL)
+
107 {
+
108 return node;
+
109 }
+ +
111 "\nA problem occurred while reserving memory for the structure\n");
+
112 return NULL;
+
113}
+
struct node node
Node, the basic data structure in the tree.
+
#define malloc(bytes)
This macro replace the standard malloc function with malloc_dbg.
Definition: malloc_dbg.h:18
+
Node, the basic data structure in the tree.
Definition: binary_search_tree.c:15
+
void endProgramAbruptly(char *errorMessage)
Ends program due to an error.
Definition: words_alphabetical.c:41
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ closeFile()

+ +
+
+ + + + + + + + +
void closeFile (FILE * file)
+
+ +

Closes the file after reading or writing.

+
Parameters
+ + +
filepointer to the file to be closed
+
+
+
Returns
void
+
91{
+
92 if (fclose(file)) {
+
93 endProgramAbruptly("\nA Problem Occurred while closing a file\n");
+
94 }
+
95}
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ endProgramAbruptly()

+ +
+
+ + + + + + + + +
void endProgramAbruptly (char * errorMessage)
+
+ +

Ends program due to an error.

+
Parameters
+ + +
errorMessagethe error message to be printed
+
+
+
Returns
void
+
42{
+
43 fprintf(stderr, "%s\n", errorMessage);
+
44 exit(EXIT_FAILURE);
+
45}
+
+
+
+ +

◆ freeTreeMemory()

+ +
+
+ + + + + + + + +
void freeTreeMemory (struct Node * node)
+
+ +

Frees memory when program is terminating.

+
Parameters
+ + +
nodepointer to current node
+
+
+
Returns
void
+
53{
+
54 if (node != NULL)
+
55 {
+ + +
58 free(node->word); // freeing node->word because memory was allocated
+
59 // using malloc
+
60 free(node); // freeing node because memory was allocated using malloc
+
61 }
+
62}
+
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
+
struct node * right
right child
Definition: binary_search_tree.c:17
+
struct node * left
left child
Definition: binary_search_tree.c:16
+
void freeTreeMemory(struct Node *node)
Frees memory when program is terminating.
Definition: words_alphabetical.c:52
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ getPointerToWord()

+ +
+
+ + + + + + + + +
char * getPointerToWord (char * word)
+
+ +

Stores word in memory.

+
Parameters
+ + +
wordword to be stored in memory
+
+
+
Returns
a pointer to the newly allocated word if the word IS stored successfully
+
+NULL if the word is NOT stored
+

< pointer to string

+
71{
+
72 char *string =
+
73 (char *)malloc((strlen(word) + 1) * sizeof(char)); ///< pointer to string
+
74 // + 1 is for the '\0' character
+
75 if (string != NULL)
+
76 {
+
77 strcpy(string, word);
+
78 return string;
+
79 }
+ +
81 "\nA problem occurred while reserving memory for the word\n");
+
82 return NULL;
+
83}
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ main()

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

Main function.

+
Returns
0 on exit
+
313{
+
314 test(); // run self-test implementations
+
315 return 0;
+
316}
+
static void test()
Self-test implementations.
Definition: words_alphabetical.c:244
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ readWordsInFileToTree()

+ +
+
+ + + + + + + + + + + + + + + + + + +
struct Node * readWordsInFileToTree (FILE * file,
struct Node * root 
)
+
+ +

Reads words from file to tree.

+
Parameters
+ + + +
filefile to be read from
rootroot node of tree
+
+
+
Returns
a pointer to the root node
+

< pointer to the input string

+

< temp storage of characters

+

< bool to mark the end of a word

+

< position in inputString to place the inputChar

+
183{
+
184 // longest english word = 45 chars
+
185 // +1 for '\0' = 46 chars
+
186 char *inputString =
+
187 (char *)malloc(46 * sizeof(char)); ///< pointer to the input string
+
188
+
189 char inputChar; ///< temp storage of characters
+
190 bool isPrevCharAlpha = false; ///< bool to mark the end of a word
+
191 uint8_t pos = 0; ///< position in inputString to place the inputChar
+
192
+
193 while ((inputChar = fgetc(file)) != EOF)
+
194 {
+
195 if (pos > 0)
+
196 isPrevCharAlpha = isalpha(inputString[pos - 1]);
+
197
+
198 // checks if character is letter
+
199 if (isalpha(inputChar))
+
200 {
+
201 inputString[pos++] = tolower(inputChar);
+
202 continue;
+
203 }
+
204
+
205 // checks if character is ' or - and if it is preceded by a letter eg
+
206 // yours-not, persons' (valid)
+
207 if ((inputChar == '\'' || inputChar == '-') && isPrevCharAlpha)
+
208 {
+
209 inputString[pos++] = inputChar;
+
210 continue;
+
211 }
+
212
+
213 // makes sure that there is something valid in inputString
+
214 if (pos == 0)
+
215 continue;
+
216
+
217 // if last character is not letter and is not ' then replace by \0
+
218 if (!isPrevCharAlpha && inputString[pos - 1] != '\'')
+
219 pos--;
+
220 inputString[pos] = '\0';
+
221 pos = 0;
+
222 isPrevCharAlpha = false;
+
223 root = addWordToTree(inputString, root);
+
224 }
+
225
+
226 // this is to catch the case for the EOF being immediately after the last
+
227 // letter or '
+
228 if (pos > 0)
+
229 {
+
230 if (!isPrevCharAlpha && inputString[pos - 1] != '\'')
+
231 pos--;
+
232 inputString[pos] = '\0';
+
233 root = addWordToTree(inputString, root);
+
234 }
+
235
+
236 free(inputString);
+
237 return root;
+
238}
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ test()

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

Self-test implementations.

+
Returns
void
+

< pointer to the root node

+

< pointer to the file

+
245{
+
246 struct Node *root = NULL; ///< pointer to the root node
+
247 FILE *file = NULL; ///< pointer to the file
+
248
+
249 file = fopen("file.txt", "w"); // creates test file in write mode
+
250
+
251 fprintf(file,
+
252 "hey_this, is a. test input \n to a_file"); // writes test data to
+
253 // test file
+
254
+
255 closeFile(file); // closes test file
+
256 file = fopen("file.txt", "r"); // reopens test file in read mode
+
257
+
258 root = readWordsInFileToTree(file,
+
259 root); // reads words from test file to tree
+
260
+
261 // Tests to check if words were added to correct position in tree and also
+
262 // if their frequencies were added correctly
+
263 assert(strcmp(root->word, "hey") == 0);
+
264 assert(root->frequency == 1);
+
265 assert(strcmp(root->left->word, "a") == 0);
+
266 assert(root->left->frequency == 2);
+
267 assert(strcmp(root->right->word, "this") == 0);
+
268 assert(strcmp(root->left->right->word, "file") == 0);
+
269 assert(strcmp(root->right->left->word, "is") == 0);
+
270
+
271 closeFile(file); // closes test file
+
272 remove("file.txt"); // deletes test file from storage
+
273
+
274 file = fopen("wordcount.txt", "a"); // creates write file
+
275 fprintf(file, "%-5s \t %9s \t %s \n", "S/N", "FREQUENCY",
+
276 "WORD"); // prints the heading to `wordcount.txt`
+ +
278 root, file); // writes content of tree to file (`wordcount.txt`)
+
279
+
280 // Here is how the output to `wordcount.txt` should look like
+
281 char *correctString =
+
282 "S/N FREQUENCY WORD \n"
+
283 "1 2 a \n"
+
284 "2 1 file \n"
+
285 "3 1 hey \n"
+
286 "4 1 input \n"
+
287 "5 1 is \n"
+
288 "6 1 n \n"
+
289 "7 1 test \n"
+
290 "8 1 this \n"
+
291 "9 1 to \n";
+
292
+
293 int16_t inputChar; // holds the current character in `wordcount.txt`
+
294 uint64_t i = 0; // holds the current index in `correctString`
+
295
+
296 // Checks if the content in `wordcount.txt` is as expected (the same as in
+
297 // `correctString`)
+
298 while ((inputChar = fgetc(file)) != EOF) {
+
299 assert(inputChar == correctString[i++]);
+
300 }
+
301
+
302 closeFile(file); // closes `wordcount.txt`
+
303 remove("wordcount.txt"); // deletes `wordcount.txt`
+
304
+
305 freeTreeMemory(root); // frees memory taken up by the tree
+
306}
+
struct Node * readWordsInFileToTree(FILE *file, struct Node *root)
Reads words from file to tree.
Definition: words_alphabetical.c:182
+
void writeContentOfTreeToFile(struct Node *node, FILE *file)
Writes contents of tree to another file alphabetically.
Definition: words_alphabetical.c:121
+
void closeFile(FILE *file)
Closes the file after reading or writing.
Definition: words_alphabetical.c:90
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ writeContentOfTreeToFile()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void writeContentOfTreeToFile (struct Node * node,
FILE * file 
)
+
+ +

Writes contents of tree to another file alphabetically.

+
Parameters
+ + + +
nodepointer to current node
filepointer to file
+
+
+
Returns
void
+

< for word numbering in the write file

+
122{
+
123 static uint64_t i = 1; ///< for word numbering in the write file
+
124 if (node != NULL) // checks if the node is valid
+
125 {
+ +
127 node->left,
+
128 file); // calls `writeContentOfTreeToFile` for left sub tree
+
129 fprintf(file, "%-5lu \t %-9lu \t %s \n", i++, node->frequency,
+
130 node->word); // prints the word number, word frequency and word
+
131 // in tabular format to the file
+ +
133 node->right,
+
134 file); // calls `writeContentOfTreeToFile` for right sub tree
+
135 }
+
136}
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+
+
+ + + + diff --git a/d3/d78/words__alphabetical_8c.js b/d3/d78/words__alphabetical_8c.js new file mode 100644 index 000000000..3da046fa2 --- /dev/null +++ b/d3/d78/words__alphabetical_8c.js @@ -0,0 +1,14 @@ +var words__alphabetical_8c = +[ + [ "Node", "db/d8b/struct_node.html", "db/d8b/struct_node" ], + [ "addWordToTree", "d3/d78/words__alphabetical_8c.html#a0ac11529daf94e98f7114a6e938679a9", null ], + [ "allocateMemoryForNode", "d3/d78/words__alphabetical_8c.html#a1e5ad8401396df36ab585d79f3309fd9", null ], + [ "closeFile", "d3/d78/words__alphabetical_8c.html#af1f9b6eb320d872ba0766dc8bd070075", null ], + [ "endProgramAbruptly", "d3/d78/words__alphabetical_8c.html#a5157a5b4e164f934602fa78413504029", null ], + [ "freeTreeMemory", "d3/d78/words__alphabetical_8c.html#a840902ada0e956eb01b529be178748cc", null ], + [ "getPointerToWord", "d3/d78/words__alphabetical_8c.html#a9e3cab68cf6557024f0073f674a307a1", null ], + [ "main", "d3/d78/words__alphabetical_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], + [ "readWordsInFileToTree", "d3/d78/words__alphabetical_8c.html#a151b2c78ae821d0495faf936a1c2530f", null ], + [ "test", "d3/d78/words__alphabetical_8c.html#aa8dca7b867074164d5f45b0f3851269d", null ], + [ "writeContentOfTreeToFile", "d3/d78/words__alphabetical_8c.html#a22516c70583c9fa78e4edffb063836cc", null ] +]; \ No newline at end of file diff --git a/d3/d78/words__alphabetical_8c_a0ac11529daf94e98f7114a6e938679a9_cgraph.map b/d3/d78/words__alphabetical_8c_a0ac11529daf94e98f7114a6e938679a9_cgraph.map new file mode 100644 index 000000000..bfa7302f0 --- /dev/null +++ b/d3/d78/words__alphabetical_8c_a0ac11529daf94e98f7114a6e938679a9_cgraph.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/d3/d78/words__alphabetical_8c_a0ac11529daf94e98f7114a6e938679a9_cgraph.md5 b/d3/d78/words__alphabetical_8c_a0ac11529daf94e98f7114a6e938679a9_cgraph.md5 new file mode 100644 index 000000000..6b25b537b --- /dev/null +++ b/d3/d78/words__alphabetical_8c_a0ac11529daf94e98f7114a6e938679a9_cgraph.md5 @@ -0,0 +1 @@ +d58f3d55efd3cd4889d0badf4c0f9abf \ No newline at end of file diff --git a/d3/d78/words__alphabetical_8c_a0ac11529daf94e98f7114a6e938679a9_cgraph.svg b/d3/d78/words__alphabetical_8c_a0ac11529daf94e98f7114a6e938679a9_cgraph.svg new file mode 100644 index 000000000..89236310a --- /dev/null +++ b/d3/d78/words__alphabetical_8c_a0ac11529daf94e98f7114a6e938679a9_cgraph.svg @@ -0,0 +1,79 @@ + + + + + + +addWordToTree + + + +Node1 + + +addWordToTree + + + + + +Node1->Node1 + + + + + +Node2 + + +allocateMemoryForNode + + + + + +Node1->Node2 + + + + + +Node4 + + +getPointerToWord + + + + + +Node1->Node4 + + + + + +Node3 + + +endProgramAbruptly + + + + + +Node2->Node3 + + + + + +Node4->Node3 + + + + + diff --git a/d3/d78/words__alphabetical_8c_a151b2c78ae821d0495faf936a1c2530f_cgraph.map b/d3/d78/words__alphabetical_8c_a151b2c78ae821d0495faf936a1c2530f_cgraph.map new file mode 100644 index 000000000..d6b802f62 --- /dev/null +++ b/d3/d78/words__alphabetical_8c_a151b2c78ae821d0495faf936a1c2530f_cgraph.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/d3/d78/words__alphabetical_8c_a151b2c78ae821d0495faf936a1c2530f_cgraph.md5 b/d3/d78/words__alphabetical_8c_a151b2c78ae821d0495faf936a1c2530f_cgraph.md5 new file mode 100644 index 000000000..3cea17d4e --- /dev/null +++ b/d3/d78/words__alphabetical_8c_a151b2c78ae821d0495faf936a1c2530f_cgraph.md5 @@ -0,0 +1 @@ +a0fb684fb325692f73d8526ab2d3894e \ No newline at end of file diff --git a/d3/d78/words__alphabetical_8c_a151b2c78ae821d0495faf936a1c2530f_cgraph.svg b/d3/d78/words__alphabetical_8c_a151b2c78ae821d0495faf936a1c2530f_cgraph.svg new file mode 100644 index 000000000..eb23b65d1 --- /dev/null +++ b/d3/d78/words__alphabetical_8c_a151b2c78ae821d0495faf936a1c2530f_cgraph.svg @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +readWordsInFileToTree + + + +Node1 + + +readWordsInFileToTree + + + + + +Node2 + + +addWordToTree + + + + + +Node1->Node2 + + + + + +Node2->Node2 + + + + + +Node3 + + +allocateMemoryForNode + + + + + +Node2->Node3 + + + + + +Node5 + + +getPointerToWord + + + + + +Node2->Node5 + + + + + +Node4 + + +endProgramAbruptly + + + + + +Node3->Node4 + + + + + +Node5->Node4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/d3/d78/words__alphabetical_8c_a151b2c78ae821d0495faf936a1c2530f_cgraph_org.svg b/d3/d78/words__alphabetical_8c_a151b2c78ae821d0495faf936a1c2530f_cgraph_org.svg new file mode 100644 index 000000000..ebe72be5c --- /dev/null +++ b/d3/d78/words__alphabetical_8c_a151b2c78ae821d0495faf936a1c2530f_cgraph_org.svg @@ -0,0 +1,94 @@ + + + + + + +readWordsInFileToTree + + + +Node1 + + +readWordsInFileToTree + + + + + +Node2 + + +addWordToTree + + + + + +Node1->Node2 + + + + + +Node2->Node2 + + + + + +Node3 + + +allocateMemoryForNode + + + + + +Node2->Node3 + + + + + +Node5 + + +getPointerToWord + + + + + +Node2->Node5 + + + + + +Node4 + + +endProgramAbruptly + + + + + +Node3->Node4 + + + + + +Node5->Node4 + + + + + diff --git a/d3/d78/words__alphabetical_8c_a1e5ad8401396df36ab585d79f3309fd9_cgraph.map b/d3/d78/words__alphabetical_8c_a1e5ad8401396df36ab585d79f3309fd9_cgraph.map new file mode 100644 index 000000000..6fc5c2b18 --- /dev/null +++ b/d3/d78/words__alphabetical_8c_a1e5ad8401396df36ab585d79f3309fd9_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/d3/d78/words__alphabetical_8c_a1e5ad8401396df36ab585d79f3309fd9_cgraph.md5 b/d3/d78/words__alphabetical_8c_a1e5ad8401396df36ab585d79f3309fd9_cgraph.md5 new file mode 100644 index 000000000..1110fe647 --- /dev/null +++ b/d3/d78/words__alphabetical_8c_a1e5ad8401396df36ab585d79f3309fd9_cgraph.md5 @@ -0,0 +1 @@ +0670e6a1d23b513413a663c0d4ad97ca \ No newline at end of file diff --git a/d3/d78/words__alphabetical_8c_a1e5ad8401396df36ab585d79f3309fd9_cgraph.svg b/d3/d78/words__alphabetical_8c_a1e5ad8401396df36ab585d79f3309fd9_cgraph.svg new file mode 100644 index 000000000..ca4039607 --- /dev/null +++ b/d3/d78/words__alphabetical_8c_a1e5ad8401396df36ab585d79f3309fd9_cgraph.svg @@ -0,0 +1,37 @@ + + + + + + +allocateMemoryForNode + + + +Node1 + + +allocateMemoryForNode + + + + + +Node2 + + +endProgramAbruptly + + + + + +Node1->Node2 + + + + + diff --git a/d3/d78/words__alphabetical_8c_a22516c70583c9fa78e4edffb063836cc_cgraph.map b/d3/d78/words__alphabetical_8c_a22516c70583c9fa78e4edffb063836cc_cgraph.map new file mode 100644 index 000000000..c38a1f811 --- /dev/null +++ b/d3/d78/words__alphabetical_8c_a22516c70583c9fa78e4edffb063836cc_cgraph.map @@ -0,0 +1,3 @@ + + + diff --git a/d3/d78/words__alphabetical_8c_a22516c70583c9fa78e4edffb063836cc_cgraph.md5 b/d3/d78/words__alphabetical_8c_a22516c70583c9fa78e4edffb063836cc_cgraph.md5 new file mode 100644 index 000000000..64b0e6a5d --- /dev/null +++ b/d3/d78/words__alphabetical_8c_a22516c70583c9fa78e4edffb063836cc_cgraph.md5 @@ -0,0 +1 @@ +ec031b36a73e02c2edc283f76b5a155d \ No newline at end of file diff --git a/d3/d78/words__alphabetical_8c_a22516c70583c9fa78e4edffb063836cc_cgraph.svg b/d3/d78/words__alphabetical_8c_a22516c70583c9fa78e4edffb063836cc_cgraph.svg new file mode 100644 index 000000000..cf44cc309 --- /dev/null +++ b/d3/d78/words__alphabetical_8c_a22516c70583c9fa78e4edffb063836cc_cgraph.svg @@ -0,0 +1,28 @@ + + + + + + +writeContentOfTreeToFile + + + +Node1 + + +writeContentOfTreeToFile + + + + + +Node1->Node1 + + + + + diff --git a/d3/d78/words__alphabetical_8c_a840902ada0e956eb01b529be178748cc_cgraph.map b/d3/d78/words__alphabetical_8c_a840902ada0e956eb01b529be178748cc_cgraph.map new file mode 100644 index 000000000..66321cbda --- /dev/null +++ b/d3/d78/words__alphabetical_8c_a840902ada0e956eb01b529be178748cc_cgraph.map @@ -0,0 +1,3 @@ + + + diff --git a/d3/d78/words__alphabetical_8c_a840902ada0e956eb01b529be178748cc_cgraph.md5 b/d3/d78/words__alphabetical_8c_a840902ada0e956eb01b529be178748cc_cgraph.md5 new file mode 100644 index 000000000..bea92ff0b --- /dev/null +++ b/d3/d78/words__alphabetical_8c_a840902ada0e956eb01b529be178748cc_cgraph.md5 @@ -0,0 +1 @@ +5c7f8f4b0c810e86e37f0e4272419520 \ No newline at end of file diff --git a/d3/d78/words__alphabetical_8c_a840902ada0e956eb01b529be178748cc_cgraph.svg b/d3/d78/words__alphabetical_8c_a840902ada0e956eb01b529be178748cc_cgraph.svg new file mode 100644 index 000000000..eed10505d --- /dev/null +++ b/d3/d78/words__alphabetical_8c_a840902ada0e956eb01b529be178748cc_cgraph.svg @@ -0,0 +1,28 @@ + + + + + + +freeTreeMemory + + + +Node1 + + +freeTreeMemory + + + + + +Node1->Node1 + + + + + diff --git a/d3/d78/words__alphabetical_8c_a9e3cab68cf6557024f0073f674a307a1_cgraph.map b/d3/d78/words__alphabetical_8c_a9e3cab68cf6557024f0073f674a307a1_cgraph.map new file mode 100644 index 000000000..d3882bc2c --- /dev/null +++ b/d3/d78/words__alphabetical_8c_a9e3cab68cf6557024f0073f674a307a1_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/d3/d78/words__alphabetical_8c_a9e3cab68cf6557024f0073f674a307a1_cgraph.md5 b/d3/d78/words__alphabetical_8c_a9e3cab68cf6557024f0073f674a307a1_cgraph.md5 new file mode 100644 index 000000000..5362a4a3b --- /dev/null +++ b/d3/d78/words__alphabetical_8c_a9e3cab68cf6557024f0073f674a307a1_cgraph.md5 @@ -0,0 +1 @@ +5dc893a6fdc6d8fb564c6713dbfb422f \ No newline at end of file diff --git a/d3/d78/words__alphabetical_8c_a9e3cab68cf6557024f0073f674a307a1_cgraph.svg b/d3/d78/words__alphabetical_8c_a9e3cab68cf6557024f0073f674a307a1_cgraph.svg new file mode 100644 index 000000000..d18974104 --- /dev/null +++ b/d3/d78/words__alphabetical_8c_a9e3cab68cf6557024f0073f674a307a1_cgraph.svg @@ -0,0 +1,37 @@ + + + + + + +getPointerToWord + + + +Node1 + + +getPointerToWord + + + + + +Node2 + + +endProgramAbruptly + + + + + +Node1->Node2 + + + + + diff --git a/d3/d78/words__alphabetical_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map b/d3/d78/words__alphabetical_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map new file mode 100644 index 000000000..a1567a502 --- /dev/null +++ b/d3/d78/words__alphabetical_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/d3/d78/words__alphabetical_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 b/d3/d78/words__alphabetical_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 new file mode 100644 index 000000000..d01ac983b --- /dev/null +++ b/d3/d78/words__alphabetical_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 @@ -0,0 +1 @@ +be36d6f4f53a0150eca3a3195215aa18 \ No newline at end of file diff --git a/d3/d78/words__alphabetical_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/d3/d78/words__alphabetical_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg new file mode 100644 index 000000000..c83fdcdb0 --- /dev/null +++ b/d3/d78/words__alphabetical_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg @@ -0,0 +1,260 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +test + + + +Node1 + + +test + + + + + +Node2 + + +closeFile + + + + + +Node1->Node2 + + + + + +Node4 + + +freeTreeMemory + + + + + +Node1->Node4 + + + + + +Node5 + + +readWordsInFileToTree + + + + + +Node1->Node5 + + + + + +Node9 + + +writeContentOfTreeToFile + + + + + +Node1->Node9 + + + + + +Node3 + + +endProgramAbruptly + + + + + +Node2->Node3 + + + + + +Node4->Node4 + + + + + +Node6 + + +addWordToTree + + + + + +Node5->Node6 + + + + + +Node6->Node6 + + + + + +Node7 + + +allocateMemoryForNode + + + + + +Node6->Node7 + + + + + +Node8 + + +getPointerToWord + + + + + +Node6->Node8 + + + + + +Node7->Node3 + + + + + +Node8->Node3 + + + + + +Node9->Node9 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/d3/d78/words__alphabetical_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph_org.svg b/d3/d78/words__alphabetical_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph_org.svg new file mode 100644 index 000000000..aec1c2bd0 --- /dev/null +++ b/d3/d78/words__alphabetical_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph_org.svg @@ -0,0 +1,172 @@ + + + + + + +test + + + +Node1 + + +test + + + + + +Node2 + + +closeFile + + + + + +Node1->Node2 + + + + + +Node4 + + +freeTreeMemory + + + + + +Node1->Node4 + + + + + +Node5 + + +readWordsInFileToTree + + + + + +Node1->Node5 + + + + + +Node9 + + +writeContentOfTreeToFile + + + + + +Node1->Node9 + + + + + +Node3 + + +endProgramAbruptly + + + + + +Node2->Node3 + + + + + +Node4->Node4 + + + + + +Node6 + + +addWordToTree + + + + + +Node5->Node6 + + + + + +Node6->Node6 + + + + + +Node7 + + +allocateMemoryForNode + + + + + +Node6->Node7 + + + + + +Node8 + + +getPointerToWord + + + + + +Node6->Node8 + + + + + +Node7->Node3 + + + + + +Node8->Node3 + + + + + +Node9->Node9 + + + + + diff --git a/d3/d78/words__alphabetical_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d3/d78/words__alphabetical_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..189ac1b2e --- /dev/null +++ b/d3/d78/words__alphabetical_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/d3/d78/words__alphabetical_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d3/d78/words__alphabetical_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..84d3f89b7 --- /dev/null +++ b/d3/d78/words__alphabetical_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +831d6dc8fa591f7868b1f13716b19ba8 \ No newline at end of file diff --git a/d3/d78/words__alphabetical_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d3/d78/words__alphabetical_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..681074b88 --- /dev/null +++ b/d3/d78/words__alphabetical_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,275 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +test + + + + + +Node1->Node2 + + + + + +Node3 + + +closeFile + + + + + +Node2->Node3 + + + + + +Node5 + + +freeTreeMemory + + + + + +Node2->Node5 + + + + + +Node6 + + +readWordsInFileToTree + + + + + +Node2->Node6 + + + + + +Node10 + + +writeContentOfTreeToFile + + + + + +Node2->Node10 + + + + + +Node4 + + +endProgramAbruptly + + + + + +Node3->Node4 + + + + + +Node5->Node5 + + + + + +Node7 + + +addWordToTree + + + + + +Node6->Node7 + + + + + +Node7->Node7 + + + + + +Node8 + + +allocateMemoryForNode + + + + + +Node7->Node8 + + + + + +Node9 + + +getPointerToWord + + + + + +Node7->Node9 + + + + + +Node8->Node4 + + + + + +Node9->Node4 + + + + + +Node10->Node10 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/d3/d78/words__alphabetical_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg b/d3/d78/words__alphabetical_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg new file mode 100644 index 000000000..9ff00f6a7 --- /dev/null +++ b/d3/d78/words__alphabetical_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg @@ -0,0 +1,187 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +test + + + + + +Node1->Node2 + + + + + +Node3 + + +closeFile + + + + + +Node2->Node3 + + + + + +Node5 + + +freeTreeMemory + + + + + +Node2->Node5 + + + + + +Node6 + + +readWordsInFileToTree + + + + + +Node2->Node6 + + + + + +Node10 + + +writeContentOfTreeToFile + + + + + +Node2->Node10 + + + + + +Node4 + + +endProgramAbruptly + + + + + +Node3->Node4 + + + + + +Node5->Node5 + + + + + +Node7 + + +addWordToTree + + + + + +Node6->Node7 + + + + + +Node7->Node7 + + + + + +Node8 + + +allocateMemoryForNode + + + + + +Node7->Node8 + + + + + +Node9 + + +getPointerToWord + + + + + +Node7->Node9 + + + + + +Node8->Node4 + + + + + +Node9->Node4 + + + + + +Node10->Node10 + + + + + diff --git a/d3/d78/words__alphabetical_8c_af1f9b6eb320d872ba0766dc8bd070075_cgraph.map b/d3/d78/words__alphabetical_8c_af1f9b6eb320d872ba0766dc8bd070075_cgraph.map new file mode 100644 index 000000000..d41c84882 --- /dev/null +++ b/d3/d78/words__alphabetical_8c_af1f9b6eb320d872ba0766dc8bd070075_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/d3/d78/words__alphabetical_8c_af1f9b6eb320d872ba0766dc8bd070075_cgraph.md5 b/d3/d78/words__alphabetical_8c_af1f9b6eb320d872ba0766dc8bd070075_cgraph.md5 new file mode 100644 index 000000000..9c5d50fe8 --- /dev/null +++ b/d3/d78/words__alphabetical_8c_af1f9b6eb320d872ba0766dc8bd070075_cgraph.md5 @@ -0,0 +1 @@ +b0f84dd10b71679368f30be86524663d \ No newline at end of file diff --git a/d3/d78/words__alphabetical_8c_af1f9b6eb320d872ba0766dc8bd070075_cgraph.svg b/d3/d78/words__alphabetical_8c_af1f9b6eb320d872ba0766dc8bd070075_cgraph.svg new file mode 100644 index 000000000..731c9f7aa --- /dev/null +++ b/d3/d78/words__alphabetical_8c_af1f9b6eb320d872ba0766dc8bd070075_cgraph.svg @@ -0,0 +1,37 @@ + + + + + + +closeFile + + + +Node1 + + +closeFile + + + + + +Node2 + + +endProgramAbruptly + + + + + +Node1->Node2 + + + + + diff --git a/d3/d79/floyd__cycle__detection__algorithm_8c__incl.map b/d3/d79/floyd__cycle__detection__algorithm_8c__incl.map new file mode 100644 index 000000000..8b3bf7343 --- /dev/null +++ b/d3/d79/floyd__cycle__detection__algorithm_8c__incl.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/d3/d79/floyd__cycle__detection__algorithm_8c__incl.md5 b/d3/d79/floyd__cycle__detection__algorithm_8c__incl.md5 new file mode 100644 index 000000000..40ffd808c --- /dev/null +++ b/d3/d79/floyd__cycle__detection__algorithm_8c__incl.md5 @@ -0,0 +1 @@ +5d2660e30ad6adab6e60c653e1fbd1f4 \ No newline at end of file diff --git a/d3/d79/floyd__cycle__detection__algorithm_8c__incl.svg b/d3/d79/floyd__cycle__detection__algorithm_8c__incl.svg new file mode 100644 index 000000000..ed5a76136 --- /dev/null +++ b/d3/d79/floyd__cycle__detection__algorithm_8c__incl.svg @@ -0,0 +1,68 @@ + + + + + + +searching/floyd_cycle_detection_algorithm.c + + + +Node1 + + +searching/floyd_cycle +_detection_algorithm.c + + + + + +Node2 + + +assert.h + + + + + +Node1->Node2 + + + + + +Node3 + + +inttypes.h + + + + + +Node1->Node3 + + + + + +Node4 + + +stdio.h + + + + + +Node1->Node4 + + + + + diff --git a/d3/ddb/bead__sort_8c__incl.map b/d3/ddb/bead__sort_8c__incl.map index 6b4181b00..e4fa12380 100644 --- a/d3/ddb/bead__sort_8c__incl.map +++ b/d3/ddb/bead__sort_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/d3/ddb/bead__sort_8c__incl.svg b/d3/ddb/bead__sort_8c__incl.svg index 36c79de38..9e86ba45b 100644 --- a/d3/ddb/bead__sort_8c__incl.svg +++ b/d3/ddb/bead__sort_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - + sorting/bead_sort.c diff --git a/d4/d02/struct_b_s_t_iterator.html b/d4/d02/struct_b_s_t_iterator.html index 6cf9f01c8..c39c6cbed 100644 --- a/d4/d02/struct_b_s_t_iterator.html +++ b/d4/d02/struct_b_s_t_iterator.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: BSTIterator 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() {
@@ -92,29 +92,28 @@ $(document).ready(function(){initNavTree('d4/d02/struct_b_s_t_iterator.html','..
-
-
BSTIterator Struct Reference
+
BSTIterator Struct Reference

Definition for a binary tree node. More...

- - - -

+

Data Fields

+
int * values
 
+
int CurrentIndex
 
+
int NumberOfNodes
 

Detailed Description

-

Definition for a binary tree node.

-

struct TreeNode { int val; struct TreeNode *left; struct TreeNode *right; };

+

Definition for a binary tree node.

+

struct TreeNode { int val; struct TreeNode *left; struct TreeNode *right; };


The documentation for this struct was generated from the following file:
  • leetcode/src/173.c
@@ -124,7 +123,7 @@ int NumberOfNodes diff --git a/d4/d02/struct_b_s_t_iterator.js b/d4/d02/struct_b_s_t_iterator.js deleted file mode 100644 index c2d55ef28..000000000 --- a/d4/d02/struct_b_s_t_iterator.js +++ /dev/null @@ -1,6 +0,0 @@ -var struct_b_s_t_iterator = -[ - [ "CurrentIndex", "d4/d02/struct_b_s_t_iterator.html#a7b13dbbbe1bcbb12ec0bbe9949c66c5b", null ], - [ "NumberOfNodes", "d4/d02/struct_b_s_t_iterator.html#ae02c531c71091f43880fd7eb8f13cc53", null ], - [ "values", "d4/d02/struct_b_s_t_iterator.html#a29a6586bff08dc6985b29abb50ddc2ff", null ] -]; \ No newline at end of file diff --git a/d4/d07/ode__forward__euler_8c.html b/d4/d07/ode__forward__euler_8c.html index d230058c2..b8d6ae086 100644 --- a/d4/d07/ode__forward__euler_8c.html +++ b/d4/d07/ode__forward__euler_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: numerical_methods/ode_forward_euler.c 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/d07/ode__forward__euler_8c.html','. -
-
ode_forward_euler.c File Reference
+
ode_forward_euler.c 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 <math.h>
#include <stdio.h>
@@ -111,14 +110,14 @@ Include dependency graph for ode_forward_euler.c:
- - +

+

Macros

-#define order   2
+#define order   2
 number of dependent variables in problem
 
- @@ -132,14 +131,13 @@ Functions - - + +

+

Functions

void problem (const double *x, double *y, double *dy)
 Problem statement for a system with first-order differential equations. More...
double forward_euler (double dx, double x0, double x_max, double *y, char save_to_file)
 Compute approximation using the forward-Euler method in the given limits. More...
 
-int main (int argc, char *argv[])
 Main Function.
int main (int argc, char *argv[])
 Main Function. 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*}

@@ -147,12 +145,12 @@ int 

-

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.c, ode_semi_implicit_euler.c

Function Documentation

- +

◆ exact_solution()

@@ -179,7 +177,7 @@ int 

Exact solution of the problem.

-

Used for solution comparison.

+

Used for solution comparison.

Parameters
@@ -187,14 +185,14 @@ int 
[in]xindependent variable
69 {
-
70  y[0] = cos(x[0]);
-
71  y[1] = -sin(x[0]);
-
72 }
+
69{
+
70 y[0] = cos(x[0]);
+
71 y[1] = -sin(x[0]);
+
72}
- +

◆ forward_euler()

@@ -250,50 +248,50 @@ int 
Returns
time taken for computation in seconds
-
101 {
-
102  double dy[order];
-
103 
-
104  FILE *fp = NULL;
-
105  if (save_to_file)
-
106  {
-
107  fp = fopen("forward_euler.csv", "w+");
-
108  if (fp == NULL)
-
109  {
-
110  perror("Error! ");
-
111  return -1;
-
112  }
-
113  }
-
114 
-
115  /* start integration */
-
116  clock_t t1 = clock();
-
117  double x = x0;
-
118  do // iterate for each step of independent variable
-
119  {
-
120  if (save_to_file && fp)
-
121  fprintf(fp, "%.4g,%.4g,%.4g\n", x, y[0], y[1]); // write to file
-
122  forward_euler_step(dx, &x, y, dy); // perform integration
-
123  x += dx; // update step
-
124  } while (x <= x_max); // till upper limit of independent variable
-
125  /* end of integration */
-
126  clock_t t2 = clock();
-
127 
-
128  if (save_to_file && fp)
-
129  fclose(fp);
-
130 
-
131  return (double)(t2 - t1) / CLOCKS_PER_SEC;
-
132 }
+
101{
+
102 double dy[order];
+
103
+
104 FILE *fp = NULL;
+
105 if (save_to_file)
+
106 {
+
107 fp = fopen("forward_euler.csv", "w+");
+
108 if (fp == NULL)
+
109 {
+
110 perror("Error! ");
+
111 return -1;
+
112 }
+
113 }
+
114
+
115 /* start integration */
+
116 clock_t t1 = clock();
+
117 double x = x0;
+
118 do // iterate for each step of independent variable
+
119 {
+
120 if (save_to_file && fp)
+
121 fprintf(fp, "%.4g,%.4g,%.4g\n", x, y[0], y[1]); // write to file
+
122 forward_euler_step(dx, &x, y, dy); // perform integration
+
123 x += dx; // update step
+
124 } while (x <= x_max); // till upper limit of independent variable
+
125 /* end of integration */
+
126 clock_t t2 = clock();
+
127
+
128 if (save_to_file && fp)
+
129 fclose(fp);
+
130
+
131 return (double)(t2 - t1) / CLOCKS_PER_SEC;
+
132}
#define order
number of dependent variables in problem
Definition: ode_forward_euler.c:44
void forward_euler_step(const double dx, const double *x, double *y, double *dy)
Compute next step approximation using the forward-Euler method.
Definition: ode_forward_euler.c:82
Here is the call graph for this function:
-
+
- +

◆ forward_euler_step()

@@ -344,22 +342,105 @@ Here is the call graph for this function:
-
83 {
-
84  int o;
-
85  problem(x, y, dy);
-
86  for (o = 0; o < order; o++) y[o] += dx * dy[o];
-
87 }
+
83{
+
84 int o;
+
85 problem(x, y, dy);
+
86 for (o = 0; o < order; o++) y[o] += dx * dy[o];
+
87}
void problem(const double *x, double *y, double *dy)
Problem statement for a system with first-order differential equations.
Definition: ode_forward_euler.c:55
Here is the call graph for this function:
-
+
- + +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char * argv[] 
)
+
+ +

Main Function.

+
138{
+
139 double X0 = 0.f; /* initial value of x0 */
+
140 double X_MAX = 10.F; /* upper limit of integration */
+
141 double Y0[] = {1.f, 0.f}; /* initial value Y = y(x = x_0) */
+
142 double step_size;
+
143
+
144 if (argc == 1)
+
145 {
+
146 printf("\nEnter the step size: ");
+
147 scanf("%lg", &step_size);
+
148 }
+
149 else
+
150 // use commandline argument as independent variable step size
+
151 step_size = atof(argv[1]);
+
152
+
153 // get approximate solution
+
154 double total_time = forward_euler(step_size, X0, X_MAX, Y0, 1);
+
155 printf("\tTime = %.6g ms\n", total_time);
+
156
+
157 /* compute exact solution for comparion */
+
158 FILE *fp = fopen("exact.csv", "w+");
+
159 if (fp == NULL)
+
160 {
+
161 perror("Error! ");
+
162 return -1;
+
163 }
+
164 double x = X0;
+
165 double *y = &(Y0[0]);
+
166 printf("Finding exact solution\n");
+
167 clock_t t1 = clock();
+
168
+
169 do
+
170 {
+
171 fprintf(fp, "%.4g,%.4g,%.4g\n", x, y[0], y[1]); // write to file
+
172 exact_solution(&x, y);
+
173 x += step_size;
+
174 } while (x <= X_MAX);
+
175
+
176 clock_t t2 = clock();
+
177 total_time = (t2 - t1) / CLOCKS_PER_SEC;
+
178 printf("\tTime = %.6g ms\n", total_time);
+
179 fclose(fp);
+
180
+
181 return 0;
+
182}
+
void exact_solution(const double *x, double *y)
Exact solution of the problem.
Definition: ode_forward_euler.c:68
+
double forward_euler(double dx, double x0, double x_max, double *y, char save_to_file)
Compute approximation using the forward-Euler method in the given limits.
Definition: ode_forward_euler.c:99
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+

◆ problem()

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

Problem statement for a system with first-order differential equations.

-

Updates the system differential variables.

Note
This function can be updated to and ode of any order.
+

Updates the system differential variables.

Note
This function can be updated to and ode of any order.
Parameters
@@ -401,11 +482,11 @@ Here is the call graph for this function:
[in]xindependent variable(s)
-
56 {
-
57  const double omega = 1.F; // some const for the problem
-
58  dy[0] = y[1]; // x dot
-
59  dy[1] = -omega * omega * y[0]; // y dot
-
60 }
+
56{
+
57 const double omega = 1.F; // some const for the problem
+
58 dy[0] = y[1]; // x dot
+
59 dy[1] = -omega * omega * y[0]; // y dot
+
60}
@@ -415,7 +496,7 @@ Here is the call graph for this function:
diff --git a/d4/d07/ode__forward__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map b/d4/d07/ode__forward__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map new file mode 100644 index 000000000..bad493dd0 --- /dev/null +++ b/d4/d07/ode__forward__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/d4/d07/ode__forward__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 b/d4/d07/ode__forward__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 new file mode 100644 index 000000000..969a83fdd --- /dev/null +++ b/d4/d07/ode__forward__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 @@ -0,0 +1 @@ +e7da793996a5f6a53b2d259e0ce9ef9a \ No newline at end of file diff --git a/d4/d07/ode__forward__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg b/d4/d07/ode__forward__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg new file mode 100644 index 000000000..0a01a33ae --- /dev/null +++ b/d4/d07/ode__forward__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg @@ -0,0 +1,82 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +exact_solution + + + + + +Node1->Node2 + + + + + +Node3 + + +forward_euler + + + + + +Node1->Node3 + + + + + +Node4 + + +forward_euler_step + + + + + +Node3->Node4 + + + + + +Node5 + + +problem + + + + + +Node4->Node5 + + + + + diff --git a/d4/d07/ode__forward__euler_8c_aaf88ad8f9f7c39fc38f3f03d6fea9df9_cgraph.map b/d4/d07/ode__forward__euler_8c_aaf88ad8f9f7c39fc38f3f03d6fea9df9_cgraph.map index 3cf48f36b..9ed443719 100644 --- a/d4/d07/ode__forward__euler_8c_aaf88ad8f9f7c39fc38f3f03d6fea9df9_cgraph.map +++ b/d4/d07/ode__forward__euler_8c_aaf88ad8f9f7c39fc38f3f03d6fea9df9_cgraph.map @@ -1,5 +1,5 @@ - - - + + + diff --git a/d4/d07/ode__forward__euler_8c_aaf88ad8f9f7c39fc38f3f03d6fea9df9_cgraph.svg b/d4/d07/ode__forward__euler_8c_aaf88ad8f9f7c39fc38f3f03d6fea9df9_cgraph.svg index 37c9a5605..4f5972e93 100644 --- a/d4/d07/ode__forward__euler_8c_aaf88ad8f9f7c39fc38f3f03d6fea9df9_cgraph.svg +++ b/d4/d07/ode__forward__euler_8c_aaf88ad8f9f7c39fc38f3f03d6fea9df9_cgraph.svg @@ -1,20 +1,20 @@ - - + forward_euler - + Node1 - -forward_euler + +forward_euler @@ -22,31 +22,31 @@ Node2 - -forward_euler_step + +forward_euler_step Node1->Node2 - - + + Node3 - -problem + +problem Node2->Node3 - - + + diff --git a/d4/d07/ode__forward__euler_8c_ae6c9413953c8d9d4bc9e374b29586350_cgraph.map b/d4/d07/ode__forward__euler_8c_ae6c9413953c8d9d4bc9e374b29586350_cgraph.map index 98e9cc2e7..b6ac45847 100644 --- a/d4/d07/ode__forward__euler_8c_ae6c9413953c8d9d4bc9e374b29586350_cgraph.map +++ b/d4/d07/ode__forward__euler_8c_ae6c9413953c8d9d4bc9e374b29586350_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/d4/d07/ode__forward__euler_8c_ae6c9413953c8d9d4bc9e374b29586350_cgraph.svg b/d4/d07/ode__forward__euler_8c_ae6c9413953c8d9d4bc9e374b29586350_cgraph.svg index e61771fa1..2ff59d8ea 100644 --- a/d4/d07/ode__forward__euler_8c_ae6c9413953c8d9d4bc9e374b29586350_cgraph.svg +++ b/d4/d07/ode__forward__euler_8c_ae6c9413953c8d9d4bc9e374b29586350_cgraph.svg @@ -1,20 +1,20 @@ - - + forward_euler_step - + Node1 - -forward_euler_step + +forward_euler_step @@ -22,16 +22,16 @@ Node2 - -problem + +problem Node1->Node2 - - + + diff --git a/d4/d15/qr__eigen__values_8c__incl.map b/d4/d15/qr__eigen__values_8c__incl.map index c5b2f13b9..9afa18c90 100644 --- a/d4/d15/qr__eigen__values_8c__incl.map +++ b/d4/d15/qr__eigen__values_8c__incl.map @@ -1,9 +1,9 @@ - + - - - - - + + + + + diff --git a/d4/d15/qr__eigen__values_8c__incl.svg b/d4/d15/qr__eigen__values_8c__incl.svg index 87b4923ea..dd2dc84a5 100644 --- a/d4/d15/qr__eigen__values_8c__incl.svg +++ b/d4/d15/qr__eigen__values_8c__incl.svg @@ -1,21 +1,21 @@ - - + numerical_methods/qr_eigen_values.c - + Node1 - -numerical_methods/qr -_eigen_values.c + +numerical_methods/qr +_eigen_values.c @@ -31,101 +31,101 @@ Node1->Node2 - - + + Node3 - -math.h + +math.h Node1->Node3 - - + + Node4 - -stdio.h + +stdio.h Node1->Node4 - - + + Node5 - -stdlib.h + +stdlib.h Node1->Node5 - - + + Node6 - -time.h + +time.h Node1->Node6 - - + + Node7 - -qr_decompose.h + +qr_decompose.h Node1->Node7 - - + + Node7->Node3 - - + + Node7->Node4 - - + + Node7->Node5 - - + + diff --git a/d4/d22/struct_trie_node__coll__graph.map b/d4/d22/struct_trie_node__coll__graph.map index 77df700a3..a09e5f84f 100644 --- a/d4/d22/struct_trie_node__coll__graph.map +++ b/d4/d22/struct_trie_node__coll__graph.map @@ -1,3 +1,3 @@ - + diff --git a/d4/d22/struct_trie_node__coll__graph.svg b/d4/d22/struct_trie_node__coll__graph.svg index 8e1abc0b6..41d367026 100644 --- a/d4/d22/struct_trie_node__coll__graph.svg +++ b/d4/d22/struct_trie_node__coll__graph.svg @@ -1,29 +1,29 @@ - - + TrieNode - + Node1 - -TrieNode + +TrieNode Node1->Node1 - - - children + + + children diff --git a/d4/d25/hash__sdbm_8c__incl.map b/d4/d25/hash__sdbm_8c__incl.map index 9774aef8a..6de61906c 100644 --- a/d4/d25/hash__sdbm_8c__incl.map +++ b/d4/d25/hash__sdbm_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/d4/d25/hash__sdbm_8c__incl.svg b/d4/d25/hash__sdbm_8c__incl.svg index 535d1af8a..faec95c73 100644 --- a/d4/d25/hash__sdbm_8c__incl.svg +++ b/d4/d25/hash__sdbm_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - + hash/hash_sdbm.c diff --git a/d4/d26/postfix__evaluation_8c__incl.map b/d4/d26/postfix__evaluation_8c__incl.map new file mode 100644 index 000000000..ef9c6da80 --- /dev/null +++ b/d4/d26/postfix__evaluation_8c__incl.map @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/d4/d26/postfix__evaluation_8c__incl.md5 b/d4/d26/postfix__evaluation_8c__incl.md5 new file mode 100644 index 000000000..5f12fd422 --- /dev/null +++ b/d4/d26/postfix__evaluation_8c__incl.md5 @@ -0,0 +1 @@ +536253fb06b3e7e54fd00b71cc15c28b \ No newline at end of file diff --git a/d4/d26/postfix__evaluation_8c__incl.svg b/d4/d26/postfix__evaluation_8c__incl.svg new file mode 100644 index 000000000..ff25964e3 --- /dev/null +++ b/d4/d26/postfix__evaluation_8c__incl.svg @@ -0,0 +1,112 @@ + + + + + + +misc/postfix_evaluation.c + + + +Node1 + + +misc/postfix_evaluation.c + + + + + +Node2 + + +stdio.h + + + + + +Node1->Node2 + + + + + +Node3 + + +string.h + + + + + +Node1->Node3 + + + + + +Node4 + + +ctype.h + + + + + +Node1->Node4 + + + + + +Node5 + + +stdlib.h + + + + + +Node1->Node5 + + + + + +Node6 + + +stdint.h + + + + + +Node1->Node6 + + + + + +Node7 + + +assert.h + + + + + +Node1->Node7 + + + + + diff --git a/d4/d2d/struct_c_array.html b/d4/d2d/struct_c_array.html index f6480127a..a2ce5dc29 100644 --- a/d4/d2d/struct_c_array.html +++ b/d4/d2d/struct_c_array.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: CArray 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() {
@@ -92,17 +92,16 @@ $(document).ready(function(){initNavTree('d4/d2d/struct_c_array.html','../../');
-
-
CArray Struct Reference
+
CArray Struct Reference
- - -

+

Data Fields

+
int * array
 
+
int size
 
@@ -115,7 +114,7 @@ int size diff --git a/d4/d2d/struct_c_array.js b/d4/d2d/struct_c_array.js deleted file mode 100644 index a61cdd368..000000000 --- a/d4/d2d/struct_c_array.js +++ /dev/null @@ -1,5 +0,0 @@ -var struct_c_array = -[ - [ "array", "d4/d2d/struct_c_array.html#a53c08029937d9e4c45defcbf9c8898ae", null ], - [ "size", "d4/d2d/struct_c_array.html#a7f7310046fa06b26a1ff7772500724ee", null ] -]; \ No newline at end of file diff --git a/d4/d3c/words__alphabetical_8c__incl.map b/d4/d3c/words__alphabetical_8c__incl.map new file mode 100644 index 000000000..ce480c6ca --- /dev/null +++ b/d4/d3c/words__alphabetical_8c__incl.map @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/d4/d3c/words__alphabetical_8c__incl.md5 b/d4/d3c/words__alphabetical_8c__incl.md5 new file mode 100644 index 000000000..2fed2cdce --- /dev/null +++ b/d4/d3c/words__alphabetical_8c__incl.md5 @@ -0,0 +1 @@ +547fb994f89b1ab6ba1c65cba2a94379 \ No newline at end of file diff --git a/d4/d3c/words__alphabetical_8c__incl.svg b/d4/d3c/words__alphabetical_8c__incl.svg new file mode 100644 index 000000000..a7ebf1328 --- /dev/null +++ b/d4/d3c/words__alphabetical_8c__incl.svg @@ -0,0 +1,128 @@ + + + + + + +data_structures/binary_trees/words_alphabetical.c + + + +Node1 + + +data_structures/binary +_trees/words_alphabetical.c + + + + + +Node2 + + +assert.h + + + + + +Node1->Node2 + + + + + +Node3 + + +ctype.h + + + + + +Node1->Node3 + + + + + +Node4 + + +inttypes.h + + + + + +Node1->Node4 + + + + + +Node5 + + +stdbool.h + + + + + +Node1->Node5 + + + + + +Node6 + + +stdio.h + + + + + +Node1->Node6 + + + + + +Node7 + + +stdlib.h + + + + + +Node1->Node7 + + + + + +Node8 + + +string.h + + + + + +Node1->Node8 + + + + + diff --git a/d4/d4c/md__c_o_d_e__o_f__c_o_n_d_u_c_t.html b/d4/d4c/md__c_o_d_e__o_f__c_o_n_d_u_c_t.html index fe1055de6..2935a19ab 100644 --- a/d4/d4c/md__c_o_d_e__o_f__c_o_n_d_u_c_t.html +++ b/d4/d4c/md__c_o_d_e__o_f__c_o_n_d_u_c_t.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Contributor Covenant Code of Conduct @@ -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,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/d5b/selection__sort_8c__incl.svg b/d4/d5b/selection__sort_8c__incl.svg index 87c93751c..772674087 100644 --- a/d4/d5b/selection__sort_8c__incl.svg +++ b/d4/d5b/selection__sort_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - + sorting/selection_sort.c diff --git a/d4/d64/bubble__sort__2_8c__incl.map b/d4/d64/bubble__sort__2_8c__incl.map index 982e5512d..0dd66da46 100644 --- a/d4/d64/bubble__sort__2_8c__incl.map +++ b/d4/d64/bubble__sort__2_8c__incl.map @@ -1,6 +1,6 @@ - + - + diff --git a/d4/d64/bubble__sort__2_8c__incl.svg b/d4/d64/bubble__sort__2_8c__incl.svg index b07406f09..4db966595 100644 --- a/d4/d64/bubble__sort__2_8c__incl.svg +++ b/d4/d64/bubble__sort__2_8c__incl.svg @@ -1,19 +1,19 @@ - - + sorting/bubble_sort_2.c - + Node1 - + sorting/bubble_sort_2.c @@ -52,16 +52,16 @@ Node4 - -stdbool.h + +stdbool.h Node1->Node4 - - + + diff --git a/d4/d68/qr__decompose_8h.html b/d4/d68/qr__decompose_8h.html index f388b523b..cb77a92cf 100644 --- a/d4/d68/qr__decompose_8h.html +++ b/d4/d68/qr__decompose_8h.html @@ -2,8 +2,8 @@ - - + + 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() {
@@ -92,12 +92,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 <math.h>
#include <stdio.h>
@@ -111,13 +110,13 @@ Include dependency graph for qr_decompose.h:
This graph shows which files directly or indirectly include this file:
-
+

Go to the source code of this file.

- @@ -128,21 +127,21 @@ Functions - - - - - - + + + + + + - +

+

Functions

void print_matrix (double **A, int M, int N)
 function to display matrix on stdout More...
double vector_mag (double *vector, int L)
 Compute magnitude of vector. More...
 
double * vector_proj (double *a, double *b, double *out, int L)
 Compute projection of vector \(\vec{a}\) on \(\vec{b}\) defined as. More...
 
double * vector_sub (double *a, double *b, double *out, int L)
 Compute vector subtraction. More...
 
double * vector_proj (double *a, double *b, double *out, int L)
 Compute projection of vector \(\vec{a}\) on \(\vec{b}\) defined as. More...
 
double * vector_sub (double *a, double *b, double *out, int L)
 Compute vector subtraction. More...
 
void qr_decompose (double **A, double **Q, double **R, int M, int N)
 Decompose matrix \(A\) using Gram-Schmidt process. More...
 Decompose matrix \(A\) using Gram-Schmidt process. More...
 

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

Function Documentation

- +

◆ print_matrix()

@@ -183,18 +182,18 @@ Functions -
25 {
-
26  for (int row = 0; row < M; row++)
-
27  {
-
28  for (int col = 0; col < N; col++) printf("% 9.3g\t", A[row][col]);
-
29  putchar('\n');
-
30  }
-
31  putchar('\n');
-
32 }
+
25{
+
26 for (int row = 0; row < M; row++)
+
27 {
+
28 for (int col = 0; col < N; col++) printf("% 9.3g\t", A[row][col]);
+
29 putchar('\n');
+
30 }
+
31 putchar('\n');
+
32}
- +

◆ qr_decompose()

@@ -238,7 +237,7 @@ Functions
-

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*}

@@ -252,74 +251,74 @@ Functions -
148 {
-
149  double *col_vector = (double *)malloc(M * sizeof(double));
-
150  double *col_vector2 = (double *)malloc(M * sizeof(double));
-
151  double *tmp_vector = (double *)malloc(M * sizeof(double));
-
152  for (int i = 0; i < N;
-
153  i++) /* for each column => R is a square matrix of NxN */
-
154  {
-
155  int j;
-
156 #ifdef _OPENMP
-
157 // parallelize on threads
-
158 #pragma omp for
-
159 #endif
-
160  for (j = 0; j < i; j++) /* second dimension of column */
-
161  R[i][j] = 0.; /* make R upper triangular */
-
162 
-
163  /* get corresponding Q vector */
-
164 #ifdef _OPENMP
-
165 // parallelize on threads
-
166 #pragma omp for
-
167 #endif
-
168  for (j = 0; j < M; j++)
-
169  {
-
170  tmp_vector[j] = A[j][i]; /* accumulator for uk */
-
171  col_vector[j] = A[j][i];
-
172  }
-
173  for (j = 0; j < i; j++)
-
174  {
-
175  for (int k = 0; k < M; k++) col_vector2[k] = Q[k][j];
-
176  vector_proj(col_vector, col_vector2, col_vector2, M);
-
177  vector_sub(tmp_vector, col_vector2, tmp_vector, M);
-
178  }
-
179  double mag = vector_mag(tmp_vector, M);
-
180 
-
181 #ifdef _OPENMP
-
182 // parallelize on threads
-
183 #pragma omp for
-
184 #endif
-
185  for (j = 0; j < M; j++) Q[j][i] = tmp_vector[j] / mag;
-
186 
-
187  /* compute upper triangular values of R */
-
188  for (int kk = 0; kk < M; kk++) col_vector[kk] = Q[kk][i];
-
189  for (int k = i; k < N; k++)
-
190  {
-
191  for (int kk = 0; kk < M; kk++) col_vector2[kk] = A[kk][k];
-
192  R[i][k] = vector_dot(col_vector, col_vector2, M);
-
193  }
-
194  }
-
195 
-
196  free(col_vector);
-
197  free(col_vector2);
-
198  free(tmp_vector);
-
199 }
+
148{
+
149 double *col_vector = (double *)malloc(M * sizeof(double));
+
150 double *col_vector2 = (double *)malloc(M * sizeof(double));
+
151 double *tmp_vector = (double *)malloc(M * sizeof(double));
+
152 for (int i = 0; i < N;
+
153 i++) /* for each column => R is a square matrix of NxN */
+
154 {
+
155 int j;
+
156#ifdef _OPENMP
+
157// parallelize on threads
+
158#pragma omp for
+
159#endif
+
160 for (j = 0; j < i; j++) /* second dimension of column */
+
161 R[i][j] = 0.; /* make R upper triangular */
+
162
+
163 /* get corresponding Q vector */
+
164#ifdef _OPENMP
+
165// parallelize on threads
+
166#pragma omp for
+
167#endif
+
168 for (j = 0; j < M; j++)
+
169 {
+
170 tmp_vector[j] = A[j][i]; /* accumulator for uk */
+
171 col_vector[j] = A[j][i];
+
172 }
+
173 for (j = 0; j < i; j++)
+
174 {
+
175 for (int k = 0; k < M; k++) col_vector2[k] = Q[k][j];
+
176 vector_proj(col_vector, col_vector2, col_vector2, M);
+
177 vector_sub(tmp_vector, col_vector2, tmp_vector, M);
+
178 }
+
179 double mag = vector_mag(tmp_vector, M);
+
180
+
181#ifdef _OPENMP
+
182// parallelize on threads
+
183#pragma omp for
+
184#endif
+
185 for (j = 0; j < M; j++) Q[j][i] = tmp_vector[j] / mag;
+
186
+
187 /* compute upper triangular values of R */
+
188 for (int kk = 0; kk < M; kk++) col_vector[kk] = Q[kk][i];
+
189 for (int k = i; k < N; k++)
+
190 {
+
191 for (int kk = 0; kk < M; kk++) col_vector2[kk] = A[kk][k];
+
192 R[i][k] = vector_dot(col_vector, col_vector2, M);
+
193 }
+
194 }
+
195
+
196 free(col_vector);
+
197 free(col_vector2);
+
198 free(tmp_vector);
+
199}
#define malloc(bytes)
This macro replace the standard malloc function with malloc_dbg.
Definition: malloc_dbg.h:18
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
+
double * vector_proj(double *a, double *b, double *out, int L)
Compute projection of vector on defined as.
Definition: qr_decompose.h:76
double vector_dot(double *a, double *b, int L)
Compute dot product of two vectors of equal lengths.
Definition: qr_decompose.h:43
-
double * vector_sub(double *a, double *b, double *out, int L)
Compute vector subtraction.
Definition: qr_decompose.h:101
-
double * vector_proj(double *a, double *b, double *out, int L)
Compute projection of vector on defined as.
Definition: qr_decompose.h:76
+
double * vector_sub(double *a, double *b, double *out, int L)
Compute vector subtraction.
Definition: qr_decompose.h:101
double vector_mag(double *vector, int L)
Compute magnitude of vector.
Definition: qr_decompose.h:64
Here is the call graph for this function:
-
+
- +

◆ vector_dot()

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

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\)

+

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}\)
-
44 {
-
45  double mag = 0.f;
-
46  int i;
-
47 #ifdef _OPENMP
-
48 // parallelize on threads
-
49 #pragma omp parallel for reduction(+ : mag)
-
50 #endif
-
51  for (i = 0; i < L; i++) mag += a[i] * b[i];
-
52 
-
53  return mag;
-
54 }
+
44{
+
45 double mag = 0.f;
+
46 int i;
+
47#ifdef _OPENMP
+
48// parallelize on threads
+
49#pragma omp parallel for reduction(+ : mag)
+
50#endif
+
51 for (i = 0; i < L; i++) mag += a[i] * b[i];
+
52
+
53 return mag;
+
54}
Definition: list.h:8
- +

◆ vector_mag()

@@ -396,29 +395,29 @@ Here is the call graph for this function:

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}\)

+

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|\)
-
65 {
-
66  double dot = vector_dot(vector, vector, L);
-
67  return sqrt(dot);
-
68 }
+
65{
+
66 double dot = vector_dot(vector, vector, L);
+
67 return sqrt(dot);
+
68}
Here is the call graph for this function:
-
+
- -

◆ vector_proj()

+ +

◆ vector_proj()

- + @@ -454,40 +453,40 @@ Here is the call graph for this function: \[\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

-
77 {
-
78  const double num = vector_dot(a, b, L);
-
79  const double deno = vector_dot(b, b, L);
-
80  if (deno == 0) /*! check for division by zero */
-
81  return NULL;
-
82 
-
83  const double scalar = num / deno;
-
84  int i;
-
85 #ifdef _OPENMP
-
86 // parallelize on threads
-
87 #pragma omp for
-
88 #endif
-
89  for (i = 0; i < L; i++) out[i] = scalar * b[i];
-
90 
-
91  return out;
-
92 }
+

check for division by zero

+
77{
+
78 const double num = vector_dot(a, b, L);
+
79 const double deno = vector_dot(b, b, L);
+
80 if (deno == 0) /*! check for division by zero */
+
81 return NULL;
+
82
+
83 const double scalar = num / deno;
+
84 int i;
+
85#ifdef _OPENMP
+
86// parallelize on threads
+
87#pragma omp for
+
88#endif
+
89 for (i = 0; i < L; i++) out[i] = scalar * b[i];
+
90
+
91 return out;
+
92}
Here is the call graph for this function:
-
+
- -

◆ vector_sub()

+ +

◆ vector_sub()

double* vector_proj double * vector_proj ( double *  a,
- + @@ -519,7 +518,7 @@ Here is the call graph for this function:

Compute vector subtraction.

-

\(\vec{c}=\vec{a}-\vec{b}\)

+

\(\vec{c}=\vec{a}-\vec{b}\)

Returns
pointer to output vector
Parameters
double* vector_sub double * vector_sub ( double *  a,
@@ -530,16 +529,16 @@ Here is the call graph for this function:
-
106 {
-
107  int i;
-
108 #ifdef _OPENMP
-
109 // parallelize on threads
-
110 #pragma omp for
-
111 #endif
-
112  for (i = 0; i < L; i++) out[i] = a[i] - b[i];
-
113 
-
114  return out;
-
115 }
+
106{
+
107 int i;
+
108#ifdef _OPENMP
+
109// parallelize on threads
+
110#pragma omp for
+
111#endif
+
112 for (i = 0; i < L; i++) out[i] = a[i] - b[i];
+
113
+
114 return out;
+
115}
@@ -549,7 +548,7 @@ Here is the call graph for this function:
diff --git a/d4/d68/qr__decompose_8h.js b/d4/d68/qr__decompose_8h.js index 070e43b43..348fb50e0 100644 --- a/d4/d68/qr__decompose_8h.js +++ b/d4/d68/qr__decompose_8h.js @@ -4,6 +4,6 @@ var qr__decompose_8h = [ "qr_decompose", "d4/d68/qr__decompose_8h.html#a45c7640d9d22c89c11beb1f567843c56", null ], [ "vector_dot", "d4/d68/qr__decompose_8h.html#a3a584b79941a43d775f9d4ce446dbe05", null ], [ "vector_mag", "d4/d68/qr__decompose_8h.html#abeec1f78a7a7e7251687e75340331212", null ], - [ "vector_proj", "d4/d68/qr__decompose_8h.html#a82b20e027437df768d7e994cf4cae29f", null ], - [ "vector_sub", "d4/d68/qr__decompose_8h.html#a6b6a0e75e75ff7919057dd275bb69145", null ] + [ "vector_proj", "d4/d68/qr__decompose_8h.html#a2ed4977f38642dca8b10c16a823c740b", null ], + [ "vector_sub", "d4/d68/qr__decompose_8h.html#a5ee39e7c8fce8a604dcf7009ce101c02", null ] ]; \ No newline at end of file diff --git a/d4/d68/qr__decompose_8h_a82b20e027437df768d7e994cf4cae29f_cgraph.map b/d4/d68/qr__decompose_8h_a2ed4977f38642dca8b10c16a823c740b_cgraph.map similarity index 66% rename from d4/d68/qr__decompose_8h_a82b20e027437df768d7e994cf4cae29f_cgraph.map rename to d4/d68/qr__decompose_8h_a2ed4977f38642dca8b10c16a823c740b_cgraph.map index dbb55da26..3b13d21f5 100644 --- a/d4/d68/qr__decompose_8h_a82b20e027437df768d7e994cf4cae29f_cgraph.map +++ b/d4/d68/qr__decompose_8h_a2ed4977f38642dca8b10c16a823c740b_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/d4/d68/qr__decompose_8h_a82b20e027437df768d7e994cf4cae29f_cgraph.md5 b/d4/d68/qr__decompose_8h_a2ed4977f38642dca8b10c16a823c740b_cgraph.md5 similarity index 100% rename from d4/d68/qr__decompose_8h_a82b20e027437df768d7e994cf4cae29f_cgraph.md5 rename to d4/d68/qr__decompose_8h_a2ed4977f38642dca8b10c16a823c740b_cgraph.md5 diff --git a/d4/d68/qr__decompose_8h_a82b20e027437df768d7e994cf4cae29f_cgraph.svg b/d4/d68/qr__decompose_8h_a2ed4977f38642dca8b10c16a823c740b_cgraph.svg similarity index 54% rename from d4/d68/qr__decompose_8h_a82b20e027437df768d7e994cf4cae29f_cgraph.svg rename to d4/d68/qr__decompose_8h_a2ed4977f38642dca8b10c16a823c740b_cgraph.svg index 4602f9e82..d11ee50da 100644 --- a/d4/d68/qr__decompose_8h_a82b20e027437df768d7e994cf4cae29f_cgraph.svg +++ b/d4/d68/qr__decompose_8h_a2ed4977f38642dca8b10c16a823c740b_cgraph.svg @@ -1,20 +1,20 @@ - - + vector_proj - + Node1 - -vector_proj + +vector_proj @@ -22,16 +22,16 @@ Node2 - -vector_dot + +vector_dot Node1->Node2 - - + + diff --git a/d4/d68/qr__decompose_8h_a45c7640d9d22c89c11beb1f567843c56_cgraph.map b/d4/d68/qr__decompose_8h_a45c7640d9d22c89c11beb1f567843c56_cgraph.map index a2f03e3aa..33485eea2 100644 --- a/d4/d68/qr__decompose_8h_a45c7640d9d22c89c11beb1f567843c56_cgraph.map +++ b/d4/d68/qr__decompose_8h_a45c7640d9d22c89c11beb1f567843c56_cgraph.map @@ -1,7 +1,7 @@ - - - - - + + + + + diff --git a/d4/d68/qr__decompose_8h_a45c7640d9d22c89c11beb1f567843c56_cgraph.md5 b/d4/d68/qr__decompose_8h_a45c7640d9d22c89c11beb1f567843c56_cgraph.md5 index f89adb5bd..22db7b1db 100644 --- a/d4/d68/qr__decompose_8h_a45c7640d9d22c89c11beb1f567843c56_cgraph.md5 +++ b/d4/d68/qr__decompose_8h_a45c7640d9d22c89c11beb1f567843c56_cgraph.md5 @@ -1 +1 @@ -d299f1aeb0c744b8768533fcd5126c12 \ No newline at end of file +cba31c9764636ddaead490ac0e522ecc \ No newline at end of file diff --git a/d4/d68/qr__decompose_8h_a45c7640d9d22c89c11beb1f567843c56_cgraph.svg b/d4/d68/qr__decompose_8h_a45c7640d9d22c89c11beb1f567843c56_cgraph.svg index 187673d08..ebd467359 100644 --- a/d4/d68/qr__decompose_8h_a45c7640d9d22c89c11beb1f567843c56_cgraph.svg +++ b/d4/d68/qr__decompose_8h_a45c7640d9d22c89c11beb1f567843c56_cgraph.svg @@ -1,20 +1,20 @@ - - - + + qr_decompose - + Node1 - -qr_decompose + +qr_decompose @@ -22,73 +22,73 @@ Node2 - -vector_dot + +vector_dot Node1->Node2 - - + + Node3 - -vector_mag + +vector_mag Node1->Node3 - - + + Node4 - - -vector_proj + + +vector_proj Node1->Node4 - - + + Node5 - - -vector_sub + + +vector_sub Node1->Node5 - - + + Node3->Node2 - - + + Node4->Node2 - - + + diff --git a/d4/d68/qr__decompose_8h_abeec1f78a7a7e7251687e75340331212_cgraph.map b/d4/d68/qr__decompose_8h_abeec1f78a7a7e7251687e75340331212_cgraph.map index 2938c0c15..42429928f 100644 --- a/d4/d68/qr__decompose_8h_abeec1f78a7a7e7251687e75340331212_cgraph.map +++ b/d4/d68/qr__decompose_8h_abeec1f78a7a7e7251687e75340331212_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/d4/d68/qr__decompose_8h_abeec1f78a7a7e7251687e75340331212_cgraph.svg b/d4/d68/qr__decompose_8h_abeec1f78a7a7e7251687e75340331212_cgraph.svg index 2d0e3b62d..e3e26ddb8 100644 --- a/d4/d68/qr__decompose_8h_abeec1f78a7a7e7251687e75340331212_cgraph.svg +++ b/d4/d68/qr__decompose_8h_abeec1f78a7a7e7251687e75340331212_cgraph.svg @@ -1,20 +1,20 @@ - - + vector_mag - + Node1 - -vector_mag + +vector_mag @@ -22,16 +22,16 @@ Node2 - -vector_dot + +vector_dot Node1->Node2 - - + + diff --git a/d4/d68/qr__decompose_8h_source.html b/d4/d68/qr__decompose_8h_source.html index 94bc42ad9..582798a97 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,217 +90,216 @@ $(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 QR_DECOMPOSE_H
-
10 #define QR_DECOMPOSE_H
-
11 
-
12 #include <math.h>
-
13 #include <stdio.h>
-
14 #include <stdlib.h>
-
15 #ifdef _OPENMP
-
16 #include <omp.h>
-
17 #endif
-
18 
-
19 /**
-
20  * function to display matrix on stdout
-
21  */
-
22 void print_matrix(double **A, /**< matrix to print */
-
23  int M, /**< number of rows of matrix */
-
24  int N) /**< number of columns of matrix */
-
25 {
-
26  for (int row = 0; row < M; row++)
-
27  {
-
28  for (int col = 0; col < N; col++) printf("% 9.3g\t", A[row][col]);
-
29  putchar('\n');
-
30  }
-
31  putchar('\n');
-
32 }
-
33 
-
34 /**
-
35  * Compute dot product of two vectors of equal lengths
-
36  *
-
37  * If \f$\vec{a}=\left[a_0,a_1,a_2,...,a_L\right]\f$ and
-
38  * \f$\vec{b}=\left[b_0,b_1,b_1,...,b_L\right]\f$ then
-
39  * \f$\vec{a}\cdot\vec{b}=\displaystyle\sum_{i=0}^L a_i\times b_i\f$
-
40  *
-
41  * \returns \f$\vec{a}\cdot\vec{b}\f$
-
42  */
-
43 double vector_dot(double *a, double *b, int L)
-
44 {
-
45  double mag = 0.f;
-
46  int i;
-
47 #ifdef _OPENMP
-
48 // parallelize on threads
-
49 #pragma omp parallel for reduction(+ : mag)
-
50 #endif
-
51  for (i = 0; i < L; i++) mag += a[i] * b[i];
-
52 
-
53  return mag;
-
54 }
-
55 
-
56 /**
-
57  * Compute magnitude of vector.
-
58  *
-
59  * If \f$\vec{a}=\left[a_0,a_1,a_2,...,a_L\right]\f$ then
-
60  * \f$\left|\vec{a}\right|=\sqrt{\displaystyle\sum_{i=0}^L a_i^2}\f$
-
61  *
-
62  * \returns \f$\left|\vec{a}\right|\f$
-
63  */
-
64 double vector_mag(double *vector, int L)
-
65 {
-
66  double dot = vector_dot(vector, vector, L);
-
67  return sqrt(dot);
-
68 }
-
69 
-
70 /**
-
71  * Compute projection of vector \f$\vec{a}\f$ on \f$\vec{b}\f$ defined as
-
72  * \f[\text{proj}_\vec{b}\vec{a}=\frac{\vec{a}\cdot\vec{b}}{\left|\vec{b}\right|^2}\vec{b}\f]
-
73  *
-
74  * \returns NULL if error, otherwise pointer to output
-
75  */
-
76 double *vector_proj(double *a, double *b, double *out, int L)
-
77 {
-
78  const double num = vector_dot(a, b, L);
-
79  const double deno = vector_dot(b, b, L);
-
80  if (deno == 0) /*! check for division by zero */
-
81  return NULL;
-
82 
-
83  const double scalar = num / deno;
-
84  int i;
-
85 #ifdef _OPENMP
-
86 // parallelize on threads
-
87 #pragma omp for
-
88 #endif
-
89  for (i = 0; i < L; i++) out[i] = scalar * b[i];
-
90 
-
91  return out;
-
92 }
-
93 
-
94 /**
-
95  * Compute vector subtraction
-
96  *
-
97  * \f$\vec{c}=\vec{a}-\vec{b}\f$
-
98  *
-
99  * \returns pointer to output vector
-
100  */
-
101 double *vector_sub(double *a, /**< minuend */
-
102  double *b, /**< subtrahend */
-
103  double *out, /**< resultant vector */
-
104  int L /**< length of vectors */
-
105 )
-
106 {
-
107  int i;
-
108 #ifdef _OPENMP
-
109 // parallelize on threads
-
110 #pragma omp for
-
111 #endif
-
112  for (i = 0; i < L; i++) out[i] = a[i] - b[i];
-
113 
-
114  return out;
-
115 }
-
116 
-
117 /**
-
118  * Decompose matrix \f$A\f$ using [Gram-Schmidt
-
119  *process](https://en.wikipedia.org/wiki/QR_decomposition).
-
120  *
-
121  * \f{eqnarray*}{
-
122  * \text{given that}\quad A &=&
-
123  *\left[\mathbf{a}_1,\mathbf{a}_2,\ldots,\mathbf{a}_{N-1},\right]\\
-
124  * \text{where}\quad\mathbf{a}_i &=&
-
125  *\left[a_{0i},a_{1i},a_{2i},\ldots,a_{(M-1)i}\right]^T\quad\ldots\mbox{(column
-
126  *vectors)}\\
-
127  * \text{then}\quad\mathbf{u}_i &=& \mathbf{a}_i
-
128  *-\sum_{j=0}^{i-1}\text{proj}_{\mathbf{u}_j}\mathbf{a}_i\\
-
129  * \mathbf{e}_i &=&\frac{\mathbf{u}_i}{\left|\mathbf{u}_i\right|}\\
-
130  * Q &=& \begin{bmatrix}\mathbf{e}_0 & \mathbf{e}_1 & \mathbf{e}_2 & \dots &
-
131  *\mathbf{e}_{N-1}\end{bmatrix}\\
-
132  * R &=& \begin{bmatrix}\langle\mathbf{e}_0\,,\mathbf{a}_0\rangle &
-
133  *\langle\mathbf{e}_1\,,\mathbf{a}_1\rangle &
-
134  *\langle\mathbf{e}_2\,,\mathbf{a}_2\rangle & \dots \\
-
135  * 0 & \langle\mathbf{e}_1\,,\mathbf{a}_1\rangle &
-
136  *\langle\mathbf{e}_2\,,\mathbf{a}_2\rangle & \dots\\
-
137  * 0 & 0 & \langle\mathbf{e}_2\,,\mathbf{a}_2\rangle & \dots\\
-
138  * \vdots & \vdots & \vdots & \ddots
-
139  * \end{bmatrix}\\
-
140  * \f}
-
141  */
-
142 void qr_decompose(double **A, /**< input matrix to decompose */
-
143  double **Q, /**< output decomposed matrix */
-
144  double **R, /**< output decomposed matrix */
-
145  int M, /**< number of rows of matrix A */
-
146  int N /**< number of columns of matrix A */
-
147 )
-
148 {
-
149  double *col_vector = (double *)malloc(M * sizeof(double));
-
150  double *col_vector2 = (double *)malloc(M * sizeof(double));
-
151  double *tmp_vector = (double *)malloc(M * sizeof(double));
-
152  for (int i = 0; i < N;
-
153  i++) /* for each column => R is a square matrix of NxN */
-
154  {
-
155  int j;
-
156 #ifdef _OPENMP
-
157 // parallelize on threads
-
158 #pragma omp for
-
159 #endif
-
160  for (j = 0; j < i; j++) /* second dimension of column */
-
161  R[i][j] = 0.; /* make R upper triangular */
-
162 
-
163  /* get corresponding Q vector */
-
164 #ifdef _OPENMP
-
165 // parallelize on threads
-
166 #pragma omp for
-
167 #endif
-
168  for (j = 0; j < M; j++)
-
169  {
-
170  tmp_vector[j] = A[j][i]; /* accumulator for uk */
-
171  col_vector[j] = A[j][i];
-
172  }
-
173  for (j = 0; j < i; j++)
-
174  {
-
175  for (int k = 0; k < M; k++) col_vector2[k] = Q[k][j];
-
176  vector_proj(col_vector, col_vector2, col_vector2, M);
-
177  vector_sub(tmp_vector, col_vector2, tmp_vector, M);
-
178  }
-
179  double mag = vector_mag(tmp_vector, M);
-
180 
-
181 #ifdef _OPENMP
-
182 // parallelize on threads
-
183 #pragma omp for
-
184 #endif
-
185  for (j = 0; j < M; j++) Q[j][i] = tmp_vector[j] / mag;
-
186 
-
187  /* compute upper triangular values of R */
-
188  for (int kk = 0; kk < M; kk++) col_vector[kk] = Q[kk][i];
-
189  for (int k = i; k < N; k++)
-
190  {
-
191  for (int kk = 0; kk < M; kk++) col_vector2[kk] = A[kk][k];
-
192  R[i][k] = vector_dot(col_vector, col_vector2, M);
-
193  }
-
194  }
-
195 
-
196  free(col_vector);
-
197  free(col_vector2);
-
198  free(tmp_vector);
-
199 }
-
200 
-
201 #endif // 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 QR_DECOMPOSE_H
+
10#define QR_DECOMPOSE_H
+
11
+
12#include <math.h>
+
13#include <stdio.h>
+
14#include <stdlib.h>
+
15#ifdef _OPENMP
+
16#include <omp.h>
+
17#endif
+
18
+
19/**
+
20 * function to display matrix on stdout
+
21 */
+
22void print_matrix(double **A, /**< matrix to print */
+
23 int M, /**< number of rows of matrix */
+
24 int N) /**< number of columns of matrix */
+
25{
+
26 for (int row = 0; row < M; row++)
+
27 {
+
28 for (int col = 0; col < N; col++) printf("% 9.3g\t", A[row][col]);
+
29 putchar('\n');
+
30 }
+
31 putchar('\n');
+
32}
+
33
+
34/**
+
35 * Compute dot product of two vectors of equal lengths
+
36 *
+
37 * If \f$\vec{a}=\left[a_0,a_1,a_2,...,a_L\right]\f$ and
+
38 * \f$\vec{b}=\left[b_0,b_1,b_1,...,b_L\right]\f$ then
+
39 * \f$\vec{a}\cdot\vec{b}=\displaystyle\sum_{i=0}^L a_i\times b_i\f$
+
40 *
+
41 * \returns \f$\vec{a}\cdot\vec{b}\f$
+
42 */
+
43double vector_dot(double *a, double *b, int L)
+
44{
+
45 double mag = 0.f;
+
46 int i;
+
47#ifdef _OPENMP
+
48// parallelize on threads
+
49#pragma omp parallel for reduction(+ : mag)
+
50#endif
+
51 for (i = 0; i < L; i++) mag += a[i] * b[i];
+
52
+
53 return mag;
+
54}
+
55
+
56/**
+
57 * Compute magnitude of vector.
+
58 *
+
59 * If \f$\vec{a}=\left[a_0,a_1,a_2,...,a_L\right]\f$ then
+
60 * \f$\left|\vec{a}\right|=\sqrt{\displaystyle\sum_{i=0}^L a_i^2}\f$
+
61 *
+
62 * \returns \f$\left|\vec{a}\right|\f$
+
63 */
+
64double vector_mag(double *vector, int L)
+
65{
+
66 double dot = vector_dot(vector, vector, L);
+
67 return sqrt(dot);
+
68}
+
69
+
70/**
+
71 * Compute projection of vector \f$\vec{a}\f$ on \f$\vec{b}\f$ defined as
+
72 * \f[\text{proj}_\vec{b}\vec{a}=\frac{\vec{a}\cdot\vec{b}}{\left|\vec{b}\right|^2}\vec{b}\f]
+
73 *
+
74 * \returns NULL if error, otherwise pointer to output
+
75 */
+
76double *vector_proj(double *a, double *b, double *out, int L)
+
77{
+
78 const double num = vector_dot(a, b, L);
+
79 const double deno = vector_dot(b, b, L);
+
80 if (deno == 0) /*! check for division by zero */
+
81 return NULL;
+
82
+
83 const double scalar = num / deno;
+
84 int i;
+
85#ifdef _OPENMP
+
86// parallelize on threads
+
87#pragma omp for
+
88#endif
+
89 for (i = 0; i < L; i++) out[i] = scalar * b[i];
+
90
+
91 return out;
+
92}
+
93
+
94/**
+
95 * Compute vector subtraction
+
96 *
+
97 * \f$\vec{c}=\vec{a}-\vec{b}\f$
+
98 *
+
99 * \returns pointer to output vector
+
100 */
+
101double *vector_sub(double *a, /**< minuend */
+
102 double *b, /**< subtrahend */
+
103 double *out, /**< resultant vector */
+
104 int L /**< length of vectors */
+
105)
+
106{
+
107 int i;
+
108#ifdef _OPENMP
+
109// parallelize on threads
+
110#pragma omp for
+
111#endif
+
112 for (i = 0; i < L; i++) out[i] = a[i] - b[i];
+
113
+
114 return out;
+
115}
+
116
+
117/**
+
118 * Decompose matrix \f$A\f$ using [Gram-Schmidt
+
119 *process](https://en.wikipedia.org/wiki/QR_decomposition).
+
120 *
+
121 * \f{eqnarray*}{
+
122 * \text{given that}\quad A &=&
+
123 *\left[\mathbf{a}_1,\mathbf{a}_2,\ldots,\mathbf{a}_{N-1},\right]\\
+
124 * \text{where}\quad\mathbf{a}_i &=&
+
125 *\left[a_{0i},a_{1i},a_{2i},\ldots,a_{(M-1)i}\right]^T\quad\ldots\mbox{(column
+
126 *vectors)}\\
+
127 * \text{then}\quad\mathbf{u}_i &=& \mathbf{a}_i
+
128 *-\sum_{j=0}^{i-1}\text{proj}_{\mathbf{u}_j}\mathbf{a}_i\\
+
129 * \mathbf{e}_i &=&\frac{\mathbf{u}_i}{\left|\mathbf{u}_i\right|}\\
+
130 * Q &=& \begin{bmatrix}\mathbf{e}_0 & \mathbf{e}_1 & \mathbf{e}_2 & \dots &
+
131 *\mathbf{e}_{N-1}\end{bmatrix}\\
+
132 * R &=& \begin{bmatrix}\langle\mathbf{e}_0\,,\mathbf{a}_0\rangle &
+
133 *\langle\mathbf{e}_1\,,\mathbf{a}_1\rangle &
+
134 *\langle\mathbf{e}_2\,,\mathbf{a}_2\rangle & \dots \\
+
135 * 0 & \langle\mathbf{e}_1\,,\mathbf{a}_1\rangle &
+
136 *\langle\mathbf{e}_2\,,\mathbf{a}_2\rangle & \dots\\
+
137 * 0 & 0 & \langle\mathbf{e}_2\,,\mathbf{a}_2\rangle & \dots\\
+
138 * \vdots & \vdots & \vdots & \ddots
+
139 * \end{bmatrix}\\
+
140 * \f}
+
141 */
+
142void qr_decompose(double **A, /**< input matrix to decompose */
+
143 double **Q, /**< output decomposed matrix */
+
144 double **R, /**< output decomposed matrix */
+
145 int M, /**< number of rows of matrix A */
+
146 int N /**< number of columns of matrix A */
+
147)
+
148{
+
149 double *col_vector = (double *)malloc(M * sizeof(double));
+
150 double *col_vector2 = (double *)malloc(M * sizeof(double));
+
151 double *tmp_vector = (double *)malloc(M * sizeof(double));
+
152 for (int i = 0; i < N;
+
153 i++) /* for each column => R is a square matrix of NxN */
+
154 {
+
155 int j;
+
156#ifdef _OPENMP
+
157// parallelize on threads
+
158#pragma omp for
+
159#endif
+
160 for (j = 0; j < i; j++) /* second dimension of column */
+
161 R[i][j] = 0.; /* make R upper triangular */
+
162
+
163 /* get corresponding Q vector */
+
164#ifdef _OPENMP
+
165// parallelize on threads
+
166#pragma omp for
+
167#endif
+
168 for (j = 0; j < M; j++)
+
169 {
+
170 tmp_vector[j] = A[j][i]; /* accumulator for uk */
+
171 col_vector[j] = A[j][i];
+
172 }
+
173 for (j = 0; j < i; j++)
+
174 {
+
175 for (int k = 0; k < M; k++) col_vector2[k] = Q[k][j];
+
176 vector_proj(col_vector, col_vector2, col_vector2, M);
+
177 vector_sub(tmp_vector, col_vector2, tmp_vector, M);
+
178 }
+
179 double mag = vector_mag(tmp_vector, M);
+
180
+
181#ifdef _OPENMP
+
182// parallelize on threads
+
183#pragma omp for
+
184#endif
+
185 for (j = 0; j < M; j++) Q[j][i] = tmp_vector[j] / mag;
+
186
+
187 /* compute upper triangular values of R */
+
188 for (int kk = 0; kk < M; kk++) col_vector[kk] = Q[kk][i];
+
189 for (int k = i; k < N; k++)
+
190 {
+
191 for (int kk = 0; kk < M; kk++) col_vector2[kk] = A[kk][k];
+
192 R[i][k] = vector_dot(col_vector, col_vector2, M);
+
193 }
+
194 }
+
195
+
196 free(col_vector);
+
197 free(col_vector2);
+
198 free(tmp_vector);
+
199}
+
200
+
201#endif // QR_DECOMPOSE_H
#define malloc(bytes)
This macro replace the standard malloc function with malloc_dbg.
Definition: malloc_dbg.h:18
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
+
double * vector_proj(double *a, double *b, double *out, int L)
Compute projection of vector on defined as.
Definition: qr_decompose.h:76
double vector_dot(double *a, double *b, int L)
Compute dot product of two vectors of equal lengths.
Definition: qr_decompose.h:43
void qr_decompose(double **A, double **Q, double **R, int M, int N)
Decompose matrix using Gram-Schmidt process.
Definition: qr_decompose.h:142
-
double * vector_sub(double *a, double *b, double *out, int L)
Compute vector subtraction.
Definition: qr_decompose.h:101
-
double * vector_proj(double *a, double *b, double *out, int L)
Compute projection of vector on defined as.
Definition: qr_decompose.h:76
+
double * vector_sub(double *a, double *b, double *out, int L)
Compute vector subtraction.
Definition: qr_decompose.h:101
void print_matrix(double **A, int M, int N)
function to display matrix on stdout
Definition: qr_decompose.h:22
double vector_mag(double *vector, int L)
Compute magnitude of vector.
Definition: qr_decompose.h:64
Definition: list.h:8
@@ -310,7 +309,7 @@ $(document).ready(function(){initNavTree('d4/d68/qr__decompose_8h_source.html',' diff --git a/d4/d69/group__dual__quats.html b/d4/d69/group__dual__quats.html index eda4f095d..280b68255 100644 --- a/d4/d69/group__dual__quats.html +++ b/d4/d69/group__dual__quats.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: 3D Dual-Quaternion operations @@ -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,27 +93,26 @@ $(document).ready(function(){initNavTree('d4/d69/group__dual__quats.html','../.. -
-
3D Dual-Quaternion operations
+
3D Dual-Quaternion operations
Collaboration diagram for 3D Dual-Quaternion operations:
-
+
-

+

Data Structures

struct  dual_quat_
 a dual quaternion type More...
 
- - +

+

Typedefs

-typedef struct dual_quat_ dual_quat
+typedef struct dual_quat_ dual_quat
 a dual quaternion type
 
@@ -123,7 +122,7 @@ typedef struct dual_qu diff --git a/d4/d69/group__dual__quats.map b/d4/d69/group__dual__quats.map index 42db75cd6..a39de48f7 100644 --- a/d4/d69/group__dual__quats.map +++ b/d4/d69/group__dual__quats.map @@ -1,4 +1,4 @@ - + diff --git a/d4/d69/group__dual__quats.svg b/d4/d69/group__dual__quats.svg index 55361af1c..5c9279ed9 100644 --- a/d4/d69/group__dual__quats.svg +++ b/d4/d69/group__dual__quats.svg @@ -1,21 +1,21 @@ - - + 3D Dual-Quaternion operations - + Node1 - + 3D Dual-Quaternion - operations + operations @@ -32,8 +32,8 @@ Node2->Node1 - - + + diff --git a/d4/d73/struct_m_e_m_o_r_y___i_n_f_o_r_m_a_t_i_o_n.html b/d4/d73/struct_m_e_m_o_r_y___i_n_f_o_r_m_a_t_i_o_n.html index 87f6d4ef5..90f0693ee 100644 --- a/d4/d73/struct_m_e_m_o_r_y___i_n_f_o_r_m_a_t_i_o_n.html +++ b/d4/d73/struct_m_e_m_o_r_y___i_n_f_o_r_m_a_t_i_o_n.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: MEMORY_INFORMATION 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() {
@@ -92,8 +92,7 @@ $(document).ready(function(){initNavTree('d4/d73/struct_m_e_m_o_r_y___i_n_f_o_r_
-
-
MEMORY_INFORMATION Struct Reference
+
MEMORY_INFORMATION Struct Reference
@@ -106,41 +105,41 @@ Collaboration diagram for MEMORY_INFORMATION:
[legend]
- - + - + - + - + - + - + - +

+

Data Fields

-void * ptr
+void * ptr
 Pointer returned by malloc / calloc.
 
-const char * fileName
+const char * fileName
 File in which malloc or calloc has been called.
 
-const char * functionName
+const char * functionName
 Function in which malloc or calloc has been called.
 
-size_t bytes
+size_t bytes
 Number of bytes allocated.
 
-int line
+int line
 Line number (in file) corresponding to the malloc / calloc call.
 
-struct MEMORY_INFORMATION * next
+struct MEMORY_INFORMATION * next
 Next element in the list.
 
-struct MEMORY_INFORMATION * previous
+struct MEMORY_INFORMATION * previous
 Previous element in the list.
 

Detailed Description

-

For the malloc, calloc and free functions.

-

For IO operations (printf). For the memcmp function. Header file which contains the prototypes of malloc_dbg, calloc_dbg and fre_dbg.

-

Structure used to save an allocated pointer

+

For the malloc, calloc and free functions.

+

For IO operations (printf). For the memcmp function. Header file which contains the prototypes of malloc_dbg, calloc_dbg and fre_dbg.

+

Structure used to save an allocated pointer


The documentation for this struct was generated from the following file: @@ -150,7 +149,7 @@ struct
diff --git a/d4/d7b/problem__6_2sol_8c.html b/d4/d7b/problem__6_2sol_8c.html index 3a38321be..aad33d287 100644 --- a/d4/d7b/problem__6_2sol_8c.html +++ b/d4/d7b/problem__6_2sol_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_6/sol.c 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,37 +92,67 @@ $(document).ready(function(){initNavTree('d4/d7b/problem__6_2sol_8c.html','../..
-
-
sol.c File Reference
+
sol.c File Reference
-

Problem 6 solution +

Problem 6 solution More...

#include <stdio.h>
Include dependency graph for sol.c:
-
+
- - - + +

+

Functions

-int main (void)
 Main function.
int main (void)
 Main function. More...
 

Detailed Description

-

Problem 6 solution

-
+

Problem 6 solution

+

Function Documentation

+ +

◆ main()

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

Main function.

+
9{
+
10 unsigned s1 = 0, s2 = 0, i;
+
11 for (i = 1; i <= 100; i++)
+
12 {
+
13 s1 += i * i;
+
14 s2 += i;
+
15 }
+
16 unsigned ans = s2 * s2 - s1;
+
17 printf("%u\n", ans);
+
18 return 0;
+
19}
+
+
+
+
diff --git a/d4/d83/problem__401_2sol1_8c.html b/d4/d83/problem__401_2sol1_8c.html index 45f61ac11..d9a10165c 100644 --- a/d4/d83/problem__401_2sol1_8c.html +++ b/d4/d83/problem__401_2sol1_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_401/sol1.c 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/d83/problem__401_2sol1_8c.html','.. -
-
sol1.c File Reference
+
sol1.c File Reference
-

Problem 401 solution - Sum of squares of divisors +

Problem 401 solution - Sum of squares of divisors More...

#include <stdint.h>
#include <stdio.h>
@@ -112,21 +111,21 @@ Include dependency graph for sol1.c:
- - - + - +

+

Macros

+
#define __STDC_FORMAT_MACROS
 
-#define MOD_LIMIT   (uint64_t)1e9
+#define MOD_LIMIT   (uint64_t)1e9
 modulo limit
 
-#define MAX_LENGTH   5000
+#define MAX_LENGTH   5000
 chunk size of array allocation
 
- @@ -137,20 +136,18 @@ Functions - - + + - - + +

+

Functions

char is_in (uint64_t N, uint64_t *D, uint64_t L)
 Check if a number is present in given array. More...
uint64_t sigma2 (uint64_t N)
 compute sum of squares of all integer factors of a number More...
 
-uint64_t sigma (uint64_t N)
 sum of squares of factors of numbers from 1 thru N
uint64_t sigma (uint64_t N)
 sum of squares of factors of numbers from 1 thru N More...
 
-int main (int argc, char **argv)
 Main function.
int main (int argc, char **argv)
 Main function. More...
 

Detailed Description

-

Problem 401 solution - Sum of squares of divisors

-
Author
Krishna Vedala
+

Problem 401 solution - Sum of squares of divisors

+
Author
Krishna Vedala

Function Documentation

- +

◆ get_divisors()

@@ -185,57 +182,57 @@ int 
Returns
number of divisors found
-
48 {
-
49  uint64_t q, r;
-
50  int64_t i, num = 0;
-
51 
-
52  if (N == 1)
-
53  {
-
54  D[0] = 1;
-
55  return 1;
-
56  }
-
57 
-
58  // search till sqrt(N)
-
59  // because after this, the pair of divisors will repeat themselves
-
60  for (i = 1; i * i <= N + 1; i++)
-
61  {
-
62  r = N % i; // get reminder
-
63 
-
64  // reminder = 0 if 'i' is a divisor of 'N'
-
65  if (r == 0)
-
66  {
-
67  q = N / i;
-
68  if (!is_in(i, D, num)) // if divisor was already stored
-
69  {
-
70  D[num] = i;
-
71  num++;
-
72  }
-
73  if (!is_in(q, D, num)) // if divisor was already stored
-
74  {
-
75  D[num] = q;
-
76  num++;
-
77  }
-
78  }
-
79 
-
80  if (num == MAX_LENGTH)
-
81  { // limit of array reached, allocate more space
-
82  D = (uint64_t *)realloc(D, MAX_LENGTH * sizeof(uint64_t) << 1);
-
83  }
-
84  }
-
85  return num;
-
86 }
+
48{
+
49 uint64_t q, r;
+
50 int64_t i, num = 0;
+
51
+
52 if (N == 1)
+
53 {
+
54 D[0] = 1;
+
55 return 1;
+
56 }
+
57
+
58 // search till sqrt(N)
+
59 // because after this, the pair of divisors will repeat themselves
+
60 for (i = 1; i * i <= N + 1; i++)
+
61 {
+
62 r = N % i; // get reminder
+
63
+
64 // reminder = 0 if 'i' is a divisor of 'N'
+
65 if (r == 0)
+
66 {
+
67 q = N / i;
+
68 if (!is_in(i, D, num)) // if divisor was already stored
+
69 {
+
70 D[num] = i;
+
71 num++;
+
72 }
+
73 if (!is_in(q, D, num)) // if divisor was already stored
+
74 {
+
75 D[num] = q;
+
76 num++;
+
77 }
+
78 }
+
79
+
80 if (num == MAX_LENGTH)
+
81 { // limit of array reached, allocate more space
+
82 D = (uint64_t *)realloc(D, MAX_LENGTH * sizeof(uint64_t) << 1);
+
83 }
+
84 }
+
85 return num;
+
86}
char is_in(uint64_t N, uint64_t *D, uint64_t L)
Check if a number is present in given array.
Definition: sol1.c:28
#define MAX_LENGTH
chunk size of array allocation
Definition: sol1.c:18
Here is the call graph for this function:
-
+
- +

◆ is_in()

@@ -279,22 +276,125 @@ Here is the call graph for this function:
Returns
1 if present
0 if absent
-
29 {
-
30  uint64_t i;
-
31  for (i = 0; i < L; i++)
-
32  {
-
33  if (D[i] == N)
-
34  {
-
35  return 1;
-
36  }
-
37  }
-
38  return 0;
-
39 }
+
29{
+
30 uint64_t i;
+
31 for (i = 0; i < L; i++)
+
32 {
+
33 if (D[i] == N)
+
34 {
+
35 return 1;
+
36 }
+
37 }
+
38 return 0;
+
39}
Definition: list.h:8
- + +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char ** argv 
)
+
+ +

Main function.

+
133{
+
134 uint64_t N = 1000;
+
135
+
136 if (argc == 2)
+
137 {
+
138 N = strtoll(argv[1], NULL, 10);
+
139 }
+
140 else if (argc > 2)
+
141 {
+
142 fprintf(stderr, "Wrong number of input arguments!\n");
+
143 printf("Usage:\t ./sol1.c [N=1000]");
+
144 return -1;
+
145 }
+
146
+
147 clock_t start_time = clock();
+
148 uint64_t result = sigma(N);
+
149 double dtime = clock() - start_time;
+
150
+
151 printf("N = %" PRIu64 "\nSum: %" PRIu64 "\n", N, result);
+
152 printf("Time taken: %.4gms\n", dtime * 1e3 / CLOCKS_PER_SEC);
+
153
+
154 return 0;
+
155}
+
uint64_t sigma(uint64_t N)
sum of squares of factors of numbers from 1 thru N
Definition: sol1.c:114
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ sigma()

+ +
+
+ + + + + + + + +
uint64_t sigma (uint64_t N)
+
+ +

sum of squares of factors of numbers from 1 thru N

+
115{
+
116 uint64_t s, sum = 0;
+
117 int64_t i;
+
118
+
119#ifdef _OPENMP
+
120// parallelize on threads
+
121#pragma omp parallel for reduction(+ : sum)
+
122#endif
+
123 for (i = 0; i <= N; i++)
+
124 {
+
125 s = sigma2(i);
+
126 sum += s;
+
127 }
+
128 return sum % MOD_LIMIT;
+
129}
+
uint64_t sigma2(uint64_t N)
compute sum of squares of all integer factors of a number
Definition: sol1.c:93
+
#define MOD_LIMIT
modulo limit
Definition: sol1.c:17
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+

◆ sigma2()

@@ -318,29 +418,28 @@ Here is the call graph for this function:
Returns
sum of squares
-
94 {
-
95  uint64_t sum = 0, L;
-
96  int64_t i;
-
97  uint64_t *D = (uint64_t *)malloc(MAX_LENGTH * sizeof(uint64_t));
-
98 
-
99  L = get_divisors(N, D);
-
100  for (i = 1; i < L; i++)
-
101  {
-
102  uint64_t DD = (D[i] * D[i]) % MOD_LIMIT;
-
103  sum += DD;
-
104  }
-
105 
-
106  free(D);
-
107  return sum % MOD_LIMIT;
-
108 }
+
94{
+
95 uint64_t sum = 0, L;
+
96 int64_t i;
+
97 uint64_t *D = (uint64_t *)malloc(MAX_LENGTH * sizeof(uint64_t));
+
98
+
99 L = get_divisors(N, D);
+
100 for (i = 1; i < L; i++)
+
101 {
+
102 uint64_t DD = (D[i] * D[i]) % MOD_LIMIT;
+
103 sum += DD;
+
104 }
+
105
+
106 free(D);
+
107 return sum % MOD_LIMIT;
+
108}
#define malloc(bytes)
This macro replace the standard malloc function with malloc_dbg.
Definition: malloc_dbg.h:18
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
uint64_t get_divisors(uint64_t N, uint64_t *D)
Get all integer divisors of a number.
Definition: sol1.c:47
-
#define MOD_LIMIT
modulo limit
Definition: sol1.c:17
Here is the call graph for this function:
-
+
@@ -352,7 +451,7 @@ Here is the call graph for this function:
diff --git a/d4/d83/problem__401_2sol1_8c.js b/d4/d83/problem__401_2sol1_8c.js index ff75cdd6c..0fb99f1fd 100644 --- a/d4/d83/problem__401_2sol1_8c.js +++ b/d4/d83/problem__401_2sol1_8c.js @@ -1,6 +1,5 @@ var problem__401_2sol1_8c = [ - [ "__STDC_FORMAT_MACROS", "d4/d83/problem__401_2sol1_8c.html#aacbb9e1f38be71e22df1584a37c56693", null ], [ "MAX_LENGTH", "d4/d83/problem__401_2sol1_8c.html#a7a9a231e30b47bc0345749c8bd1e5077", null ], [ "MOD_LIMIT", "d4/d83/problem__401_2sol1_8c.html#ade1bdf2529e3c58f53bfb4d844f3a9d3", null ], [ "get_divisors", "d4/d83/problem__401_2sol1_8c.html#a7380e14d595d560007b02ce516b6b215", null ], diff --git a/d4/d83/problem__401_2sol1_8c_a236548478af932f1115a71f601a68788_cgraph.map b/d4/d83/problem__401_2sol1_8c_a236548478af932f1115a71f601a68788_cgraph.map index 72a5a4cee..59908ef19 100644 --- a/d4/d83/problem__401_2sol1_8c_a236548478af932f1115a71f601a68788_cgraph.map +++ b/d4/d83/problem__401_2sol1_8c_a236548478af932f1115a71f601a68788_cgraph.map @@ -1,5 +1,5 @@ - - - + + + diff --git a/d4/d83/problem__401_2sol1_8c_a236548478af932f1115a71f601a68788_cgraph.svg b/d4/d83/problem__401_2sol1_8c_a236548478af932f1115a71f601a68788_cgraph.svg index 8a02a510b..99a17fa00 100644 --- a/d4/d83/problem__401_2sol1_8c_a236548478af932f1115a71f601a68788_cgraph.svg +++ b/d4/d83/problem__401_2sol1_8c_a236548478af932f1115a71f601a68788_cgraph.svg @@ -1,20 +1,20 @@ - - + sigma2 - + Node1 - -sigma2 + +sigma2 @@ -22,31 +22,31 @@ Node2 - -get_divisors + +get_divisors Node1->Node2 - - + + Node3 - -is_in + +is_in Node2->Node3 - - + + diff --git a/d4/d83/problem__401_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map b/d4/d83/problem__401_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map new file mode 100644 index 000000000..53450b722 --- /dev/null +++ b/d4/d83/problem__401_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/d4/d83/problem__401_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 b/d4/d83/problem__401_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 new file mode 100644 index 000000000..380edd5ad --- /dev/null +++ b/d4/d83/problem__401_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 @@ -0,0 +1 @@ +9a7847be97397617cd7dadb1bf4c49f1 \ No newline at end of file diff --git a/d4/d83/problem__401_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg b/d4/d83/problem__401_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg new file mode 100644 index 000000000..9ea8cc3bd --- /dev/null +++ b/d4/d83/problem__401_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg @@ -0,0 +1,82 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +sigma + + + + + +Node1->Node2 + + + + + +Node3 + + +sigma2 + + + + + +Node2->Node3 + + + + + +Node4 + + +get_divisors + + + + + +Node3->Node4 + + + + + +Node5 + + +is_in + + + + + +Node4->Node5 + + + + + diff --git a/d4/d83/problem__401_2sol1_8c_a7380e14d595d560007b02ce516b6b215_cgraph.map b/d4/d83/problem__401_2sol1_8c_a7380e14d595d560007b02ce516b6b215_cgraph.map index 86fa13d12..dbe8c1dc8 100644 --- a/d4/d83/problem__401_2sol1_8c_a7380e14d595d560007b02ce516b6b215_cgraph.map +++ b/d4/d83/problem__401_2sol1_8c_a7380e14d595d560007b02ce516b6b215_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/d4/d83/problem__401_2sol1_8c_a7380e14d595d560007b02ce516b6b215_cgraph.svg b/d4/d83/problem__401_2sol1_8c_a7380e14d595d560007b02ce516b6b215_cgraph.svg index a9b892fe7..124d1a0aa 100644 --- a/d4/d83/problem__401_2sol1_8c_a7380e14d595d560007b02ce516b6b215_cgraph.svg +++ b/d4/d83/problem__401_2sol1_8c_a7380e14d595d560007b02ce516b6b215_cgraph.svg @@ -1,20 +1,20 @@ - - + get_divisors - + Node1 - -get_divisors + +get_divisors @@ -22,16 +22,16 @@ Node2 - -is_in + +is_in Node1->Node2 - - + + diff --git a/d4/d83/problem__401_2sol1_8c_aaf964739be92adc2f500e7da11e3f6be_cgraph.map b/d4/d83/problem__401_2sol1_8c_aaf964739be92adc2f500e7da11e3f6be_cgraph.map new file mode 100644 index 000000000..a70c25af8 --- /dev/null +++ b/d4/d83/problem__401_2sol1_8c_aaf964739be92adc2f500e7da11e3f6be_cgraph.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/d4/d83/problem__401_2sol1_8c_aaf964739be92adc2f500e7da11e3f6be_cgraph.md5 b/d4/d83/problem__401_2sol1_8c_aaf964739be92adc2f500e7da11e3f6be_cgraph.md5 new file mode 100644 index 000000000..7c36b43d8 --- /dev/null +++ b/d4/d83/problem__401_2sol1_8c_aaf964739be92adc2f500e7da11e3f6be_cgraph.md5 @@ -0,0 +1 @@ +a32c4a92d9e97c232f45fd0be8cd31c8 \ No newline at end of file diff --git a/d4/d83/problem__401_2sol1_8c_aaf964739be92adc2f500e7da11e3f6be_cgraph.svg b/d4/d83/problem__401_2sol1_8c_aaf964739be92adc2f500e7da11e3f6be_cgraph.svg new file mode 100644 index 000000000..6035a78f6 --- /dev/null +++ b/d4/d83/problem__401_2sol1_8c_aaf964739be92adc2f500e7da11e3f6be_cgraph.svg @@ -0,0 +1,67 @@ + + + + + + +sigma + + + +Node1 + + +sigma + + + + + +Node2 + + +sigma2 + + + + + +Node1->Node2 + + + + + +Node3 + + +get_divisors + + + + + +Node2->Node3 + + + + + +Node4 + + +is_in + + + + + +Node3->Node4 + + + + + diff --git a/d4/d89/problem__23_2sol1_8c__incl.map b/d4/d89/problem__23_2sol1_8c__incl.map index 625bd8134..abd63205e 100644 --- a/d4/d89/problem__23_2sol1_8c__incl.map +++ b/d4/d89/problem__23_2sol1_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/d4/d89/problem__23_2sol1_8c__incl.svg b/d4/d89/problem__23_2sol1_8c__incl.svg index 59ead7c15..c2b36fe27 100644 --- a/d4/d89/problem__23_2sol1_8c__incl.svg +++ b/d4/d89/problem__23_2sol1_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - -project_euler/problem + +project_euler/problem _23/sol1.c diff --git a/d4/d8a/quaternions_8c__incl.map b/d4/d8a/quaternions_8c__incl.map index 86634c284..7c2cc2d68 100644 --- a/d4/d8a/quaternions_8c__incl.map +++ b/d4/d8a/quaternions_8c__incl.map @@ -1,7 +1,7 @@ - + - + diff --git a/d4/d8a/quaternions_8c__incl.svg b/d4/d8a/quaternions_8c__incl.svg index 33c3e8829..9cd4b48e3 100644 --- a/d4/d8a/quaternions_8c__incl.svg +++ b/d4/d8a/quaternions_8c__incl.svg @@ -1,19 +1,19 @@ - - + geometry/quaternions.c - + Node1 - + geometry/quaternions.c @@ -67,16 +67,16 @@ Node5 - -geometry_datatypes.h + +geometry_datatypes.h Node1->Node5 - - + + diff --git a/d4/d99/fibonacci__fast_8c.html b/d4/d99/fibonacci__fast_8c.html index e038e36f5..05cb60ac3 100644 --- a/d4/d99/fibonacci__fast_8c.html +++ b/d4/d99/fibonacci__fast_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: misc/fibonacci_fast.c 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/d99/fibonacci__fast_8c.html','../..
-
-
fibonacci_fast.c File Reference
+
fibonacci_fast.c File Reference
@@ -105,29 +104,28 @@ $(document).ready(function(){initNavTree('d4/d99/fibonacci__fast_8c.html','../..
Include dependency graph for fibonacci_fast.c:
-
+
- - - + +

+

Functions

void fib (unsigned long n, unsigned long *C, unsigned long *D)
 Get the \(n^{th}\) and \(n+1^{th}\) Fibonacci number using recursive half-interval decimation. More...
 
-int main (int argc, char *argv[])
 main function
int main (int argc, char *argv[])
 main function More...
 

Detailed Description

-

Compute \(m^{mth}\) Fibonacci number using the formulae:

-
Author
Krishna Vedala
+

Compute \(m^{mth}\) Fibonacci number using the formulae:

+
Author
Krishna Vedala
Date
2 October, 2019

\begin{eqnarray*} F_{2n-1} &=& F_n^2 + F_{n-1}^2 \\ F_{2n} &=& F_n\left(2F_{n-1} + F_n\right) \end{eqnarray*}

Function Documentation

- +

◆ fib()

@@ -168,45 +166,107 @@ int 
24 {
-
25  // Out of Range checking
-
26  // commented out since `n` is unsigned integer
-
27  // if (n < 0)
-
28  // {
-
29  // printf("\nNo Such term !\n");
-
30  // exit(0);
-
31  // }
-
32 
-
33  unsigned long a, b, c, d;
-
34 
-
35  if (n == 0)
-
36  {
-
37  C[0] = 0;
-
38  if (D) /* if D is not NULL */
-
39  D[0] = 1;
-
40  return;
-
41  }
-
42 
-
43  fib(n >> 1, &c, &d); /* Compute F(n/2) */
-
44 
-
45  a = c * ((d << 1) - c);
-
46  b = c * c + d * d;
-
47  if (n % 2 == 0) /* If n is even */
-
48  {
-
49  C[0] = a;
-
50  if (D)
-
51  D[0] = b;
-
52  return;
-
53  }
-
54 
-
55  /**< If n is odd */
-
56  C[0] = b;
-
57  if (D) /* if D is not NULL */
-
58  D[0] = a + b;
-
59  return;
-
60 }
+
24{
+
25 // Out of Range checking
+
26 // commented out since `n` is unsigned integer
+
27 // if (n < 0)
+
28 // {
+
29 // printf("\nNo Such term !\n");
+
30 // exit(0);
+
31 // }
+
32
+
33 unsigned long a, b, c, d;
+
34
+
35 if (n == 0)
+
36 {
+
37 C[0] = 0;
+
38 if (D) /* if D is not NULL */
+
39 D[0] = 1;
+
40 return;
+
41 }
+
42
+
43 fib(n >> 1, &c, &d); /* Compute F(n/2) */
+
44
+
45 a = c * ((d << 1) - c);
+
46 b = c * c + d * d;
+
47 if (n % 2 == 0) /* If n is even */
+
48 {
+
49 C[0] = a;
+
50 if (D)
+
51 D[0] = b;
+
52 return;
+
53 }
+
54
+
55 /**< If n is odd */
+
56 C[0] = b;
+
57 if (D) /* if D is not NULL */
+
58 D[0] = a + b;
+
59 return;
+
60}
void fib(unsigned long n, unsigned long *C, unsigned long *D)
Get the and Fibonacci number using recursive half-interval decimation.
Definition: fibonacci_fast.c:23
-
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char * argv[] 
)
+
+ +

main function

+
66{
+
67 unsigned long number, result;
+
68
+
69 setlocale(LC_NUMERIC, ""); // format the printf output
+
70
+
71 // Asks for the number/position of term in Fibonnacci sequence
+
72 if (argc == 2)
+
73 number = atoi(argv[1]);
+
74 else
+
75 {
+
76 printf("Enter the value of n(n starts from 0 ): ");
+
77 scanf("%lu", &number);
+
78 }
+
79
+
80 fib(number, &result, NULL);
+
81
+
82 printf("The nth term is : %'lu \n", result);
+
83
+
84 return 0;
+
85}
+
+Here is the call graph for this function:
+
+
+
+
+
@@ -215,7 +275,7 @@ int  diff --git a/d4/d99/fibonacci__fast_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map b/d4/d99/fibonacci__fast_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map new file mode 100644 index 000000000..b8f7b4ce6 --- /dev/null +++ b/d4/d99/fibonacci__fast_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/d4/d99/fibonacci__fast_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 b/d4/d99/fibonacci__fast_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 new file mode 100644 index 000000000..13d77cb7c --- /dev/null +++ b/d4/d99/fibonacci__fast_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 @@ -0,0 +1 @@ +9d601d2d4dc3d68383cc352d5e664b05 \ No newline at end of file diff --git a/d4/d99/fibonacci__fast_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg b/d4/d99/fibonacci__fast_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg new file mode 100644 index 000000000..07168d75f --- /dev/null +++ b/d4/d99/fibonacci__fast_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg @@ -0,0 +1,43 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +fib + + + + + +Node1->Node2 + + + + + +Node2->Node2 + + + + + diff --git a/d4/d99/fibonacci__fast_8c_a7a3d55bd19854075cba2eed6b63cb2d3_cgraph.map b/d4/d99/fibonacci__fast_8c_a7a3d55bd19854075cba2eed6b63cb2d3_cgraph.map new file mode 100644 index 000000000..e11a20c90 --- /dev/null +++ b/d4/d99/fibonacci__fast_8c_a7a3d55bd19854075cba2eed6b63cb2d3_cgraph.map @@ -0,0 +1,3 @@ + + + diff --git a/d4/d99/fibonacci__fast_8c_a7a3d55bd19854075cba2eed6b63cb2d3_cgraph.md5 b/d4/d99/fibonacci__fast_8c_a7a3d55bd19854075cba2eed6b63cb2d3_cgraph.md5 new file mode 100644 index 000000000..7d36ad35a --- /dev/null +++ b/d4/d99/fibonacci__fast_8c_a7a3d55bd19854075cba2eed6b63cb2d3_cgraph.md5 @@ -0,0 +1 @@ +6be9ccff9f7892ab8cb59f1e7db8cb06 \ No newline at end of file diff --git a/d4/d99/fibonacci__fast_8c_a7a3d55bd19854075cba2eed6b63cb2d3_cgraph.svg b/d4/d99/fibonacci__fast_8c_a7a3d55bd19854075cba2eed6b63cb2d3_cgraph.svg new file mode 100644 index 000000000..9793f7e28 --- /dev/null +++ b/d4/d99/fibonacci__fast_8c_a7a3d55bd19854075cba2eed6b63cb2d3_cgraph.svg @@ -0,0 +1,28 @@ + + + + + + +fib + + + +Node1 + + +fib + + + + + +Node1->Node1 + + + + + diff --git a/d4/d99/ode__semi__implicit__euler_8c.html b/d4/d99/ode__semi__implicit__euler_8c.html index bb3d0ed77..a6c7a1ed7 100644 --- a/d4/d99/ode__semi__implicit__euler_8c.html +++ b/d4/d99/ode__semi__implicit__euler_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: numerical_methods/ode_semi_implicit_euler.c 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/d99/ode__semi__implicit__euler_8c.h -
-
ode_semi_implicit_euler.c File Reference
+
ode_semi_implicit_euler.c File Reference
-

Solve a multivariable first order ordinary differential equation (ODEs) using semi implicit Euler method +

Solve a multivariable first order ordinary differential equation (ODEs) using semi implicit Euler method More...

#include <math.h>
#include <stdio.h>
@@ -111,14 +110,14 @@ Include dependency graph for ode_semi_implicit_euler.c:
- - +

+

Macros

-#define order   2
+#define order   2
 number of dependent variables in problem
 
- @@ -132,14 +131,13 @@ Functions - - + +

+

Functions

void problem (const double *x, double *y, double *dy)
 Problem statement for a system with first-order differential equations. More...
double semi_implicit_euler (double dx, double x0, double x_max, double *y, char save_to_file)
 Compute approximation using the semi-implicit-Euler method in the given limits. More...
 
-int main (int argc, char *argv[])
 Main Function.
int main (int argc, char *argv[])
 Main Function. More...
 

Detailed Description

-

Solve a multivariable first order ordinary differential equation (ODEs) using semi implicit Euler method

-
Authors
Krishna Vedala
+

Solve a multivariable first order ordinary differential equation (ODEs) using semi implicit 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*}

@@ -147,13 +145,13 @@ int 

-

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];

Van der Pol Oscillator solution

See also
ode_forward_euler.c, ode_midpoint_euler.c

Function Documentation

- +

◆ exact_solution()

@@ -180,7 +178,7 @@ int 

Exact solution of the problem.

-

Used for solution comparison.

+

Used for solution comparison.

Parameters
@@ -188,14 +186,97 @@ int  @@ -42,21 +41,22 @@
[in]xindependent variable
72 {
-
73  y[0] = cos(x[0]);
-
74  y[1] = -sin(x[0]);
-
75 }
+
72{
+
73 y[0] = cos(x[0]);
+
74 y[1] = -sin(x[0]);
+
75}
- + +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char * argv[] 
)
+
+ +

Main Function.

+
148{
+
149 double X0 = 0.f; /* initial value of x0 */
+
150 double X_MAX = 10.F; /* upper limit of integration */
+
151 double Y0[] = {1.f, 0.f}; /* initial value Y = y(x = x_0) */
+
152 double step_size;
+
153
+
154 if (argc == 1)
+
155 {
+
156 printf("\nEnter the step size: ");
+
157 scanf("%lg", &step_size);
+
158 }
+
159 else
+
160 // use commandline argument as independent variable step size
+
161 step_size = atof(argv[1]);
+
162
+
163 // get approximate solution
+
164 double total_time = semi_implicit_euler(step_size, X0, X_MAX, Y0, 1);
+
165 printf("\tTime = %.6g ms\n", total_time);
+
166
+
167 /* compute exact solution for comparion */
+
168 FILE *fp = fopen("exact.csv", "w+");
+
169 if (fp == NULL)
+
170 {
+
171 perror("Error! ");
+
172 return -1;
+
173 }
+
174 double x = X0;
+
175 double *y = &(Y0[0]);
+
176 printf("Finding exact solution\n");
+
177 clock_t t1 = clock();
+
178
+
179 do
+
180 {
+
181 fprintf(fp, "%.4g,%.4g,%.4g\n", x, y[0], y[1]); // write to file
+
182 exact_solution(&x, y);
+
183 x += step_size;
+
184 } while (x <= X_MAX);
+
185
+
186 clock_t t2 = clock();
+
187 total_time = (t2 - t1) / CLOCKS_PER_SEC;
+
188 printf("\tTime = %.6g ms\n", total_time);
+
189 fclose(fp);
+
190
+
191 return 0;
+
192}
+
void exact_solution(const double *x, double *y)
Exact solution of the problem.
Definition: ode_semi_implicit_euler.c:71
+
double semi_implicit_euler(double dx, double x0, double x_max, double *y, char save_to_file)
Compute approximation using the semi-implicit-Euler method in the given limits.
Definition: ode_semi_implicit_euler.c:109
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+

◆ problem()

@@ -228,7 +309,7 @@ int 

Problem statement for a system with first-order differential equations.

-

Updates the system differential variables.

Note
This function can be updated to and ode of any order.
+

Updates the system differential variables.

Note
This function can be updated to and ode of any order.
Parameters
@@ -237,15 +318,15 @@ int 
[in]xindependent variable(s)
59 {
-
60  const double omega = 1.F; // some const for the problem
-
61  dy[0] = y[1]; // x dot
-
62  dy[1] = -omega * omega * y[0]; // y dot
-
63 }
+
59{
+
60 const double omega = 1.F; // some const for the problem
+
61 dy[0] = y[1]; // x dot
+
62 dy[1] = -omega * omega * y[0]; // y dot
+
63}
- +

◆ semi_implicit_euler()

@@ -301,50 +382,50 @@ int 
Returns
time taken for computation in seconds
-
111 {
-
112  double dy[order];
-
113 
-
114  FILE *fp = NULL;
-
115  if (save_to_file)
-
116  {
-
117  fp = fopen("semi_implicit_euler.csv", "w+");
-
118  if (fp == NULL)
-
119  {
-
120  perror("Error! ");
-
121  return -1;
-
122  }
-
123  }
-
124 
-
125  /* start integration */
-
126  clock_t t1 = clock();
-
127  double x = x0;
-
128  do // iterate for each step of independent variable
-
129  {
-
130  if (save_to_file && fp)
-
131  fprintf(fp, "%.4g,%.4g,%.4g\n", x, y[0], y[1]); // write to file
-
132  semi_implicit_euler_step(dx, &x, y, dy); // perform integration
-
133  x += dx; // update step
-
134  } while (x <= x_max); // till upper limit of independent variable
-
135  /* end of integration */
-
136  clock_t t2 = clock();
-
137 
-
138  if (save_to_file && fp)
-
139  fclose(fp);
-
140 
-
141  return (double)(t2 - t1) / CLOCKS_PER_SEC;
-
142 }
+
111{
+
112 double dy[order];
+
113
+
114 FILE *fp = NULL;
+
115 if (save_to_file)
+
116 {
+
117 fp = fopen("semi_implicit_euler.csv", "w+");
+
118 if (fp == NULL)
+
119 {
+
120 perror("Error! ");
+
121 return -1;
+
122 }
+
123 }
+
124
+
125 /* start integration */
+
126 clock_t t1 = clock();
+
127 double x = x0;
+
128 do // iterate for each step of independent variable
+
129 {
+
130 if (save_to_file && fp)
+
131 fprintf(fp, "%.4g,%.4g,%.4g\n", x, y[0], y[1]); // write to file
+
132 semi_implicit_euler_step(dx, &x, y, dy); // perform integration
+
133 x += dx; // update step
+
134 } while (x <= x_max); // till upper limit of independent variable
+
135 /* end of integration */
+
136 clock_t t2 = clock();
+
137
+
138 if (save_to_file && fp)
+
139 fclose(fp);
+
140
+
141 return (double)(t2 - t1) / CLOCKS_PER_SEC;
+
142}
void semi_implicit_euler_step(double dx, double *x, double *y, double *dy)
Compute next step approximation using the semi-implicit-Euler method.
Definition: ode_semi_implicit_euler.c:85
#define order
number of dependent variables in problem
Definition: ode_semi_implicit_euler.c:47
Here is the call graph for this function:
-
+
- +

◆ semi_implicit_euler_step()

@@ -392,23 +473,23 @@ Here is the call graph for this function:
-
86 {
-
87  int o;
-
88 
-
89  problem(x, y, dy); // update dy once
-
90  y[0] += dx * dy[0]; // update y0
-
91 
-
92  problem(x, y, dy); // update dy once more
-
93 
-
94  for (o = 1; o < order; o++)
-
95  y[o] += dx * dy[o]; // update remaining using new dy
-
96  *x += dx;
-
97 }
+
86{
+
87 int o;
+
88
+
89 problem(x, y, dy); // update dy once
+
90 y[0] += dx * dy[0]; // update y0
+
91
+
92 problem(x, y, dy); // update dy once more
+
93
+
94 for (o = 1; o < order; o++)
+
95 y[o] += dx * dy[o]; // update remaining using new dy
+
96 *x += dx;
+
97}
void problem(const double *x, double *y, double *dy)
Problem statement for a system with first-order differential equations.
Definition: ode_semi_implicit_euler.c:58
Here is the call graph for this function:
-
+
@@ -420,7 +501,7 @@ Here is the call graph for this function:
diff --git a/d4/d99/ode__semi__implicit__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map b/d4/d99/ode__semi__implicit__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map new file mode 100644 index 000000000..20e696cc5 --- /dev/null +++ b/d4/d99/ode__semi__implicit__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/d4/d99/ode__semi__implicit__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 b/d4/d99/ode__semi__implicit__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 new file mode 100644 index 000000000..9c03f428d --- /dev/null +++ b/d4/d99/ode__semi__implicit__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 @@ -0,0 +1 @@ +0a493ae66f7c430a731921b572976297 \ No newline at end of file diff --git a/d4/d99/ode__semi__implicit__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg b/d4/d99/ode__semi__implicit__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg new file mode 100644 index 000000000..328c5a5e4 --- /dev/null +++ b/d4/d99/ode__semi__implicit__euler_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg @@ -0,0 +1,82 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +exact_solution + + + + + +Node1->Node2 + + + + + +Node3 + + +semi_implicit_euler + + + + + +Node1->Node3 + + + + + +Node4 + + +semi_implicit_euler_step + + + + + +Node3->Node4 + + + + + +Node5 + + +problem + + + + + +Node4->Node5 + + + + + diff --git a/d4/d99/ode__semi__implicit__euler_8c_a720b7e995d2bbc615f94a2c7dbcf84eb_cgraph.map b/d4/d99/ode__semi__implicit__euler_8c_a720b7e995d2bbc615f94a2c7dbcf84eb_cgraph.map index 0fe471280..a92ee1480 100644 --- a/d4/d99/ode__semi__implicit__euler_8c_a720b7e995d2bbc615f94a2c7dbcf84eb_cgraph.map +++ b/d4/d99/ode__semi__implicit__euler_8c_a720b7e995d2bbc615f94a2c7dbcf84eb_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/d4/d99/ode__semi__implicit__euler_8c_a720b7e995d2bbc615f94a2c7dbcf84eb_cgraph.svg b/d4/d99/ode__semi__implicit__euler_8c_a720b7e995d2bbc615f94a2c7dbcf84eb_cgraph.svg index c6557b7f8..122a541b0 100644 --- a/d4/d99/ode__semi__implicit__euler_8c_a720b7e995d2bbc615f94a2c7dbcf84eb_cgraph.svg +++ b/d4/d99/ode__semi__implicit__euler_8c_a720b7e995d2bbc615f94a2c7dbcf84eb_cgraph.svg @@ -1,20 +1,20 @@ - - + semi_implicit_euler_step - + Node1 - -semi_implicit_euler_step + +semi_implicit_euler_step @@ -22,16 +22,16 @@ Node2 - -problem + +problem Node1->Node2 - - + + diff --git a/d4/d99/ode__semi__implicit__euler_8c_ad80059877222f885b549f2d0a3dc6b55_cgraph.map b/d4/d99/ode__semi__implicit__euler_8c_ad80059877222f885b549f2d0a3dc6b55_cgraph.map index b14edff7e..3ebb8858b 100644 --- a/d4/d99/ode__semi__implicit__euler_8c_ad80059877222f885b549f2d0a3dc6b55_cgraph.map +++ b/d4/d99/ode__semi__implicit__euler_8c_ad80059877222f885b549f2d0a3dc6b55_cgraph.map @@ -1,5 +1,5 @@ - - - + + + diff --git a/d4/d99/ode__semi__implicit__euler_8c_ad80059877222f885b549f2d0a3dc6b55_cgraph.svg b/d4/d99/ode__semi__implicit__euler_8c_ad80059877222f885b549f2d0a3dc6b55_cgraph.svg index a95b0ce47..c5f28ff97 100644 --- a/d4/d99/ode__semi__implicit__euler_8c_ad80059877222f885b549f2d0a3dc6b55_cgraph.svg +++ b/d4/d99/ode__semi__implicit__euler_8c_ad80059877222f885b549f2d0a3dc6b55_cgraph.svg @@ -1,20 +1,20 @@ - - + semi_implicit_euler - + Node1 - -semi_implicit_euler + +semi_implicit_euler @@ -22,31 +22,31 @@ Node2 - -semi_implicit_euler_step + +semi_implicit_euler_step Node1->Node2 - - + + Node3 - -problem + +problem Node2->Node3 - - + + diff --git a/d4/dbd/problem__23_2sol2_8c.html b/d4/dbd/problem__23_2sol2_8c.html index 8fff1de86..e19c46283 100644 --- a/d4/dbd/problem__23_2sol2_8c.html +++ b/d4/dbd/problem__23_2sol2_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_23/sol2.c 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('d4/dbd/problem__23_2sol2_8c.html','../ -
-
sol2.c File Reference
+
sol2.c File Reference
-

Problem 23 solution - optimization using look-up array +

Problem 23 solution - optimization using look-up array More...

#include <stdio.h>
#include <stdlib.h>
@@ -110,38 +109,71 @@ Include dependency graph for sol2.c:
- - - + + - - + + - - + +

+

Functions

char get_perfect_number (unsigned long N)
 
-char is_abundant (unsigned long N)
 Is the given number an abundant number (1) or not (0)
char is_abundant (unsigned long N)
 Is the given number an abundant number (1) or not (0) More...
 
-unsigned long get_next_abundant (unsigned long N)
 Find the next abundant number after N and not including N.
unsigned long get_next_abundant (unsigned long N)
 Find the next abundant number after N and not including N. More...
 
char is_sum_of_abundant (unsigned long N)
 check if a given number can be represented as a sum of two abundant numbers. More...
 
-int main (int argc, char **argv)
 Main function.
int main (int argc, char **argv)
 Main function. More...
 
-

+

Variables

char * abundant_flags = NULL
 This is the global array to be used to store a flag to identify if a particular number is abundant (1) or not (0). More...
 

Detailed Description

-

Problem 23 solution - optimization using look-up array

-
Author
Krishna Vedala
+

Problem 23 solution - optimization using look-up array

+
Author
Krishna Vedala

Optimization applied - compute & store abundant numbers once into a look-up array.

Function Documentation

- + +

◆ get_next_abundant()

+ +
+
+ + + + + + + + +
unsigned long get_next_abundant (unsigned long N)
+
+ +

Find the next abundant number after N and not including N.

+
71{
+
72 unsigned long i;
+
73 /* keep checking successive numbers till an abundant number is found */
+
74 for (i = N + 1; !is_abundant(i); ++i)
+
75 {
+
76 ;
+
77 }
+
78 return i;
+
79}
+
char is_abundant(unsigned long N)
Is the given number an abundant number (1) or not (0)
Definition: sol2.c:59
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+

◆ get_perfect_number()

@@ -161,33 +193,60 @@ Variables 1 if N is abundant
0 if N is perfect
-
32 {
-
33  unsigned long sum = 1;
-
34  char ret = 0;
-
35 
-
36  for (unsigned long i = 2; i * i <= N; i++)
-
37  {
-
38  if (N % i == 0)
-
39  {
-
40  sum += i;
-
41  unsigned long tmp = N / i;
-
42  if (tmp != i)
-
43  {
-
44  sum += tmp;
-
45  }
-
46  }
-
47  }
-
48 
-
49  ret = sum == N ? 0 : (sum > N ? 1 : -1);
-
50 #ifdef DEBUG
-
51  printf("%5lu: %5lu : %d\n", N, sum, ret);
-
52 #endif
-
53  return ret;
-
54 }
+
32{
+
33 unsigned long sum = 1;
+
34 char ret = 0;
+
35
+
36 for (unsigned long i = 2; i * i <= N; i++)
+
37 {
+
38 if (N % i == 0)
+
39 {
+
40 sum += i;
+
41 unsigned long tmp = N / i;
+
42 if (tmp != i)
+
43 {
+
44 sum += tmp;
+
45 }
+
46 }
+
47 }
+
48
+
49 ret = sum == N ? 0 : (sum > N ? 1 : -1);
+
50#ifdef DEBUG
+
51 printf("%5lu: %5lu : %d\n", N, sum, ret);
+
52#endif
+
53 return ret;
+
54}
- + +

◆ is_abundant()

+ +
+
+ + + + + + + + +
char is_abundant (unsigned long N)
+
+ +

Is the given number an abundant number (1) or not (0)

+
60{
+
61 // return abundant_flags[N >> 3] & (1 << N % 8) ? 1 : 0;
+
62 return abundant_flags[N >> 3] & (1 << (N & 7))
+
63 ? 1
+
64 : 0; /* optimized modulo operation */
+
65}
+
char * abundant_flags
This is the global array to be used to store a flag to identify if a particular number is abundant (1...
Definition: sol2.c:24
+
+
+
+

◆ is_sum_of_abundant()

@@ -207,37 +266,173 @@ Variables
Returns
1 - if yes
0 - if not
-
88 {
-
89  /* optimized logic:
-
90  * i + j = N where both i and j should be abundant
-
91  * hence we can simply check for j = N - i as we loop through i
-
92  */
-
93  for (unsigned long i = get_next_abundant(1); i <= (N >> 1);
-
94  i = get_next_abundant(i))
-
95  {
-
96  if (is_abundant(N - i))
-
97  {
-
98 #ifdef DEBUG
-
99  printf("\t%4lu + %4lu = %4lu\n", i, N - i, N);
-
100 #endif
-
101  return 1;
-
102  }
-
103  }
-
104  return 0;
-
105 }
-
char is_abundant(unsigned long N)
Is the given number an abundant number (1) or not (0)
Definition: sol2.c:59
+
88{
+
89 /* optimized logic:
+
90 * i + j = N where both i and j should be abundant
+
91 * hence we can simply check for j = N - i as we loop through i
+
92 */
+
93 for (unsigned long i = get_next_abundant(1); i <= (N >> 1);
+
94 i = get_next_abundant(i))
+
95 {
+
96 if (is_abundant(N - i))
+
97 {
+
98#ifdef DEBUG
+
99 printf("\t%4lu + %4lu = %4lu\n", i, N - i, N);
+
100#endif
+
101 return 1;
+
102 }
+
103 }
+
104 return 0;
+
105}
unsigned long get_next_abundant(unsigned long N)
Find the next abundant number after N and not including N.
Definition: sol2.c:70
Here is the call graph for this function:
-
+
+
+
+ +
+
+ +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char ** argv 
)
+
+ +

Main function.

+
109{
+
110 long MAX_N = 28123; /* Limit of numbers to check */
+
111
+
112 unsigned long sum = 0;
+
113 if (argc == 2)
+
114 {
+
115 MAX_N = strtoul(argv[1], NULL, 10);
+
116 }
+
117
+
118 /* byte array to store flags to identify abundant numbers
+
119 * the flags are identified by bits
+
120 */
+
121 abundant_flags = (char *)calloc(MAX_N >> 3, 1);
+
122 if (!abundant_flags)
+
123 {
+
124 perror("Unable to allocate memoey!");
+
125 return -1;
+
126 }
+
127
+
128#ifdef _OPENMP
+
129 printf("Using OpenMP parallleization with %d threads\n",
+
130 omp_get_max_threads());
+
131#else
+
132 printf("Not using parallleization!\n");
+
133#endif
+
134
+
135 clock_t start_time = clock();
+
136
+
137 /* Loop to set abundant flags */
+
138 long N;
+
139#ifdef _OPENMP
+
140#pragma omp for schedule(runtime)
+
141#endif
+
142 for (N = 1; N <= MAX_N; N++)
+
143 {
+
144 char ret = get_perfect_number(N);
+
145 if (ret == 1)
+
146 {
+
147 // int byte_offset = N % 8, index = N >> 3;
+
148 int byte_offset = N & 7, index = N >> 3;
+
149#ifdef _OPENMP
+
150#pragma omp critical
+
151#endif
+
152 abundant_flags[index] |= ret << byte_offset;
+
153 }
+
154 // if (i % 100 == 0)
+
155 // printf("... %5lu: %8lu\r", i, sum);
+
156 }
+
157
+
158 clock_t end_time = clock();
+
159 double t1 = 1e3 * (end_time - start_time) / CLOCKS_PER_SEC;
+
160 printf("Time taken to get abundant numbers: %.4g ms\n", t1);
+
161
+
162 clock_t t2 = 0;
+
163 long i;
+
164#ifdef _OPENMP
+
165#pragma omp parallel for schedule(runtime) reduction(+ : sum)
+
166#endif
+
167 for (i = 1; i < MAX_N; i++)
+
168 {
+
169 clock_t start_time1 = clock();
+
170 if (!is_sum_of_abundant(i))
+
171 {
+
172 // #ifdef _OPENMP
+
173 // #pragma omp critical
+
174 // #endif
+
175 sum += i;
+
176 }
+
177 clock_t end_time1 = clock();
+
178#ifdef _OPENMP
+
179#pragma omp critical
+
180#endif
+
181 t2 += end_time1 - start_time1;
+
182
+
183 printf("... %5lu: %8lu\r", i, sum);
+
184 if (i % 100 == 0)
+
185 {
+
186 fflush(stdout);
+
187 }
+
188 }
+
189
+
190#ifdef DEBUG
+
191 putchar('\n');
+
192#endif
+
193 double t22 = 1e3 * t2 / CLOCKS_PER_SEC;
+
194 printf("Time taken for final sum: %.4g ms\nTotal Time taken: %.4g ms\n",
+
195 t22, t1 + t22);
+
196 printf("Memory used: %lu bytes\n", MAX_N >> 3);
+
197 printf(
+
198 "Sum of numbers that cannot be represented as sum of two abundant "
+
199 "numbers : %lu\n",
+
200 sum);
+
201
+ +
203
+
204 return 0;
+
205}
+
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
+
#define calloc(elemCount, elemSize)
This macro replace the standard calloc function with calloc_dbg.
Definition: malloc_dbg.h:22
+
char get_perfect_number(unsigned long N)
Definition: sol2.c:31
+
char is_sum_of_abundant(unsigned long N)
check if a given number can be represented as a sum of two abundant numbers.
Definition: sol2.c:87
+
+Here is the call graph for this function:
+
+

Variable Documentation

- +

◆ abundant_flags

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

This is the global array to be used to store a flag to identify if a particular number is abundant (1) or not (0).

-

Using a whole byte to store a binary info would be redundant. We will use each byte to represent 8 numbers by relying on bits. This saves memory required by 1/8

+

Using a whole byte to store a binary info would be redundant. We will use each byte to represent 8 numbers by relying on bits. This saves memory required by 1/8

@@ -260,7 +455,7 @@ Here is the call graph for this function: diff --git a/d4/dbd/problem__23_2sol2_8c_a3ab61b5a1c4f2288625d160aa0ea8478_cgraph.map b/d4/dbd/problem__23_2sol2_8c_a3ab61b5a1c4f2288625d160aa0ea8478_cgraph.map index 0d4f6c320..53eb58f9c 100644 --- a/d4/dbd/problem__23_2sol2_8c_a3ab61b5a1c4f2288625d160aa0ea8478_cgraph.map +++ b/d4/dbd/problem__23_2sol2_8c_a3ab61b5a1c4f2288625d160aa0ea8478_cgraph.map @@ -1,5 +1,5 @@ - - - + + + diff --git a/d4/dbd/problem__23_2sol2_8c_a3ab61b5a1c4f2288625d160aa0ea8478_cgraph.svg b/d4/dbd/problem__23_2sol2_8c_a3ab61b5a1c4f2288625d160aa0ea8478_cgraph.svg index 4a4686f5b..4e52de718 100644 --- a/d4/dbd/problem__23_2sol2_8c_a3ab61b5a1c4f2288625d160aa0ea8478_cgraph.svg +++ b/d4/dbd/problem__23_2sol2_8c_a3ab61b5a1c4f2288625d160aa0ea8478_cgraph.svg @@ -1,20 +1,20 @@ - - + is_sum_of_abundant - + Node1 - -is_sum_of_abundant + +is_sum_of_abundant @@ -22,37 +22,37 @@ Node2 - -get_next_abundant + +get_next_abundant Node1->Node2 - - + + Node3 - -is_abundant + +is_abundant Node1->Node3 - - + + Node2->Node3 - - + + diff --git a/d4/dbd/problem__23_2sol2_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map b/d4/dbd/problem__23_2sol2_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map new file mode 100644 index 000000000..11a681839 --- /dev/null +++ b/d4/dbd/problem__23_2sol2_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/d4/dbd/problem__23_2sol2_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 b/d4/dbd/problem__23_2sol2_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 new file mode 100644 index 000000000..200d49fe8 --- /dev/null +++ b/d4/dbd/problem__23_2sol2_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 @@ -0,0 +1 @@ +384cdfb35795a392831312424bd45c3b \ No newline at end of file diff --git a/d4/dbd/problem__23_2sol2_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg b/d4/dbd/problem__23_2sol2_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg new file mode 100644 index 000000000..ac3c58b8e --- /dev/null +++ b/d4/dbd/problem__23_2sol2_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg @@ -0,0 +1,88 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +get_perfect_number + + + + + +Node1->Node2 + + + + + +Node3 + + +is_sum_of_abundant + + + + + +Node1->Node3 + + + + + +Node4 + + +get_next_abundant + + + + + +Node3->Node4 + + + + + +Node5 + + +is_abundant + + + + + +Node3->Node5 + + + + + +Node4->Node5 + + + + + diff --git a/d4/dbd/problem__23_2sol2_8c_ac5d600bf3077f4188afc4c5cd2c40eaf_cgraph.map b/d4/dbd/problem__23_2sol2_8c_ac5d600bf3077f4188afc4c5cd2c40eaf_cgraph.map new file mode 100644 index 000000000..a974dc829 --- /dev/null +++ b/d4/dbd/problem__23_2sol2_8c_ac5d600bf3077f4188afc4c5cd2c40eaf_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/d4/dbd/problem__23_2sol2_8c_ac5d600bf3077f4188afc4c5cd2c40eaf_cgraph.md5 b/d4/dbd/problem__23_2sol2_8c_ac5d600bf3077f4188afc4c5cd2c40eaf_cgraph.md5 new file mode 100644 index 000000000..9dca6b2da --- /dev/null +++ b/d4/dbd/problem__23_2sol2_8c_ac5d600bf3077f4188afc4c5cd2c40eaf_cgraph.md5 @@ -0,0 +1 @@ +664f9ba3ab505e331beafd4021bdc652 \ No newline at end of file diff --git a/d4/dbd/problem__23_2sol2_8c_ac5d600bf3077f4188afc4c5cd2c40eaf_cgraph.svg b/d4/dbd/problem__23_2sol2_8c_ac5d600bf3077f4188afc4c5cd2c40eaf_cgraph.svg new file mode 100644 index 000000000..7ef4324c5 --- /dev/null +++ b/d4/dbd/problem__23_2sol2_8c_ac5d600bf3077f4188afc4c5cd2c40eaf_cgraph.svg @@ -0,0 +1,37 @@ + + + + + + +get_next_abundant + + + +Node1 + + +get_next_abundant + + + + + +Node2 + + +is_abundant + + + + + +Node1->Node2 + + + + + diff --git a/d4/dcb/md_hash__r_e_a_d_m_e.html b/d4/dcb/md_hash__r_e_a_d_m_e.html index 344e93b88..84955d697 100644 --- a/d4/dcb/md_hash__r_e_a_d_m_e.html +++ b/d4/dcb/md_hash__r_e_a_d_m_e.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Hash algorithms @@ -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,9 +89,8 @@ $(document).ready(function(){initNavTree('d4/dcb/md_hash__r_e_a_d_m_e.html','../ -
-
-
Hash algorithms
+
+
Hash algorithms
    @@ -107,7 +106,7 @@ $(document).ready(function(){initNavTree('d4/dcb/md_hash__r_e_a_d_m_e.html','../ diff --git a/d4/dcc/strong__number_8c.html b/d4/dcc/strong__number_8c.html index f1868cec6..9b78b64e5 100644 --- a/d4/dcc/strong__number_8c.html +++ b/d4/dcc/strong__number_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: misc/strong_number.c 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/dcc/strong__number_8c.html','../../
-
-
strong_number.c File Reference
+
strong_number.c File Reference
@@ -105,11 +104,11 @@ $(document).ready(function(){initNavTree('d4/dcc/strong__number_8c.html','../../
Include dependency graph for strong_number.c:
-
+
- @@ -122,9 +121,9 @@ Functions

+

Functions

bool isStrong (int number)
 Check if given number is strong number or not. More...
 

Detailed Description

-

Strong number is a number whose sum of all digits’ factorial is equal to the number n For example: 145 = 1!(1) + 4!(24) + 5!(120)

+

Strong number is a number whose sum of all digits’ factorial is equal to the number n For example: 145 = 1!(1) + 4!(24) + 5!(120)

Function Documentation

- +

◆ isStrong()

@@ -148,32 +147,32 @@ Functions
Returns
true if given number is strong number, otherwise false
-
16 {
-
17  if (number < 0)
-
18  {
-
19  return false;
-
20  }
-
21  int sum = 0;
-
22  int originalNumber = number;
-
23  while (originalNumber != 0)
-
24  {
-
25  int remainder = originalNumber % 10;
-
26  int factorial = remainder == 0 ? 0 : 1; /* 0! == 1 */
-
27 
-
28  /* calculate factorial of n */
-
29  for (int i = 1; i <= remainder; factorial *= i, i++)
-
30  {
-
31  ;
-
32  }
-
33  sum += factorial;
-
34  originalNumber /= 10;
-
35  }
-
36  return number == sum;
-
37 }
+
16{
+
17 if (number < 0)
+
18 {
+
19 return false;
+
20 }
+
21 int sum = 0;
+
22 int originalNumber = number;
+
23 while (originalNumber != 0)
+
24 {
+
25 int remainder = originalNumber % 10;
+
26 int factorial = remainder == 0 ? 0 : 1; /* 0! == 1 */
+
27
+
28 /* calculate factorial of n */
+
29 for (int i = 1; i <= remainder; factorial *= i, i++)
+
30 {
+
31 ;
+
32 }
+
33 sum += factorial;
+
34 originalNumber /= 10;
+
35 }
+
36 return number == sum;
+
37}
- +

◆ main()

@@ -191,10 +190,10 @@ Functions

Driver Code.

Returns
None
-
54 {
-
55  test();
-
56  return 0;
-
57 }
+
54{
+
55 test();
+
56 return 0;
+
57}
void test()
Test function.
Definition: strong_number.c:43
Here is the call graph for this function:
@@ -205,7 +204,7 @@ Here is the call graph for this function:
- +

◆ test()

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

Test function.

Returns
void
-
44 {
-
45  assert(isStrong(145)); /* 145 = 1! + 4! + 5! */
-
46  assert(!isStrong(543)); /* 543 != 5!+ 4! + 3! */
-
47 }
+
44{
+
45 assert(isStrong(145)); /* 145 = 1! + 4! + 5! */
+
46 assert(!isStrong(543)); /* 543 != 5!+ 4! + 3! */
+
47}
bool isStrong(int number)
Check if given number is strong number or not.
Definition: strong_number.c:15
Here is the call graph for this function:
@@ -243,7 +242,7 @@ Here is the call graph for this function:
diff --git a/d4/dcc/strong__number_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg b/d4/dcc/strong__number_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg index 5e9fc358b..469660f47 100644 --- a/d4/dcc/strong__number_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg +++ b/d4/dcc/strong__number_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg @@ -1,7 +1,7 @@ - - + + + + + + + + + + + + diff --git a/d4/dce/tcp__full__duplex__client_8c__incl.md5 b/d4/dce/tcp__full__duplex__client_8c__incl.md5 new file mode 100644 index 000000000..e5f6e4d06 --- /dev/null +++ b/d4/dce/tcp__full__duplex__client_8c__incl.md5 @@ -0,0 +1 @@ +38c8534d6c4971b7ea523bfa45efa81f \ No newline at end of file diff --git a/d4/dce/tcp__full__duplex__client_8c__incl.svg b/d4/dce/tcp__full__duplex__client_8c__incl.svg new file mode 100644 index 000000000..2148ec37e --- /dev/null +++ b/d4/dce/tcp__full__duplex__client_8c__incl.svg @@ -0,0 +1,261 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +client_server/tcp_full_duplex_client.c + + + +Node1 + + +client_server/tcp_full +_duplex_client.c + + + + + +Node2 + + +arpa/inet.h + + + + + +Node1->Node2 + + + + + +Node3 + + +netdb.h + + + + + +Node1->Node3 + + + + + +Node4 + + +netinet/in.h + + + + + +Node1->Node4 + + + + + +Node5 + + +stdint.h + + + + + +Node1->Node5 + + + + + +Node6 + + +stdio.h + + + + + +Node1->Node6 + + + + + +Node7 + + +stdlib.h + + + + + +Node1->Node7 + + + + + +Node8 + + +string.h + + + + + +Node1->Node8 + + + + + +Node9 + + +sys/socket.h + + + + + +Node1->Node9 + + + + + +Node10 + + +sys/types.h + + + + + +Node1->Node10 + + + + + +Node11 + + +unistd.h + + + + + +Node1->Node11 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/d4/dce/tcp__full__duplex__client_8c__incl_org.svg b/d4/dce/tcp__full__duplex__client_8c__incl_org.svg new file mode 100644 index 000000000..86fc5a4ca --- /dev/null +++ b/d4/dce/tcp__full__duplex__client_8c__incl_org.svg @@ -0,0 +1,173 @@ + + + + + + +client_server/tcp_full_duplex_client.c + + + +Node1 + + +client_server/tcp_full +_duplex_client.c + + + + + +Node2 + + +arpa/inet.h + + + + + +Node1->Node2 + + + + + +Node3 + + +netdb.h + + + + + +Node1->Node3 + + + + + +Node4 + + +netinet/in.h + + + + + +Node1->Node4 + + + + + +Node5 + + +stdint.h + + + + + +Node1->Node5 + + + + + +Node6 + + +stdio.h + + + + + +Node1->Node6 + + + + + +Node7 + + +stdlib.h + + + + + +Node1->Node7 + + + + + +Node8 + + +string.h + + + + + +Node1->Node8 + + + + + +Node9 + + +sys/socket.h + + + + + +Node1->Node9 + + + + + +Node10 + + +sys/types.h + + + + + +Node1->Node10 + + + + + +Node11 + + +unistd.h + + + + + +Node1->Node11 + + + + + diff --git a/d4/dd4/struct_graph.html b/d4/dd4/struct_graph.html index 616f5e45e..102638515 100644 --- a/d4/dd4/struct_graph.html +++ b/d4/dd4/struct_graph.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Graph 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() {
@@ -92,47 +92,46 @@ $(document).ready(function(){initNavTree('d4/dd4/struct_graph.html','../../'); i
-
-
Graph Struct Reference
+
Graph Struct Reference
Collaboration diagram for Graph:
-
+
[legend]
- - - - - - - - - - -

+

Data Fields

+
int vertexNum
 
+
int edgeNum
 
+
struct Edge * edges
 
+
int numVertices
 
+
struct node ** adjLists
 
+
int * visited
 
+
int ** edges
 
+
int V
 
+
int E
 
+
struct Edge * edge
 
@@ -152,7 +151,7 @@ struct Edge * < diff --git a/d4/dd4/struct_graph.js b/d4/dd4/struct_graph.js deleted file mode 100644 index e14e16701..000000000 --- a/d4/dd4/struct_graph.js +++ /dev/null @@ -1,13 +0,0 @@ -var struct_graph = -[ - [ "adjLists", "d4/dd4/struct_graph.html#aaaffb7e0621115519a09be31a33c6cda", null ], - [ "E", "d4/dd4/struct_graph.html#a3ce250f958f7e96ffd9eb06780c21fbe", null ], - [ "edge", "d4/dd4/struct_graph.html#a14b3734eb135c40cf4401f22bda5bb76", null ], - [ "edgeNum", "d4/dd4/struct_graph.html#a10ff9c6c323cf435f18e424dbb62235e", null ], - [ "edges", "d4/dd4/struct_graph.html#a3535be2ce0d62152e54395951330da81", null ], - [ "edges", "d4/dd4/struct_graph.html#a268ba18d421817ad8713c2e92f19d82a", null ], - [ "numVertices", "d4/dd4/struct_graph.html#a72bb0a04571b49a568e0eed371a35c33", null ], - [ "V", "d4/dd4/struct_graph.html#a2b722f7cfa7a21e4cb5fae488b3d4dcc", null ], - [ "vertexNum", "d4/dd4/struct_graph.html#a6afcd41564ea00294a4c089414979ca1", null ], - [ "visited", "d4/dd4/struct_graph.html#aa3f9278e0b50fbec06b93cda9c733dfe", null ] -]; \ No newline at end of file diff --git a/d4/ddb/jump__search_8c__incl.map b/d4/ddb/jump__search_8c__incl.map index 86995e53e..ee58766e3 100644 --- a/d4/ddb/jump__search_8c__incl.map +++ b/d4/ddb/jump__search_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/d4/ddb/jump__search_8c__incl.svg b/d4/ddb/jump__search_8c__incl.svg index 6485423ec..30c807840 100644 --- a/d4/ddb/jump__search_8c__incl.svg +++ b/d4/ddb/jump__search_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - + searching/jump_search.c diff --git a/d4/de3/hash__djb2_8c.html b/d4/de3/hash__djb2_8c.html index 24d64d512..4d2109010 100644 --- a/d4/de3/hash__djb2_8c.html +++ b/d4/de3/hash__djb2_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: hash/hash_djb2.c 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/de3/hash__djb2_8c.html','../../');
-
-
hash_djb2.c File Reference
+
hash_djb2.c File Reference
-

DJB2 hash algorithm +

DJB2 hash algorithm More...

#include <assert.h>
#include <inttypes.h>
@@ -109,7 +108,7 @@ Include dependency graph for hash_djb2.c:
- @@ -117,21 +116,52 @@ Functions - - + +

+

Functions

uint64_t djb2 (const char *s)
 DJB2 algorithm implementation. More...
void test_djb2 (void)
 Test function for djb2. More...
 
-int main ()
 Main function.
int main ()
 Main function. More...
 

Detailed Description

- +

Function Documentation

+ +

◆ main()

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

Main function.

+
47{
+
48 test_djb2();
+
49 return 0;
+
50}
+
void test_djb2(void)
Test function for djb2.
Definition: hash_djb2.c:34
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ diff --git a/d4/de3/hash__djb2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d4/de3/hash__djb2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..5bd545f3a --- /dev/null +++ b/d4/de3/hash__djb2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/d4/de3/hash__djb2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d4/de3/hash__djb2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..87baebc83 --- /dev/null +++ b/d4/de3/hash__djb2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +cf50f74e1d1c8005d580737e352e67a8 \ No newline at end of file diff --git a/d4/de3/hash__djb2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d4/de3/hash__djb2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..7de7aa508 --- /dev/null +++ b/d4/de3/hash__djb2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,52 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +test_djb2 + + + + + +Node1->Node2 + + + + + +Node3 + + +djb2 + + + + + +Node2->Node3 + + + + + diff --git a/d4/dea/problem__14_2sol1_8c.html b/d4/dea/problem__14_2sol1_8c.html index 05e365ec1..06f6137a2 100644 --- a/d4/dea/problem__14_2sol1_8c.html +++ b/d4/dea/problem__14_2sol1_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_14/sol1.c 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,46 +92,151 @@ $(document).ready(function(){initNavTree('d4/dea/problem__14_2sol1_8c.html','../
-
-
sol1.c File Reference
+
sol1.c File Reference
-

Problem 14 solution +

Problem 14 solution More...

#include <stdio.h>
#include <stdlib.h>
Include dependency graph for sol1.c:
-
+
- - - + + - - + +

+

Functions

-long long collatz (long long start_num)
 Computes the length of collatz sequence for a given starting number.
long long collatz (long long start_num)
 Computes the length of collatz sequence for a given starting number. More...
 
-int main (int argc, char **argv)
 Main function.
int main (int argc, char **argv)
 Main function. More...
 

Detailed Description

-

Problem 14 solution

-
Author
Krishna Vedala
+

Problem 14 solution

+
Author
Krishna Vedala

Since the computational values for each iteration step are independent, we can compute them in parallel. However, the maximum values should be updated in synchrony so that we do not get into a "race condition".

-

To compile with supporintg gcc or clang, the flag "-fopenmp" should be passes while with Microsoft C compiler, the flag "/fopenmp" should be used. If you are using the provided CMAKE compilation, it will automatically detect OPENMP and compile with it for you.

-

Automatically detects for OPENMP using the _OPENMP macro.

-
+

To compile with supporintg gcc or clang, the flag "-fopenmp" should be passes while with Microsoft C compiler, the flag "/fopenmp" should be used. If you are using the provided CMAKE compilation, it will automatically detect OPENMP and compile with it for you.

+

Automatically detects for OPENMP using the _OPENMP macro.

+

Function Documentation

+ +

◆ collatz()

+ +
+
+ + + + + + + + +
long long collatz (long long start_num)
+
+ +

Computes the length of collatz sequence for a given starting number.

+
28{
+
29 long long length = 1;
+
30
+
31 while (start_num != 1) /* loop till we reach 1 */
+
32 {
+
33 if (start_num & 0x01) /* check for odd */
+
34 start_num = 3 * start_num + 1;
+
35 else
+
36 start_num >>= 1; /* simpler divide by 2 */
+
37 length++;
+
38 }
+
39
+
40 return length;
+
41}
+
+
+
+ +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char ** argv 
)
+
+ +

Main function.

+
45{
+
46 long long max_len = 0, max_len_num = 0;
+
47 long long MAX_NUM = 1000000;
+
48
+
49 if (argc ==
+
50 2) /* set commandline argumnet as the maximum iteration number */
+
51 {
+
52 MAX_NUM = atoll(argv[1]);
+
53 printf("Maximum number: %lld\n", MAX_NUM);
+
54 }
+
55
+
56 long long i;
+
57#ifdef _OPENMP
+
58#pragma omp parallel for shared(max_len, max_len_num) schedule(guided)
+
59#endif
+
60 for (i = 1; i < MAX_NUM; i++)
+
61 {
+
62 long long L = collatz(i);
+
63 if (L > max_len)
+
64 {
+
65 max_len = L; /* length of sequence */
+
66 max_len_num = i; /* starting number */
+
67 }
+
68
+
69#if defined(_OPENMP) && defined(DEBUG)
+
70 printf("Thread: %2d\t %3lld: \t%5lld\n", omp_get_thread_num(), i, L);
+
71#elif defined(DEBUG)
+
72 printf("%3lld: \t%5lld\n", i, L);
+
73#endif
+
74 }
+
75
+
76 printf("Start: %3lld: \tLength: %5lld\n", max_len_num, max_len);
+
77
+
78 return 0;
+
79}
+
long long collatz(long long start_num)
Computes the length of collatz sequence for a given starting number.
Definition: sol1.c:27
+
Definition: list.h:8
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+
diff --git a/d4/dea/problem__14_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map b/d4/dea/problem__14_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map new file mode 100644 index 000000000..d78657233 --- /dev/null +++ b/d4/dea/problem__14_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/d4/dea/problem__14_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 b/d4/dea/problem__14_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 new file mode 100644 index 000000000..cbfef908c --- /dev/null +++ b/d4/dea/problem__14_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 @@ -0,0 +1 @@ +e6687b2973d732aaade79903e9e050e8 \ No newline at end of file diff --git a/d4/dea/problem__14_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg b/d4/dea/problem__14_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg new file mode 100644 index 000000000..5d09ce9dc --- /dev/null +++ b/d4/dea/problem__14_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg @@ -0,0 +1,37 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +collatz + + + + + +Node1->Node2 + + + + + diff --git a/d4/dee/modified__binary__search_8c__incl.map b/d4/dee/modified__binary__search_8c__incl.map index 32df30be5..218136dea 100644 --- a/d4/dee/modified__binary__search_8c__incl.map +++ b/d4/dee/modified__binary__search_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/d4/dee/modified__binary__search_8c__incl.svg b/d4/dee/modified__binary__search_8c__incl.svg index 5c9935457..e2917ccd4 100644 --- a/d4/dee/modified__binary__search_8c__incl.svg +++ b/d4/dee/modified__binary__search_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - -searching/modified + +searching/modified _binary_search.c diff --git a/d4/dfe/struct_dict.html b/d4/dfe/struct_dict.html index 6e35c56ae..b35f05e7e 100644 --- a/d4/dfe/struct_dict.html +++ b/d4/dfe/struct_dict.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Dict 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() {
@@ -92,17 +92,16 @@ $(document).ready(function(){initNavTree('d4/dfe/struct_dict.html','../../'); in
-
-
Dict Struct Reference
+
Dict Struct Reference
- - -

+

Data Fields

+
void * elements [MAXELEMENTS]
 
+
int number_of_elements
 
@@ -115,7 +114,7 @@ int number_of_elements diff --git a/d4/dfe/struct_dict.js b/d4/dfe/struct_dict.js deleted file mode 100644 index 9744f72f8..000000000 --- a/d4/dfe/struct_dict.js +++ /dev/null @@ -1,5 +0,0 @@ -var struct_dict = -[ - [ "elements", "d4/dfe/struct_dict.html#a2e14d738e06c60eebcc2eac274e6676e", null ], - [ "number_of_elements", "d4/dfe/struct_dict.html#add3f42ea66e92ce457a243d7534f5654", null ] -]; \ No newline at end of file diff --git a/d5/d23/qr__decomposition_8c.html b/d5/d23/qr__decomposition_8c.html index 851166010..040a739c0 100644 --- a/d5/d23/qr__decomposition_8c.html +++ b/d5/d23/qr__decomposition_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: numerical_methods/qr_decomposition.c 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('d5/d23/qr__decomposition_8c.html','../
-
-
qr_decomposition.c File Reference
+
qr_decomposition.c File Reference
-

Program to compute the QR decomposition of a given matrix. +

Program to compute the QR decomposition of a given matrix. More...

#include <math.h>
#include <stdio.h>
@@ -107,27 +106,119 @@ $(document).ready(function(){initNavTree('d5/d23/qr__decomposition_8c.html','../
Include dependency graph for qr_decomposition.c:
-
+
- - - + +

+

Functions

-int main (void)
 main function
int main (void)
 main function More...
 

Detailed Description

-

Program to compute the QR decomposition of a given matrix.

-
Author
Krishna Vedala
-
+

Program to compute the QR decomposition of a given matrix.

+
Author
Krishna Vedala
+

Function Documentation

+ +

◆ main()

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

main function

+
19{
+
20 double **A;
+
21 unsigned int ROWS, COLUMNS;
+
22
+
23 printf("Enter the number of rows and columns: ");
+
24 scanf("%u %u", &ROWS, &COLUMNS);
+
25 if (ROWS < COLUMNS)
+
26 {
+
27 fprintf(stderr,
+
28 "Number of rows must be greater than or equal to "
+
29 "number of columns.\n");
+
30 return -1;
+
31 }
+
32
+
33 printf("Enter matrix elements row-wise:\n");
+
34
+
35 A = (double **)malloc(ROWS * sizeof(double *));
+
36 for (int i = 0; i < ROWS; i++)
+
37 A[i] = (double *)malloc(COLUMNS * sizeof(double));
+
38
+
39 for (int i = 0; i < ROWS; i++)
+
40 for (int j = 0; j < COLUMNS; j++) scanf("%lf", &A[i][j]);
+
41
+
42 print_matrix(A, ROWS, COLUMNS);
+
43
+
44 double **R = (double **)malloc(sizeof(double *) * ROWS);
+
45 double **Q = (double **)malloc(sizeof(double *) * ROWS);
+
46 if (!Q || !R)
+
47 {
+
48 perror("Unable to allocate memory for Q & R!");
+
49 return -1;
+
50 }
+
51 for (int i = 0; i < ROWS; i++)
+
52 {
+
53 R[i] = (double *)malloc(sizeof(double) * COLUMNS);
+
54 Q[i] = (double *)malloc(sizeof(double) * ROWS);
+
55 if (!Q[i] || !R[i])
+
56 {
+
57 perror("Unable to allocate memory for Q & R.");
+
58 return -1;
+
59 }
+
60 }
+
61
+
62 clock_t t1 = clock();
+
63 qr_decompose(A, Q, R, ROWS, COLUMNS);
+
64 double dtime = (double)(clock() - t1) / CLOCKS_PER_SEC;
+
65
+
66 print_matrix(R, ROWS, COLUMNS);
+
67 print_matrix(Q, ROWS, COLUMNS);
+
68 printf("Time taken to compute: %.4g sec\n", dtime);
+
69
+
70 for (int i = 0; i < ROWS; i++)
+
71 {
+
72 free(A[i]);
+
73 free(R[i]);
+
74 free(Q[i]);
+
75 }
+
76 free(A);
+
77 free(R);
+
78 free(Q);
+
79 return 0;
+
80}
+
#define malloc(bytes)
This macro replace the standard malloc function with malloc_dbg.
Definition: malloc_dbg.h:18
+
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
+
void qr_decompose(double **A, double **Q, double **R, int M, int N)
Decompose matrix using Gram-Schmidt process.
Definition: qr_decompose.h:142
+
void print_matrix(double **A, int M, int N)
function to display matrix on stdout
Definition: qr_decompose.h:22
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+
diff --git a/d5/d23/qr__decomposition_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map b/d5/d23/qr__decomposition_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map new file mode 100644 index 000000000..694871592 --- /dev/null +++ b/d5/d23/qr__decomposition_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/d5/d23/qr__decomposition_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.md5 b/d5/d23/qr__decomposition_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.md5 new file mode 100644 index 000000000..4c1ba9008 --- /dev/null +++ b/d5/d23/qr__decomposition_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.md5 @@ -0,0 +1 @@ +c487a898f340056c2c2e75a70d5f2a67 \ No newline at end of file diff --git a/d5/d23/qr__decomposition_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg b/d5/d23/qr__decomposition_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg new file mode 100644 index 000000000..7c0ddf5b8 --- /dev/null +++ b/d5/d23/qr__decomposition_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg @@ -0,0 +1,124 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +print_matrix + + + + + +Node1->Node2 + + + + + +Node3 + + +qr_decompose + + + + + +Node1->Node3 + + + + + +Node4 + + +vector_dot + + + + + +Node3->Node4 + + + + + +Node5 + + +vector_mag + + + + + +Node3->Node5 + + + + + +Node6 + + +vector_proj + + + + + +Node3->Node6 + + + + + +Node7 + + +vector_sub + + + + + +Node3->Node7 + + + + + +Node5->Node4 + + + + + +Node6->Node4 + + + + + diff --git a/d5/d38/bubble__sort__recursion_8c.html b/d5/d38/bubble__sort__recursion_8c.html index 1039f1195..7a1851652 100644 --- a/d5/d38/bubble__sort__recursion_8c.html +++ b/d5/d38/bubble__sort__recursion_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: sorting/bubble_sort_recursion.c 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('d5/d38/bubble__sort__recursion_8c.html
-
-
bubble_sort_recursion.c File Reference
+
bubble_sort_recursion.c File Reference
-

Bubble sort algorithm implementation using recursion. +

Bubble sort algorithm implementation using recursion. More...

#include <assert.h>
#include <stdbool.h>
@@ -107,11 +106,11 @@ $(document).ready(function(){initNavTree('d5/d38/bubble__sort__recursion_8c.html
Include dependency graph for bubble_sort_recursion.c:
-
+
- @@ -119,19 +118,17 @@ Functions - - + + - - + +

+

Functions

void swap (int *first, int *second)
 Swapped two numbers using pointer. More...
void bubbleSort (int *arr, int size)
 Bubble sort algorithm implements using recursion. More...
 
-void test ()
 Test function.
void test ()
 Test function. More...
 
-int main ()
 Driver Code.
int main ()
 Driver Code. More...
 

Detailed Description

-

Bubble sort algorithm implementation using recursion.

+

Bubble sort algorithm implementation using recursion.

Function Documentation

- +

◆ bubbleSort()

@@ -165,37 +162,70 @@ int 
30 {
-
31  if (size == 1)
-
32  {
-
33  return;
-
34  }
-
35  bool swapped = false;
-
36  for (int i = 0; i < size - 1; ++i)
-
37  {
-
38  if (arr[i] > arr[i + 1])
-
39  {
-
40  swap(arr + i, arr + i + 1);
-
41  swapped = true;
-
42  }
-
43  }
-
44  if (swapped)
-
45  {
-
46  bubbleSort(arr, size - 1);
-
47  }
-
48 }
+
30{
+
31 if (size == 1)
+
32 {
+
33 return;
+
34 }
+
35 bool swapped = false;
+
36 for (int i = 0; i < size - 1; ++i)
+
37 {
+
38 if (arr[i] > arr[i + 1])
+
39 {
+
40 swap(arr + i, arr + i + 1);
+
41 swapped = true;
+
42 }
+
43 }
+
44 if (swapped)
+
45 {
+
46 bubbleSort(arr, size - 1);
+
47 }
+
48}
void bubbleSort(int *arr, int size)
Bubble sort algorithm implements using recursion.
Definition: bubble_sort_recursion.c:29
void swap(int *first, int *second)
Swapped two numbers using pointer.
Definition: bubble_sort_recursion.c:17
Here is the call graph for this function:
-
+
- + +

◆ main()

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

Driver Code.

+
73{
+
74 /* Intializes random number generator */
+
75 srand(time(NULL));
+
76 test();
+
77 return 0;
+
78}
+
void test()
Test function.
Definition: bubble_sort_recursion.c:53
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+

◆ swap()

@@ -229,12 +259,56 @@ Here is the call graph for this function:
-
18 {
-
19  int temp = *first;
-
20  *first = *second;
-
21  *second = temp;
-
22 }
+
18{
+
19 int temp = *first;
+
20 *first = *second;
+
21 *second = temp;
+
22}
+
+
+ +

◆ test()

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

Test function.

+
54{
+
55 const int size = 10;
+
56 int *arr = (int *)calloc(size, sizeof(int));
+
57
+
58 /* generate size random numbers from 0 to 100 */
+
59 for (int i = 0; i < size; i++)
+
60 {
+
61 arr[i] = rand() % 100;
+
62 }
+
63 bubbleSort(arr, size);
+
64 for (int i = 0; i < size - 1; ++i)
+
65 {
+
66 assert(arr[i] <= arr[i + 1]);
+
67 }
+
68 free(arr);
+
69}
+
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
+
#define calloc(elemCount, elemSize)
This macro replace the standard calloc function with calloc_dbg.
Definition: malloc_dbg.h:22
+
+Here is the call graph for this function:
+
+
+
+
+
@@ -243,7 +317,7 @@ Here is the call graph for this function:
diff --git a/d5/d38/bubble__sort__recursion_8c_aa8989f6c9bfd1f040854fa18b180114f_cgraph.map b/d5/d38/bubble__sort__recursion_8c_aa8989f6c9bfd1f040854fa18b180114f_cgraph.map index cd19d9cbc..ede25fbf1 100644 --- a/d5/d38/bubble__sort__recursion_8c_aa8989f6c9bfd1f040854fa18b180114f_cgraph.map +++ b/d5/d38/bubble__sort__recursion_8c_aa8989f6c9bfd1f040854fa18b180114f_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/d5/d38/bubble__sort__recursion_8c_aa8989f6c9bfd1f040854fa18b180114f_cgraph.md5 b/d5/d38/bubble__sort__recursion_8c_aa8989f6c9bfd1f040854fa18b180114f_cgraph.md5 index e0678c6a7..3f7f51dba 100644 --- a/d5/d38/bubble__sort__recursion_8c_aa8989f6c9bfd1f040854fa18b180114f_cgraph.md5 +++ b/d5/d38/bubble__sort__recursion_8c_aa8989f6c9bfd1f040854fa18b180114f_cgraph.md5 @@ -1 +1 @@ -7b3c01b9d4a149e6c1e00d1d9d0e8ef0 \ No newline at end of file +326ce356cad0b983335f645f11c50126 \ No newline at end of file diff --git a/d5/d38/bubble__sort__recursion_8c_aa8989f6c9bfd1f040854fa18b180114f_cgraph.svg b/d5/d38/bubble__sort__recursion_8c_aa8989f6c9bfd1f040854fa18b180114f_cgraph.svg index 6a1c87dd5..2a920f9be 100644 --- a/d5/d38/bubble__sort__recursion_8c_aa8989f6c9bfd1f040854fa18b180114f_cgraph.svg +++ b/d5/d38/bubble__sort__recursion_8c_aa8989f6c9bfd1f040854fa18b180114f_cgraph.svg @@ -1,37 +1,43 @@ - - - + + bubbleSort - + Node1 - -bubbleSort + +bubbleSort + + +Node1->Node1 + + + Node2 - -swap + +swap - + Node1->Node2 - - + + diff --git a/d5/d38/bubble__sort__recursion_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.map b/d5/d38/bubble__sort__recursion_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.map new file mode 100644 index 000000000..479ad4c07 --- /dev/null +++ b/d5/d38/bubble__sort__recursion_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/d5/d38/bubble__sort__recursion_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.md5 b/d5/d38/bubble__sort__recursion_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.md5 new file mode 100644 index 000000000..bb23ea80c --- /dev/null +++ b/d5/d38/bubble__sort__recursion_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.md5 @@ -0,0 +1 @@ +66fc680201a9716603053dad6e503348 \ No newline at end of file diff --git a/d5/d38/bubble__sort__recursion_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg b/d5/d38/bubble__sort__recursion_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg new file mode 100644 index 000000000..76ba35e5d --- /dev/null +++ b/d5/d38/bubble__sort__recursion_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg @@ -0,0 +1,58 @@ + + + + + + +test + + + +Node1 + + +test + + + + + +Node2 + + +bubbleSort + + + + + +Node1->Node2 + + + + + +Node2->Node2 + + + + + +Node3 + + +swap + + + + + +Node2->Node3 + + + + + diff --git a/d5/d38/bubble__sort__recursion_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d5/d38/bubble__sort__recursion_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..084bfcc6c --- /dev/null +++ b/d5/d38/bubble__sort__recursion_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/d5/d38/bubble__sort__recursion_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d5/d38/bubble__sort__recursion_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..0ace207b9 --- /dev/null +++ b/d5/d38/bubble__sort__recursion_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +07a7bd8cd9ad7908959a43069c5e204b \ No newline at end of file diff --git a/d5/d38/bubble__sort__recursion_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d5/d38/bubble__sort__recursion_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..13febeaee --- /dev/null +++ b/d5/d38/bubble__sort__recursion_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,73 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +test + + + + + +Node1->Node2 + + + + + +Node3 + + +bubbleSort + + + + + +Node2->Node3 + + + + + +Node3->Node3 + + + + + +Node4 + + +swap + + + + + +Node3->Node4 + + + + + diff --git a/d5/d3d/problem__5_2sol2_8c.html b/d5/d3d/problem__5_2sol2_8c.html index 2ea21bef2..4c185de9e 100644 --- a/d5/d3d/problem__5_2sol2_8c.html +++ b/d5/d3d/problem__5_2sol2_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_5/sol2.c 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,23 +93,22 @@ $(document).ready(function(){initNavTree('d5/d3d/problem__5_2sol2_8c.html','../. -
-
sol2.c File Reference
+
sol2.c File Reference
-

Problem 5 solution - Naive algorithm (Improved over problem_5/sol1.c) +

Problem 5 solution - Naive algorithm (Improved over problem_5/sol1.c) More...

#include <stdio.h>
#include <stdlib.h>
Include dependency graph for sol2.c:
-
+
- @@ -118,20 +117,20 @@ Functions

+

Functions

static int check_number (unsigned long long n)
 Checks if a given number is devisable by every number between 1 and 20. More...
 Main function. More...
 
-

+

Variables

static unsigned int divisors []
 Hack to store divisors between 1 & 20. More...
 

Detailed Description

-

Problem 5 solution - Naive algorithm (Improved over problem_5/sol1.c)

-

Little bit improved version of the naive problem_5/sol1.c. Since the number has to be divisable by 20, we can start at 20 and go in 20 steps. Also we don't have to check against any number, since most of them are implied by other divisions (i.e. if a number is divisable by 20, it's also divisable by 2, 5, and 10). This all gives a 97% perfomance increase on my machine (9.562 vs 0.257)

+

Problem 5 solution - Naive algorithm (Improved over problem_5/sol1.c)

+

Little bit improved version of the naive problem_5/sol1.c. Since the number has to be divisable by 20, we can start at 20 and go in 20 steps. Also we don't have to check against any number, since most of them are implied by other divisions (i.e. if a number is divisable by 20, it's also divisable by 2, 5, and 10). This all gives a 97% perfomance increase on my machine (9.562 vs 0.257)

See also
Slower: problem_5/sol1.c
Faster: problem_5/sol3.c

Function Documentation

- +

◆ check_number()

@@ -165,22 +164,22 @@ Faster:
Returns
0 if not divisible
1 if divisible
-
31 {
-
32  for (size_t i = 0; i < 7; ++i)
-
33  {
-
34  if (n % divisors[i] != 0)
-
35  {
-
36  return 0;
-
37  }
-
38  }
-
39 
-
40  return 1;
-
41 }
+
31{
+
32 for (size_t i = 0; i < 7; ++i)
+
33 {
+
34 if (n % divisors[i] != 0)
+
35 {
+
36 return 0;
+
37 }
+
38 }
+
39
+
40 return 1;
+
41}
static unsigned int divisors[]
Hack to store divisors between 1 & 20.
Definition: sol2.c:21
- +

◆ main()

@@ -198,29 +197,29 @@ Faster:
Returns
0 on exit
-
49 {
-
50  for (unsigned long long n = 20;; n += 20)
-
51  {
-
52  if (check_number(n))
-
53  {
-
54  printf("Result: %llu\n", n);
-
55  break;
-
56  }
-
57  }
-
58  return 0;
-
59 }
+
49{
+
50 for (unsigned long long n = 20;; n += 20)
+
51 {
+
52 if (check_number(n))
+
53 {
+
54 printf("Result: %llu\n", n);
+
55 break;
+
56 }
+
57 }
+
58 return 0;
+
59}
static int check_number(unsigned long long n)
Checks if a given number is devisable by every number between 1 and 20.
Definition: sol2.c:30
Here is the call graph for this function:
-
+

Variable Documentation

- +

◆ divisors

@@ -253,7 +252,7 @@ Here is the call graph for this function:
diff --git a/d5/d3d/problem__5_2sol2_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map b/d5/d3d/problem__5_2sol2_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map index da586e3b4..aa59cdc31 100644 --- a/d5/d3d/problem__5_2sol2_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map +++ b/d5/d3d/problem__5_2sol2_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map @@ -1,4 +1,4 @@ - + diff --git a/d5/d3d/problem__5_2sol2_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg b/d5/d3d/problem__5_2sol2_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg index 8f5177318..9e2e97a6e 100644 --- a/d5/d3d/problem__5_2sol2_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg +++ b/d5/d3d/problem__5_2sol2_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg @@ -1,14 +1,14 @@ - - + main - + Node1 @@ -22,16 +22,16 @@ Node2 - -check_number + +check_number Node1->Node2 - - + + diff --git a/d5/d3e/problem__3_2sol2_8c__incl.map b/d5/d3e/problem__3_2sol2_8c__incl.map index 2cece4bf0..ba7d122ff 100644 --- a/d5/d3e/problem__3_2sol2_8c__incl.map +++ b/d5/d3e/problem__3_2sol2_8c__incl.map @@ -1,4 +1,4 @@ - - + + diff --git a/d5/d3e/problem__3_2sol2_8c__incl.svg b/d5/d3e/problem__3_2sol2_8c__incl.svg index 6f744777f..fe22bd33f 100644 --- a/d5/d3e/problem__3_2sol2_8c__incl.svg +++ b/d5/d3e/problem__3_2sol2_8c__incl.svg @@ -1,21 +1,21 @@ - - + project_euler/problem_3/sol2.c - + Node1 - + project_euler/problem -_3/sol2.c +_3/sol2.c @@ -23,16 +23,16 @@ Node2 - -stdio.h + +stdio.h Node1->Node2 - - + + diff --git a/d5/d4c/group__sorting.html b/d5/d4c/group__sorting.html index 873470fc2..85196ff01 100644 --- a/d5/d4c/group__sorting.html +++ b/d5/d4c/group__sorting.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Sorting algorithms @@ -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,19 +93,18 @@ $(document).ready(function(){initNavTree('d5/d4c/group__sorting.html','../../'); -
-
Sorting algorithms
+
Sorting algorithms
- - +

+

Macros

-#define BEAD(i, j)   beads[i * max + j]
+#define BEAD(i, j)   beads[i * max + j]
 Create easy access of elements from a 2D matrix stored in memory as a 1D array.
 
- @@ -125,17 +124,16 @@ Functions - - + + - +

+

Functions

void display (const int *arr, int n)
 Displays the array, passed to this method. More...
void merge_sort (int *a, int n, int l, int r)
 Merge sort algorithm implementation. More...
 
-void show_data (int *arr, long len)
 Helper function to print array values.
void show_data (int *arr, long len)
 Helper function to print array values. More...
 
void shell_sort (int *array, long LEN)
void shell_sort (int *array, long LEN)
 Shell sort algorithm. More...
 

Detailed Description

Function Documentation

- +

◆ bead_sort()

@@ -169,40 +167,40 @@ void 
38 {
-
39  int i, j, max, sum;
-
40  unsigned char *beads;
-
41 
-
42  for (i = 1, max = a[0]; i < len; i++)
-
43  if (a[i] > max)
-
44  max = a[i];
-
45 
-
46  beads = calloc(1, max * len);
-
47 
-
48  /* mark the beads */
-
49  for (i = 0; i < len; i++)
-
50  for (j = 0; j < a[i]; j++) BEAD(i, j) = 1;
-
51 
-
52  for (j = 0; j < max; j++)
-
53  {
-
54  /* count how many beads are on each post */
-
55  for (sum = i = 0; i < len; i++)
-
56  {
-
57  sum += BEAD(i, j);
-
58  BEAD(i, j) = 0;
-
59  }
-
60  /* mark bottom sum beads */
-
61  for (i = len - sum; i < len; i++) BEAD(i, j) = 1;
-
62  }
-
63 
-
64  for (i = 0; i < len; i++)
-
65  {
-
66  for (j = 0; j < max && BEAD(i, j); j++)
-
67  ;
-
68  a[i] = j;
-
69  }
-
70  free(beads);
-
71 }
+
38{
+
39 int i, j, max, sum;
+
40 unsigned char *beads;
+
41
+
42 for (i = 1, max = a[0]; i < len; i++)
+
43 if (a[i] > max)
+
44 max = a[i];
+
45
+
46 beads = calloc(1, max * len);
+
47
+
48 /* mark the beads */
+
49 for (i = 0; i < len; i++)
+
50 for (j = 0; j < a[i]; j++) BEAD(i, j) = 1;
+
51
+
52 for (j = 0; j < max; j++)
+
53 {
+
54 /* count how many beads are on each post */
+
55 for (sum = i = 0; i < len; i++)
+
56 {
+
57 sum += BEAD(i, j);
+
58 BEAD(i, j) = 0;
+
59 }
+
60 /* mark bottom sum beads */
+
61 for (i = len - sum; i < len; i++) BEAD(i, j) = 1;
+
62 }
+
63
+
64 for (i = 0; i < len; i++)
+
65 {
+
66 for (j = 0; j < max && BEAD(i, j); j++)
+
67 ;
+
68 a[i] = j;
+
69 }
+
70 free(beads);
+
71}
#define max(a, b)
shorthand for maximum value
Definition: kohonen_som_topology.c:39
#define BEAD(i, j)
Create easy access of elements from a 2D matrix stored in memory as a 1D array.
Definition: bead_sort.c:16
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
@@ -210,7 +208,7 @@ void  +

◆ display()

@@ -244,18 +242,18 @@ void 
24 {
-
25  for (int i = 0; i < n; i++)
-
26  {
-
27  printf("%d ", arr[i]);
-
28  }
-
29 
-
30  printf("\n");
-
31 }
+
24{
+
25 for (int i = 0; i < n; i++)
+
26 {
+
27 printf("%d ", arr[i]);
+
28 }
+
29
+
30 printf("\n");
+
31}
- +

◆ merge()

@@ -303,52 +301,52 @@ void 
34 {
-
35  int *b = (int *)malloc(n * sizeof(int)); /* dynamic memory must be freed */
-
36  int c = l;
-
37  int p1, p2;
-
38  p1 = l;
-
39  p2 = ((l + r) / 2) + 1;
-
40  while ((p1 < ((l + r) / 2) + 1) && (p2 < r + 1))
-
41  {
-
42  if (a[p1] <= a[p2])
-
43  {
-
44  b[c++] = a[p1];
-
45  p1++;
-
46  }
-
47  else
-
48  {
-
49  b[c++] = a[p2];
-
50  p2++;
-
51  }
-
52  }
-
53 
-
54  if (p2 == r + 1)
-
55  {
-
56  while ((p1 < ((l + r) / 2) + 1))
-
57  {
-
58  b[c++] = a[p1];
-
59  p1++;
-
60  }
-
61  }
-
62  else
-
63  {
-
64  while ((p2 < r + 1))
-
65  {
-
66  b[c++] = a[p2];
-
67  p2++;
-
68  }
-
69  }
-
70 
-
71  for (c = l; c < r - l + 1; c++) a[c] = b[c];
-
72 
-
73  free(b);
-
74 }
+
34{
+
35 int *b = (int *)malloc(n * sizeof(int)); /* dynamic memory must be freed */
+
36 int c = l;
+
37 int p1, p2;
+
38 p1 = l;
+
39 p2 = ((l + r) / 2) + 1;
+
40 while ((p1 < ((l + r) / 2) + 1) && (p2 < r + 1))
+
41 {
+
42 if (a[p1] <= a[p2])
+
43 {
+
44 b[c++] = a[p1];
+
45 p1++;
+
46 }
+
47 else
+
48 {
+
49 b[c++] = a[p2];
+
50 p2++;
+
51 }
+
52 }
+
53
+
54 if (p2 == r + 1)
+
55 {
+
56 while ((p1 < ((l + r) / 2) + 1))
+
57 {
+
58 b[c++] = a[p1];
+
59 p1++;
+
60 }
+
61 }
+
62 else
+
63 {
+
64 while ((p2 < r + 1))
+
65 {
+
66 b[c++] = a[p2];
+
67 p2++;
+
68 }
+
69 }
+
70
+
71 for (c = l; c < r - l + 1; c++) a[c] = b[c];
+
72
+
73 free(b);
+
74}
#define malloc(bytes)
This macro replace the standard malloc function with malloc_dbg.
Definition: malloc_dbg.h:18
- +

◆ merge_sort()

@@ -396,34 +394,34 @@ void 
83 {
-
84  if (r - l == 1)
-
85  {
-
86  if (a[l] > a[r])
-
87  swap(&a[l], &a[r]);
-
88  }
-
89  else if (l != r)
-
90  {
-
91  merge_sort(a, n, l, (l + r) / 2);
-
92  merge_sort(a, n, ((l + r) / 2) + 1, r);
-
93  merge(a, l, r, n);
-
94  }
-
95 
-
96  /* no change if l == r */
-
97 }
+
83{
+
84 if (r - l == 1)
+
85 {
+
86 if (a[l] > a[r])
+
87 swap(&a[l], &a[r]);
+
88 }
+
89 else if (l != r)
+
90 {
+
91 merge_sort(a, n, l, (l + r) / 2);
+
92 merge_sort(a, n, ((l + r) / 2) + 1, r);
+
93 merge(a, l, r, n);
+
94 }
+
95
+
96 /* no change if l == r */
+
97}
void swap(int *a, int *b)
Swap two integer variables.
Definition: merge_sort.c:17
void merge(int *a, int l, int r, int n)
Perform merge of segments.
Definition: merge_sort.c:33
void merge_sort(int *a, int n, int l, int r)
Merge sort algorithm implementation.
Definition: merge_sort.c:82
Here is the call graph for this function:
-
+
- +

◆ RecursionInsertionSort()

@@ -457,30 +455,36 @@ Here is the call graph for this function:
-
21 {
-
22  if(size <= 0)
-
23  {
-
24  return;
-
25  }
-
26 
-
27  // marking recursive call to reach starting element
-
28  RecursionInsertionSort(arr,size-1);
-
29 
-
30  int key = arr[size-1];
-
31  int j = size-2;
-
32  // swapping logic for insertion sort
-
33  while(j >= 0 && arr[j] > key)
-
34  {
-
35  arr[j+1] = arr[j];
-
36  j--;
-
37  }
-
38  arr[j+1] = key;
-
39 }
+
21{
+
22 if(size <= 0)
+
23 {
+
24 return;
+
25 }
+
26
+
27 // marking recursive call to reach starting element
+
28 RecursionInsertionSort(arr,size-1);
+
29
+
30 int key = arr[size-1];
+
31 int j = size-2;
+
32 // swapping logic for insertion sort
+
33 while(j >= 0 && arr[j] > key)
+
34 {
+
35 arr[j+1] = arr[j];
+
36 j--;
+
37 }
+
38 arr[j+1] = key;
+
39}
void RecursionInsertionSort(int *arr, int size)
Insertion sort algorithm implements using Recursion.
Definition: insertion_sort_recursive.c:20
-
+
+Here is the call graph for this function:
+
+
- + +
+
+

◆ shell_sort()

@@ -507,7 +511,7 @@ Here is the call graph for this function:

Shell sort algorithm.

-


+


Optimized algorithm - takes half the time as other

Parameters
@@ -515,32 +519,67 @@ Optimized algorithm - takes half the time as other

Pa
[in,out]arrayarray to sort
-
42 {
-
43  const int gaps[] = {701, 301, 132, 57, 23, 10, 4, 1};
-
44  const int gap_len = 8;
-
45  long i, j, g;
-
46 
-
47  for (g = 0; g < gap_len; g++)
-
48  { // for each gap
-
49  int gap = gaps[g];
-
50  for (i = gap; i < LEN; i++)
-
51  { // from gap position to the end
-
52  int tmp = array[i];
-
53 
-
54  for (j = i; j >= gap && (array[j - gap] - tmp) > 0; j -= gap)
-
55  array[j] = array[j - gap];
-
56  array[j] = tmp;
-
57  }
-
58  }
-
59 #ifdef DEBUG
-
60  for (i = 0; i < LEN; i++) printf("%s\t", data[i]);
-
61 #endif
-
62 }
+
42{
+
43 const int gaps[] = {701, 301, 132, 57, 23, 10, 4, 1};
+
44 const int gap_len = 8;
+
45 long i, j, g;
+
46
+
47 for (g = 0; g < gap_len; g++)
+
48 { // for each gap
+
49 int gap = gaps[g];
+
50 for (i = gap; i < LEN; i++)
+
51 { // from gap position to the end
+
52 int tmp = array[i];
+
53
+
54 for (j = i; j >= gap && (array[j - gap] - tmp) > 0; j -= gap)
+
55 array[j] = array[j - gap];
+
56 array[j] = tmp;
+
57 }
+
58 }
+
59#ifdef DEBUG
+
60 for (i = 0; i < LEN; i++) printf("%s\t", data[i]);
+
61#endif
+
62}
+
#define LEN
Linear input code | Compressed code | Linear output code ---------------—+--------------—+-----------...
Definition: alaw.c:28
Definition: prime_factoriziation.c:25
- + +

◆ show_data()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void show_data (int * arr,
long len 
)
+
+ +

Helper function to print array values.

+
17{
+
18 for (long i = 0; i < len; i++) printf("%3d ", arr[i]);
+
19 printf("\n");
+
20}
+
+
+
+

◆ swap()

@@ -567,7 +606,7 @@ Optimized algorithm - takes half the time as other

Pa

Swap two integer variables.

-

Function to swap values of two integers.

+

Function to swap values of two integers.

Parameters
@@ -577,12 +616,12 @@ Optimized algorithm - takes half the time as other

Pa
[in,out]apointer to first variable
-
18 {
-
19  int t;
-
20  t = *a;
-
21  *a = *b;
-
22  *b = t;
-
23 }
+
18{
+
19 int t;
+
20 t = *a;
+
21 *a = *b;
+
22 *b = t;
+
23}
@@ -591,7 +630,7 @@ Optimized algorithm - takes half the time as other

Pa diff --git a/d5/d4c/group__sorting_ga98666b73777e308fb06a3c489ce25359_cgraph.map b/d5/d4c/group__sorting_ga98666b73777e308fb06a3c489ce25359_cgraph.map new file mode 100644 index 000000000..3d1b97f8d --- /dev/null +++ b/d5/d4c/group__sorting_ga98666b73777e308fb06a3c489ce25359_cgraph.map @@ -0,0 +1,3 @@ + + + diff --git a/d5/d4c/group__sorting_ga98666b73777e308fb06a3c489ce25359_cgraph.md5 b/d5/d4c/group__sorting_ga98666b73777e308fb06a3c489ce25359_cgraph.md5 new file mode 100644 index 000000000..135af83db --- /dev/null +++ b/d5/d4c/group__sorting_ga98666b73777e308fb06a3c489ce25359_cgraph.md5 @@ -0,0 +1 @@ +bf370e63cdb0afeb8782cb80a016ed2a \ No newline at end of file diff --git a/d5/d4c/group__sorting_ga98666b73777e308fb06a3c489ce25359_cgraph.svg b/d5/d4c/group__sorting_ga98666b73777e308fb06a3c489ce25359_cgraph.svg new file mode 100644 index 000000000..e75f4a4c4 --- /dev/null +++ b/d5/d4c/group__sorting_ga98666b73777e308fb06a3c489ce25359_cgraph.svg @@ -0,0 +1,28 @@ + + + + + + +RecursionInsertionSort + + + +Node1 + + +RecursionInsertionSort + + + + + +Node1->Node1 + + + + + diff --git a/d5/d4c/group__sorting_gab99b8a397bdd0bf2903d66c22ba4ba43_cgraph.map b/d5/d4c/group__sorting_gab99b8a397bdd0bf2903d66c22ba4ba43_cgraph.map index baf700b9d..8d9544dc4 100644 --- a/d5/d4c/group__sorting_gab99b8a397bdd0bf2903d66c22ba4ba43_cgraph.map +++ b/d5/d4c/group__sorting_gab99b8a397bdd0bf2903d66c22ba4ba43_cgraph.map @@ -1,5 +1,5 @@ - - - + + + diff --git a/d5/d4c/group__sorting_gab99b8a397bdd0bf2903d66c22ba4ba43_cgraph.md5 b/d5/d4c/group__sorting_gab99b8a397bdd0bf2903d66c22ba4ba43_cgraph.md5 index 304ae487f..99e59715c 100644 --- a/d5/d4c/group__sorting_gab99b8a397bdd0bf2903d66c22ba4ba43_cgraph.md5 +++ b/d5/d4c/group__sorting_gab99b8a397bdd0bf2903d66c22ba4ba43_cgraph.md5 @@ -1 +1 @@ -f0cf73e3c2f5d253f5fd127495e31207 \ No newline at end of file +36f1cf52c6ac6d95b58d2600bed0da4c \ No newline at end of file diff --git a/d5/d4c/group__sorting_gab99b8a397bdd0bf2903d66c22ba4ba43_cgraph.svg b/d5/d4c/group__sorting_gab99b8a397bdd0bf2903d66c22ba4ba43_cgraph.svg index ce1d3f14a..f341d74ad 100644 --- a/d5/d4c/group__sorting_gab99b8a397bdd0bf2903d66c22ba4ba43_cgraph.svg +++ b/d5/d4c/group__sorting_gab99b8a397bdd0bf2903d66c22ba4ba43_cgraph.svg @@ -1,52 +1,58 @@ - - + merge_sort - + Node1 - -merge_sort + +merge_sort + + +Node1->Node1 + + + Node2 - -merge + +merge Node1->Node2 - - + + Node3 - -swap + +swap - + Node1->Node3 - - + + diff --git a/d5/d51/problem__25_2sol1_8c__incl.map b/d5/d51/problem__25_2sol1_8c__incl.map index ca954f256..16f51cd68 100644 --- a/d5/d51/problem__25_2sol1_8c__incl.map +++ b/d5/d51/problem__25_2sol1_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/d5/d51/problem__25_2sol1_8c__incl.svg b/d5/d51/problem__25_2sol1_8c__incl.svg index 941ab99ef..a0f556b7c 100644 --- a/d5/d51/problem__25_2sol1_8c__incl.svg +++ b/d5/d51/problem__25_2sol1_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - -project_euler/problem + +project_euler/problem _25/sol1.c diff --git a/d5/d5c/test__min__printf_8c.html b/d5/d5c/test__min__printf_8c.html new file mode 100644 index 000000000..24a1b9664 --- /dev/null +++ b/d5/d5c/test__min__printf_8c.html @@ -0,0 +1,179 @@ + + + + + + + +Algorithms_in_C: developer_tools/test_min_printf.c File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Algorithms_in_C 1.0.0 +
+
Set of algorithms implemented in C.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
test_min_printf.c File Reference
+
+
+ +

File used to test min_printf function. +More...

+
#include "min_printf.h"
+#include <stdio.h>
+
+Include dependency graph for test_min_printf.c:
+
+
+
+
+
+ + + + +

+Functions

int main ()
 for min_printf function for printf function More...
 
+

Detailed Description

+

File used to test min_printf function.

+

The test will be executed by comparing the result of both min_printf and printf functions

Author
Jaskarn7
+
See also
min_printf.h
+

Function Documentation

+ +

◆ main()

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

for min_printf function for printf function

+

Main function

+

This function is used to test min_printf function. The numbers and string used for the test is generated randomly (The user can also specify their own value for tests) First integers were tested then floats and at last strings After running the program the user will see three pair of lines with each pair followed by an empty line In each pair of lines, the first line will be printed by min_printf function and next line by the actual printf function In each line user will see number or string covered with two colons, they are used to check from where the printing was started and where it ends

Returns
0 on exit
+

Printing an empty new line

+
25{
+
26 // print strings using `printf` and `min_printf`
+
27 min_printf(":%d: :%1.6d:\n", 12, 56);
+
28 printf(":%d: :%1.6d:\n", 12, 56);
+
29
+
30 printf("\n"); /// Printing an empty new line
+
31
+
32 // print floats or doubles using `printf` and `min_printf`
+
33 min_printf(":%f: :%3.6f:\n", 104.5654, 43.766443332);
+
34 printf(":%f: :%3.6f:\n", 104.5654, 43.766443332);
+
35
+
36 printf("\n");
+
37
+
38 // print integers `printf` and `min_printf`
+
39 min_printf(":%s: :%4.3s:\n", "Hello, World!", "Hello, World!");
+
40 printf(":%s: :%4.3s:\n", "Hello, World!", "Hello, World!");
+
41
+
42}
+
void min_printf(char *fmt,...)
min_printf is the function same as printf
Definition: min_printf.h:295
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+
+
+ + + + diff --git a/d5/d5c/test__min__printf_8c.js b/d5/d5c/test__min__printf_8c.js new file mode 100644 index 000000000..95ab4e137 --- /dev/null +++ b/d5/d5c/test__min__printf_8c.js @@ -0,0 +1,4 @@ +var test__min__printf_8c = +[ + [ "main", "d5/d5c/test__min__printf_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/d5/d5c/test__min__printf_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d5/d5c/test__min__printf_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..75a7e4862 --- /dev/null +++ b/d5/d5c/test__min__printf_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/d5/d5c/test__min__printf_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d5/d5c/test__min__printf_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..84f4e13e4 --- /dev/null +++ b/d5/d5c/test__min__printf_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +d1da21e058c56d2f73b20fe0353789d8 \ No newline at end of file diff --git a/d5/d5c/test__min__printf_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d5/d5c/test__min__printf_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..c53b2bc61 --- /dev/null +++ b/d5/d5c/test__min__printf_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,148 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +min_printf + + + + + +Node1->Node2 + + + + + +Node3 + + +get_ch + + + + + +Node2->Node3 + + + + + +Node4 + + +get_width_and_precision + + + + + +Node2->Node4 + + + + + +Node7 + + +print_int_value + + + + + +Node2->Node7 + + + + + +Node8 + + +put_char + + + + + +Node2->Node8 + + + + + +Node5 + + +is_number + + + + + +Node4->Node5 + + + + + +Node6 + + +unget_ch + + + + + +Node4->Node6 + + + + + +Node7->Node8 + + + + + +Node9 + + +reverse_str + + + + + +Node7->Node9 + + + + + diff --git a/d5/d7c/problem__5_2sol3_8c.html b/d5/d7c/problem__5_2sol3_8c.html index ce6f0c9b5..574b93b7d 100644 --- a/d5/d7c/problem__5_2sol3_8c.html +++ b/d5/d7c/problem__5_2sol3_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_5/sol3.c 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,41 +92,40 @@ $(document).ready(function(){initNavTree('d5/d7c/problem__5_2sol3_8c.html','../.
-
-
sol3.c File Reference
+
sol3.c File Reference
-

Problem 5 solution (Fastest). +

Problem 5 solution (Fastest). More...

#include <stdio.h>
Include dependency graph for sol3.c:
-
+
- - + - +

+

Functions

unsigned long gcd (unsigned long a, unsigned long b)
 Compute Greatest Common Divisor (GCD) of two numbers using Euclids algorithm. More...
 Compute Greatest Common Divisor (GCD) of two numbers using Euclids algorithm. More...
 
unsigned long lcm (unsigned long a, unsigned long b)
 Compute Least Common Multiple (LCM) of two numbers. More...
 Compute Least Common Multiple (LCM) of two numbers. More...
 
int main (void)
 Main function. More...
 

Detailed Description

-

Problem 5 solution (Fastest).

-

Solution is the LCM of all numbers between 1 and 20.

+

Problem 5 solution (Fastest).

+

Solution is the LCM of all numbers between 1 and 20.

See also
Slowest: problem_5/sol1.c
Slower: problem_5/sol2.c

Function Documentation

- +

◆ gcd()

@@ -152,7 +151,7 @@ Slower: -

Compute Greatest Common Divisor (GCD) of two numbers using Euclids algorithm.

+

Compute Greatest Common Divisor (GCD) of two numbers using Euclids algorithm.

Parameters
@@ -161,25 +160,25 @@ Slower:
Returns
GCD of a and b
-
19 {
-
20  unsigned long r;
-
21  if (a > b)
-
22  {
-
23  unsigned long t = a;
-
24  a = b;
-
25  b = t;
-
26  }
-
27  while ((r = (a % b)))
-
28  {
-
29  a = b;
-
30  b = r;
-
31  }
-
32  return b;
-
33 }
+
19{
+
20 unsigned long r;
+
21 if (a > b)
+
22 {
+
23 unsigned long t = a;
+
24 a = b;
+
25 b = t;
+
26 }
+
27 while ((r = (a % b)))
+
28 {
+
29 a = b;
+
30 b = r;
+
31 }
+
32 return b;
+
33}
- +

◆ lcm()

@@ -205,7 +204,7 @@ Slower: -

Compute Least Common Multiple (LCM) of two numbers.

+

Compute Least Common Multiple (LCM) of two numbers.

Parameters
afirst number
@@ -214,21 +213,21 @@ Slower:
Returns
LCM of a and b
-
42 {
-
43  unsigned long long p = (unsigned long long)a * b;
-
44  return p / gcd(a, b);
-
45 }
+
42{
+
43 unsigned long long p = (unsigned long long)a * b;
+
44 return p / gcd(a, b);
+
45}
unsigned long gcd(unsigned long a, unsigned long b)
Compute Greatest Common Divisor (GCD) of two numbers using Euclids algorithm.
Definition: sol3.c:18
Here is the call graph for this function:
-
+
- +

◆ main()

@@ -246,21 +245,21 @@ Here is the call graph for this function:

Main function.

Returns
0 on exit
-
51 {
-
52  unsigned long ans = 1;
-
53  unsigned long i;
-
54  for (i = 1; i <= 20; i++)
-
55  {
-
56  ans = lcm(ans, i);
-
57  }
-
58  printf("%lu\n", ans);
-
59  return 0;
-
60 }
+
51{
+
52 unsigned long ans = 1;
+
53 unsigned long i;
+
54 for (i = 1; i <= 20; i++)
+
55 {
+
56 ans = lcm(ans, i);
+
57 }
+
58 printf("%lu\n", ans);
+
59 return 0;
+
60}
unsigned long lcm(unsigned long a, unsigned long b)
Compute Least Common Multiple (LCM) of two numbers.
Definition: sol3.c:41
Here is the call graph for this function:
-
+
@@ -272,7 +271,7 @@ Here is the call graph for this function:
diff --git a/d5/d7c/problem__5_2sol3_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map b/d5/d7c/problem__5_2sol3_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map index ca28a0d22..38f43ac92 100644 --- a/d5/d7c/problem__5_2sol3_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map +++ b/d5/d7c/problem__5_2sol3_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map @@ -1,5 +1,5 @@ - + diff --git a/d5/d7c/problem__5_2sol3_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg b/d5/d7c/problem__5_2sol3_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg index 166051934..9a407b9d2 100644 --- a/d5/d7c/problem__5_2sol3_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg +++ b/d5/d7c/problem__5_2sol3_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg @@ -1,14 +1,14 @@ - - + main - + Node1 @@ -37,16 +37,16 @@ Node3 - -gcd + +gcd Node2->Node3 - - + + diff --git a/d5/d7c/problem__5_2sol3_8c_ae9606f1867e9921867d6572f51377b4c_cgraph.map b/d5/d7c/problem__5_2sol3_8c_ae9606f1867e9921867d6572f51377b4c_cgraph.map index 27dfe0ef9..e3475f4d3 100644 --- a/d5/d7c/problem__5_2sol3_8c_ae9606f1867e9921867d6572f51377b4c_cgraph.map +++ b/d5/d7c/problem__5_2sol3_8c_ae9606f1867e9921867d6572f51377b4c_cgraph.map @@ -1,4 +1,4 @@ - + diff --git a/d5/d7c/problem__5_2sol3_8c_ae9606f1867e9921867d6572f51377b4c_cgraph.svg b/d5/d7c/problem__5_2sol3_8c_ae9606f1867e9921867d6572f51377b4c_cgraph.svg index b9b74deb5..979a6a18c 100644 --- a/d5/d7c/problem__5_2sol3_8c_ae9606f1867e9921867d6572f51377b4c_cgraph.svg +++ b/d5/d7c/problem__5_2sol3_8c_ae9606f1867e9921867d6572f51377b4c_cgraph.svg @@ -1,14 +1,14 @@ - - + lcm - + Node1 @@ -22,16 +22,16 @@ Node2 - -gcd + +gcd Node1->Node2 - - + + diff --git a/d5/d7e/struct_t.html b/d5/d7e/struct_t.html index 6cc9aca31..d5666c35b 100644 --- a/d5/d7e/struct_t.html +++ b/d5/d7e/struct_t.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: T Struct Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@
@@ -42,21 +41,22 @@
afirst 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() {
@@ -92,8 +92,7 @@ $(document).ready(function(){initNavTree('d5/d7e/struct_t.html','../../'); initR
-
-
T Struct Reference
+
T Struct Reference
@@ -103,12 +102,12 @@ Collaboration diagram for T:
[legend]
- - -

+

Data Fields

+
int count
 
+
elem_t * head
 
@@ -121,7 +120,7 @@ int count diff --git a/d5/d7e/struct_t.js b/d5/d7e/struct_t.js deleted file mode 100644 index c10d80984..000000000 --- a/d5/d7e/struct_t.js +++ /dev/null @@ -1,5 +0,0 @@ -var struct_t = -[ - [ "count", "d5/d7e/struct_t.html#a2023d2bb6a6cdf472b567b3ec5cf35d4", null ], - [ "head", "d5/d7e/struct_t.html#a5a06d4022d41bad87137ba3430abce8b", null ] -]; \ No newline at end of file diff --git a/d5/d88/md__d_i_r_e_c_t_o_r_y.html b/d5/d88/md__d_i_r_e_c_t_o_r_y.html index 5f546b15e..043134f09 100644 --- a/d5/d88/md__d_i_r_e_c_t_o_r_y.html +++ b/d5/d88/md__d_i_r_e_c_t_o_r_y.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: List of all files @@ -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,523 +89,547 @@ $(document).ready(function(){initNavTree('d5/d88/md__d_i_r_e_c_t_o_r_y.html','.. -
-
-
List of all files
+
+
List of all files

-Client Server

+Audio

-Conversions

+Client Server

+Conversions

+ +

Data Structures

-

+

Developer Tools

-

+

Exercism

-

+

Games

-

-Geometry

-

-Graphics

+Geometry

-Greedy Approach

+Graphics

-Hash

+Greedy Approach

+Hash

+ +

Leetcode

-

+

Machine Learning

-

-Misc

-

-Numerical Methods

+Misc

+Numerical Methods

+ +

Project Euler

-

-Searching

-

+Searching

+ +

Sorting

@@ -613,7 +637,7 @@ Sorting diff --git a/d5/da1/structnode.html b/d5/da1/structnode.html index 216ae500f..cc796d1b2 100644 --- a/d5/da1/structnode.html +++ b/d5/da1/structnode.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: 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() {
@@ -92,73 +92,75 @@ $(document).ready(function(){initNavTree('d5/da1/structnode.html','../../'); ini
-
-
node Struct Reference
+
node Struct Reference

Node, the basic data structure in the tree. More...

+ +

#include <include.h>

Collaboration diagram for node:
-
+
[legend]
- - + - + - + - - - - - - - - - - -

+

Data Fields

-struct node * left
+struct node * left
 left child
 
-struct node * right
+struct node * right
 right child
 
-int data
+int data
 data of the node
 
+
struct node * leftNode
 
+
struct node * rightNode
 
+
int val
 
+
struct node * par
 
+
int color
 
+
int vertex
 
+
struct node * next
 
+
int info
 
+
struct node * link
 
+
struct node * pre
 
+
char data
 

Detailed Description

-

Node, the basic data structure in the tree.

-

Kyler Smith, 2017 Stack data structure implementation.

-

Defining the structure of the node which contains 'data' (type : integer), two pointers 'next' and 'pre' (type : struct node).

-

creating a stucture with 'data'(type:int), two pointers 'next','pre' (type: struct node) .

+

Node, the basic data structure in the tree.

+

Kyler Smith, 2017 Stack data structure implementation.

+

INCLUDES.

+

Defining the structure of the node which contains 'data' (type : integer), two pointers 'next' and 'pre' (type : struct node).

+

creating a stucture with 'data'(type:int), two pointers 'next','pre' (type: struct node) .


The documentation for this struct was generated from the following files:
  • data_structures/binary_trees/binary_search_tree.c
  • data_structures/binary_trees/create_node.c
  • @@ -174,8 +176,9 @@ char data
  • data_structures/linked_list/queue_linked_list.c
  • data_structures/linked_list/singly_link_list_deletion.c
  • data_structures/linked_list/stack_using_linked_lists.c
  • -
  • data_structures/stack/parenthesis.c
  • +
  • data_structures/queue/include.h
  • data_structures/stack.c
  • +
  • data_structures/stack/parenthesis.c
@@ -183,7 +186,7 @@ char data diff --git a/d5/da1/structnode.js b/d5/da1/structnode.js index 15b81d420..c1e45d155 100644 --- a/d5/da1/structnode.js +++ b/d5/da1/structnode.js @@ -1,17 +1,6 @@ var structnode = [ - [ "color", "d5/da1/structnode.html#a310a09cb5a882788781a5287096ad425", null ], [ "data", "d5/da1/structnode.html#a2d890bb9f6af0ffd73fe79b21124c2a2", null ], - [ "data", "d5/da1/structnode.html#a6f9100a3fe81d82776ce47ecdba94691", null ], - [ "info", "d5/da1/structnode.html#ac8973feda870a119ccdc25910254db0c", null ], [ "left", "d5/da1/structnode.html#af7109e6ffd82cbbb705e486fd0ce92f0", null ], - [ "leftNode", "d5/da1/structnode.html#a2783f1aec750191646305988f7e28756", null ], - [ "link", "d5/da1/structnode.html#a1aa632fdf50713d86192a96f8191851b", null ], - [ "next", "d5/da1/structnode.html#a111a569ab2765add9b91c9f94cf9f063", null ], - [ "par", "d5/da1/structnode.html#a8139af7faac30d394e198365a999b54d", null ], - [ "pre", "d5/da1/structnode.html#a7f5750a90eac14a9a21d5b976cd8b8a7", null ], - [ "right", "d5/da1/structnode.html#a51e160f22dc6064bac4a4f9f1d931c2c", null ], - [ "rightNode", "d5/da1/structnode.html#aaf2ec5ed1bb563465cbe2e9d16d74d1e", null ], - [ "val", "d5/da1/structnode.html#a707bf3f1eeeaf8974e7e8e90f7bfd6a1", null ], - [ "vertex", "d5/da1/structnode.html#ab4b1f345158daee0725acecd5ba817b1", null ] + [ "right", "d5/da1/structnode.html#a51e160f22dc6064bac4a4f9f1d931c2c", null ] ]; \ No newline at end of file diff --git a/d5/db4/struct_edge.html b/d5/db4/struct_edge.html index 697f1d5f7..f8e03a167 100644 --- a/d5/db4/struct_edge.html +++ b/d5/db4/struct_edge.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Edge 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() {
@@ -92,29 +92,28 @@ $(document).ready(function(){initNavTree('d5/db4/struct_edge.html','../../'); in
-
-
Edge Struct Reference
+
Edge Struct Reference
- - - - - - -

+

Data Fields

+
int src
 
+
int dst
 
+
int weight
 
+
Vertex v
 
+
Vertex w
 
+
int dest
 
@@ -129,7 +128,7 @@ int dest diff --git a/d5/db4/struct_edge.js b/d5/db4/struct_edge.js deleted file mode 100644 index 6d9caae67..000000000 --- a/d5/db4/struct_edge.js +++ /dev/null @@ -1,9 +0,0 @@ -var struct_edge = -[ - [ "dest", "d5/db4/struct_edge.html#ad7df434ff7710e69f28bb31e91a35f82", null ], - [ "dst", "d5/db4/struct_edge.html#a2449478938136b5ab7ef0e7d92e6990b", null ], - [ "src", "d5/db4/struct_edge.html#a9a415f211c059647d1b3af8fcf7a0e30", null ], - [ "v", "d5/db4/struct_edge.html#ae746ca841799f776a8add4d6fdfc19e9", null ], - [ "w", "d5/db4/struct_edge.html#a0c7bb90b11b1b795c665786317ca744d", null ], - [ "weight", "d5/db4/struct_edge.html#a4d58e1f4de38fa55549497175981ebab", null ] -]; \ No newline at end of file diff --git a/d5/db4/structvec__3d__.html b/d5/db4/structvec__3d__.html index 34f4be074..7e9e8c98a 100644 --- a/d5/db4/structvec__3d__.html +++ b/d5/db4/structvec__3d__.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: vec_3d_ 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() {
@@ -92,8 +92,7 @@ $(document).ready(function(){initNavTree('d5/db4/structvec__3d__.html','../../')
@@ -102,23 +101,23 @@ $(document).ready(function(){initNavTree('d5/db4/structvec__3d__.html','../../')

#include <geometry_datatypes.h>

- - + - + - +

+

Data Fields

-float x
+float x
 X co-ordinate.
 
-float y
+float y
 Y co-ordinate.
 
-float z
+float z
 Z co-ordinate.
 

Detailed Description

-

3D vector type

+

3D vector type


The documentation for this struct was generated from the following file: @@ -128,7 +127,7 @@ float 
    - +
diff --git a/d5/db6/hash__crc32_8c__incl.map b/d5/db6/hash__crc32_8c__incl.map index 133ad56c9..abb9a386d 100644 --- a/d5/db6/hash__crc32_8c__incl.map +++ b/d5/db6/hash__crc32_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/d5/db6/hash__crc32_8c__incl.svg b/d5/db6/hash__crc32_8c__incl.svg index ca5ca4e91..3aeb54505 100644 --- a/d5/db6/hash__crc32_8c__incl.svg +++ b/d5/db6/hash__crc32_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - + hash/hash_crc32.c diff --git a/d5/db8/vectors__3d_8c.html b/d5/db8/vectors__3d_8c.html index 523a459bd..6d753703c 100644 --- a/d5/db8/vectors__3d_8c.html +++ b/d5/db8/vectors__3d_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: geometry/vectors_3d.c 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('d5/db8/vectors__3d_8c.html','../../');
-
-
vectors_3d.c File Reference
+
vectors_3d.c File Reference
@@ -106,11 +105,11 @@ $(document).ready(function(){initNavTree('d5/db8/vectors__3d_8c.html','../../');
Include dependency graph for vectors_3d.c:
-
+
- @@ -124,9 +123,9 @@ Functions - - - + + + @@ -136,6 +135,9 @@ Functions + + + @@ -144,10 +146,10 @@ Functions

+

Functions

vec_3d vector_sub (const vec_3d *a, const vec_3d *b)
 Subtract one vector from another. More...
vec_3d vector_prod (const vec_3d *a, const vec_3d *b)
 Compute the vector product of two 3d vectors. More...
 
const char * print_vector (const vec_3d *a, const char *name)
 Print formatted vector on stdout. More...
 
const char * print_vector (const vec_3d *a, const char *name)
 Print formatted vector on stdout. More...
 
float vector_norm (const vec_3d *a)
 Compute the norm a vector. More...
 
mat_3x3 get_cross_matrix (const vec_3d *a)
 The cross product of vectors can be represented as a matrix multiplication operation. More...
 
double get_angle (const vec_3d *a, const vec_3d *b)
 Obtain the angle between two given vectors. More...
 
static void test ()
 Testing function. More...
 
 

Detailed Description

-

Functions related to 3D vector operations.

+

Functions related to 3D vector operations.

Author
Krishna Vedala

Function Documentation

- +

◆ main()

@@ -165,22 +167,22 @@ Functions

Main function.

Returns
0 on exit
-
234 {
-
235  test();
-
236 
-
237  return 0;
-
238 }
-
static void test()
Testing function.
Definition: vectors_3d.c:200
+
261{
+
262 test();
+
263
+
264 return 0;
+
265}
+
static void test()
Testing function.
Definition: vectors_3d.c:223
Here is the call graph for this function:
-
+
- +

◆ test()

@@ -206,40 +208,45 @@ Here is the call graph for this function:

Testing function.

Returns
void
-
201 {
-
202  vec_3d a = {1., 2., 3.};
-
203  vec_3d b = {1., 1., 1.};
-
204  float d;
-
205 
-
206  // printf("%s", print_vector(&a, "a"));
-
207  // printf("%s", print_vector(&b, "b"));
-
208 
-
209  d = vector_norm(&a);
-
210  // printf("|a| = %.4g\n", d);
-
211  assert(fabsf(d - 3.742f) < 0.01);
-
212  d = vector_norm(&b);
-
213  // printf("|b| = %.4g\n", d);
-
214  assert(fabsf(d - 1.732f) < 0.01);
-
215 
-
216  d = dot_prod(&a, &b);
-
217  // printf("Dot product: %f\n", d);
-
218  assert(fabsf(d - 6.f) < 0.01);
-
219 
-
220  vec_3d c = vector_prod(&a, &b);
-
221  // printf("Vector product ");
-
222  // printf("%s", print_vector(&c, "c"));
-
223  assert(fabsf(c.x - (-1.f)) < 0.01);
-
224  assert(fabsf(c.y - (2.f)) < 0.01);
-
225  assert(fabsf(c.z - (-1.f)) < 0.01);
-
226 }
+
224{
+
225 vec_3d a = {1., 2., 3.};
+
226 vec_3d b = {1., 1., 1.};
+
227 float d;
+
228
+
229 // printf("%s", print_vector(&a, "a"));
+
230 // printf("%s", print_vector(&b, "b"));
+
231
+
232 d = vector_norm(&a);
+
233 // printf("|a| = %.4g\n", d);
+
234 assert(fabsf(d - 3.742f) < 0.01);
+
235 d = vector_norm(&b);
+
236 // printf("|b| = %.4g\n", d);
+
237 assert(fabsf(d - 1.732f) < 0.01);
+
238
+
239 d = dot_prod(&a, &b);
+
240 // printf("Dot product: %f\n", d);
+
241 assert(fabsf(d - 6.f) < 0.01);
+
242
+
243 vec_3d c = vector_prod(&a, &b);
+
244 // printf("Vector product ");
+
245 // printf("%s", print_vector(&c, "c"));
+
246 assert(fabsf(c.x - (-1.f)) < 0.01);
+
247 assert(fabsf(c.y - (2.f)) < 0.01);
+
248 assert(fabsf(c.z - (-1.f)) < 0.01);
+
249
+
250 double alpha = get_angle(&a, &b);
+
251 // printf("The angle is %f\n", alpha);
+
252 assert(fabsf(alpha - 0.387597) < 0.01);
+
253}
float dot_prod(const vec_3d *a, const vec_3d *b)
Obtain the dot product of two 3D vectors.
Definition: vectors_3d.c:76
+
double get_angle(const vec_3d *a, const vec_3d *b)
Obtain the angle between two given vectors.
Definition: vectors_3d.c:202
float vector_norm(const vec_3d *a)
Compute the norm a vector.
Definition: vectors_3d.c:138
vec_3d vector_prod(const vec_3d *a, const vec_3d *b)
Compute the vector product of two 3d vectors.
Definition: vectors_3d.c:105
3D vector type
Definition: geometry_datatypes.h:22
Here is the call graph for this function:
-
+
@@ -251,7 +258,7 @@ Here is the call graph for this function:
diff --git a/d5/db8/vectors__3d_8c.js b/d5/db8/vectors__3d_8c.js index 7b26f9b66..aa5538bf7 100644 --- a/d5/db8/vectors__3d_8c.js +++ b/d5/db8/vectors__3d_8c.js @@ -1,9 +1,10 @@ var vectors__3d_8c = [ [ "dot_prod", "de/d7b/group__vec__3d.html#ga243e74d542d0d4d14fa3ae0bc2170d84", null ], + [ "get_angle", "de/d7b/group__vec__3d.html#ga55be1d766c8a824b35d97e79744834d8", null ], [ "get_cross_matrix", "de/d7b/group__vec__3d.html#ga5082b0720c2cc51ae84bf19bd76dc849", null ], [ "main", "d5/db8/vectors__3d_8c.html#a840291bc02cba5474a4cb46a9b9566fe", null ], - [ "print_vector", "de/d7b/group__vec__3d.html#ga4fd194972bea4884e0b33cf4a166d14e", null ], + [ "print_vector", "de/d7b/group__vec__3d.html#gae25e1f2e973933bef65838601e2de0af", null ], [ "test", "d5/db8/vectors__3d_8c.html#aa8dca7b867074164d5f45b0f3851269d", null ], [ "unit_vec", "de/d7b/group__vec__3d.html#ga3cdfd8378a0b115563ea6c561bb46b7e", null ], [ "vector_add", "de/d7b/group__vec__3d.html#gaa6b5ac18429ffb0131dc8593d31c25a4", null ], diff --git a/d5/db8/vectors__3d_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map b/d5/db8/vectors__3d_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map index adbfbdccb..5ca624d80 100644 --- a/d5/db8/vectors__3d_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map +++ b/d5/db8/vectors__3d_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map @@ -1,7 +1,8 @@ - - - - - + + + + + + diff --git a/d5/db8/vectors__3d_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.md5 b/d5/db8/vectors__3d_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.md5 index ae75ec68c..bc6081a14 100644 --- a/d5/db8/vectors__3d_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.md5 +++ b/d5/db8/vectors__3d_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.md5 @@ -1 +1 @@ -1b7dad3bad4344d07246e1e1ebbf905d \ No newline at end of file +72427e2769fccc86483c278b2333c545 \ No newline at end of file diff --git a/d5/db8/vectors__3d_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg b/d5/db8/vectors__3d_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg index d5d3422f4..0975b6796 100644 --- a/d5/db8/vectors__3d_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg +++ b/d5/db8/vectors__3d_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg @@ -1,20 +1,20 @@ - - - + + main - + Node1 - -main + +main @@ -22,67 +22,94 @@ Node2 - -test + +test Node1->Node2 - - + + Node3 - -dot_prod + +dot_prod Node2->Node3 - - + + Node4 - - -vector_norm + + +get_angle Node2->Node4 - - + + Node5 - - -vector_prod + + +vector_norm - + Node2->Node5 - - + + + + + +Node6 + + +vector_prod + + + + + +Node2->Node6 + + Node4->Node3 - - + + + + + +Node4->Node5 + + + + + +Node5->Node3 + + diff --git a/d5/db8/vectors__3d_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map b/d5/db8/vectors__3d_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map index a29d365dc..34a360bfb 100644 --- a/d5/db8/vectors__3d_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map +++ b/d5/db8/vectors__3d_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map @@ -1,6 +1,7 @@ - - - - + + + + + diff --git a/d5/db8/vectors__3d_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 b/d5/db8/vectors__3d_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 index af30319d6..53b2a9e11 100644 --- a/d5/db8/vectors__3d_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 +++ b/d5/db8/vectors__3d_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 @@ -1 +1 @@ -145076117f6a5e9c068d6956e5703872 \ No newline at end of file +25304dee98c155d25edc987206c4b592 \ No newline at end of file diff --git a/d5/db8/vectors__3d_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/d5/db8/vectors__3d_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg index eb04eeed1..beda1f330 100644 --- a/d5/db8/vectors__3d_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg +++ b/d5/db8/vectors__3d_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg @@ -1,20 +1,20 @@ - - - + + test - + Node1 - -test + +test @@ -22,52 +22,79 @@ Node2 - -dot_prod + +dot_prod Node1->Node2 - - + + Node3 - - -vector_norm + + +get_angle Node1->Node3 - - + + Node4 - - -vector_prod + + +vector_norm - + Node1->Node4 - - + + + + + +Node5 + + +vector_prod + + + + + +Node1->Node5 + + Node3->Node2 - - + + + + + +Node3->Node4 + + + + + +Node4->Node2 + + diff --git a/d5/dc5/test__min__printf_8c__incl.map b/d5/dc5/test__min__printf_8c__incl.map new file mode 100644 index 000000000..1655e2f4e --- /dev/null +++ b/d5/dc5/test__min__printf_8c__incl.map @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/d5/dc5/test__min__printf_8c__incl.md5 b/d5/dc5/test__min__printf_8c__incl.md5 new file mode 100644 index 000000000..8f8b29fdd --- /dev/null +++ b/d5/dc5/test__min__printf_8c__incl.md5 @@ -0,0 +1 @@ +6eafb7053d2aa8e4910f5e6f0026f905 \ No newline at end of file diff --git a/d5/dc5/test__min__printf_8c__incl.svg b/d5/dc5/test__min__printf_8c__incl.svg new file mode 100644 index 000000000..bad9cc336 --- /dev/null +++ b/d5/dc5/test__min__printf_8c__incl.svg @@ -0,0 +1,98 @@ + + + + + + +developer_tools/test_min_printf.c + + + +Node1 + + +developer_tools/test +_min_printf.c + + + + + +Node2 + + +min_printf.h + + + + + +Node1->Node2 + + + + + +Node6 + + +stdio.h + + + + + +Node1->Node6 + + + + + +Node3 + + +stdlib.h + + + + + +Node2->Node3 + + + + + +Node4 + + +unistd.h + + + + + +Node2->Node4 + + + + + +Node5 + + +stdarg.h + + + + + +Node2->Node5 + + + + + diff --git a/d5/ddd/octal__to__hexadecimal_8c__incl.map b/d5/ddd/octal__to__hexadecimal_8c__incl.map index 61454ff94..5834c4ce5 100644 --- a/d5/ddd/octal__to__hexadecimal_8c__incl.map +++ b/d5/ddd/octal__to__hexadecimal_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/d5/ddd/octal__to__hexadecimal_8c__incl.svg b/d5/ddd/octal__to__hexadecimal_8c__incl.svg index 28ab3b175..a3f7e8dcb 100644 --- a/d5/ddd/octal__to__hexadecimal_8c__incl.svg +++ b/d5/ddd/octal__to__hexadecimal_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - -conversions/octal_to + +conversions/octal_to _hexadecimal.c diff --git a/d5/de2/sentinel__linear__search_8c.html b/d5/de2/sentinel__linear__search_8c.html new file mode 100644 index 000000000..d97c96138 --- /dev/null +++ b/d5/de2/sentinel__linear__search_8c.html @@ -0,0 +1,281 @@ + + + + + + + +Algorithms_in_C: searching/sentinel_linear_search.c File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Algorithms_in_C 1.0.0 +
+
Set of algorithms implemented in C.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
sentinel_linear_search.c File Reference
+
+
+ +

Linear Search with Sentinel algorithm implementation +More...

+
#include <stdio.h>
+#include <assert.h>
+
+Include dependency graph for sentinel_linear_search.c:
+
+
+
+
+
+ + + + + + + + + + +

+Functions

int sentinel_linear_search (int arr[], int len, int key)
 for IO operations More...
 
static void test ()
 Self-test implementations. More...
 
int main ()
 Main function. More...
 
+

Detailed Description

+

Linear Search with Sentinel algorithm implementation

+

This algorithm saves the last element of the array, then replaces it with the value to be found and sets it as the sentinel. When searching, compares each element with the sentinel. If the same, returns the index. If the index is the index of the sentinel, it means it was not found. Of course, if the value to be found is the last element, we return the index of the last element.

Author
Regan Yue Time Complexity: O(N)
+

Function Documentation

+ +

◆ main()

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

Main function.

+
Returns
0 on exit
+
76 {
+
77 test(); // run self-test implementations
+
78 return 0;
+
79}
+
static void test()
Self-test implementations.
Definition: sentinel_linear_search.c:59
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ sentinel_linear_search()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int sentinel_linear_search (int arr[],
int len,
int key 
)
+
+ +

for IO operations

+

for assert

+

Utility function to search for an element in the array and return the index of the element

+

The so-called "sentinel" is to use a special value as the boundary key of the array. One less judgment statement can be used. The purpose is to avoid checking whether the entire array is searched at each step in the search process, so as to improve the efficiency of the program. We can use the last value of the array as the "sentinel", the data storage index i starts from 0 and ends at len-1, then the position where the index of arr is n-1 indicates that there is no data temporarily, which is the "sentinel" key. If the last element of the array is equal to the key, directly return the index of the last element. Before setting the last element of the array as the key, we hand over the last element of the array to temp for temporary storage. Then go to the array to find the key. If the key is found, stop the search, and then compare the found element index with len-1. If it is equal, it means it was not found. If it is not equal, it is found.

Parameters
+ + + + +
arrthis is an array containing elements
lenthis is the number of elements in the array
keythe value we want to search
+
+
+
Returns
i if found, otherwise -1 is returned.
+
36 {
+
37 if(key == arr[len-1]){
+
38 return len-1;
+
39 }
+
40
+
41 int temp = arr[len-1];
+
42 arr[len-1] = key;
+
43
+
44 int i = 0;
+
45 while (arr[len-1] != arr[i]) {
+
46 i++;
+
47 }
+
48
+
49 arr[len-1] = temp;
+
50
+
51 return i != len-1 ? i : -1;
+
52
+
53}
+
+
+
+ +

◆ test()

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

Self-test implementations.

+
Returns
void
+
59 {
+
60 int n,i;
+
61 n = 5;
+
62 /* init array */
+
63 int arr[] = { 1, 2, 2, 6, 99, 100, 999 };
+
64
+
65 assert(sentinel_linear_search( arr, n, 1 )==0);
+
66 assert(sentinel_linear_search( arr, n, 2 )==1);
+
67 assert(sentinel_linear_search( arr, n, 6 )==3);
+
68 assert(sentinel_linear_search( arr, n, 101 )==-1);
+
69 printf("All test cases have successfully passed!\n");
+
70}
+
int sentinel_linear_search(int arr[], int len, int key)
for IO operations
Definition: sentinel_linear_search.c:36
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+
+
+ + + + diff --git a/d5/de2/sentinel__linear__search_8c.js b/d5/de2/sentinel__linear__search_8c.js new file mode 100644 index 000000000..062e64d8f --- /dev/null +++ b/d5/de2/sentinel__linear__search_8c.js @@ -0,0 +1,6 @@ +var sentinel__linear__search_8c = +[ + [ "main", "d5/de2/sentinel__linear__search_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], + [ "sentinel_linear_search", "d5/de2/sentinel__linear__search_8c.html#a16a7a1ef83db52643fe23d48280065ce", null ], + [ "test", "d5/de2/sentinel__linear__search_8c.html#aa8dca7b867074164d5f45b0f3851269d", null ] +]; \ No newline at end of file diff --git a/d5/de2/sentinel__linear__search_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map b/d5/de2/sentinel__linear__search_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map new file mode 100644 index 000000000..13d4dd7f3 --- /dev/null +++ b/d5/de2/sentinel__linear__search_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/d5/de2/sentinel__linear__search_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 b/d5/de2/sentinel__linear__search_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 new file mode 100644 index 000000000..2e307170d --- /dev/null +++ b/d5/de2/sentinel__linear__search_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 @@ -0,0 +1 @@ +9e49beb45e173cd528cc0572da41bf35 \ No newline at end of file diff --git a/d5/de2/sentinel__linear__search_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/d5/de2/sentinel__linear__search_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg new file mode 100644 index 000000000..fab732de0 --- /dev/null +++ b/d5/de2/sentinel__linear__search_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg @@ -0,0 +1,37 @@ + + + + + + +test + + + +Node1 + + +test + + + + + +Node2 + + +sentinel_linear_search + + + + + +Node1->Node2 + + + + + diff --git a/d5/de2/sentinel__linear__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d5/de2/sentinel__linear__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..21e783cc9 --- /dev/null +++ b/d5/de2/sentinel__linear__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/d5/de2/sentinel__linear__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d5/de2/sentinel__linear__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..f9812b981 --- /dev/null +++ b/d5/de2/sentinel__linear__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +6ba555ca49622ce58b203a8dea51a165 \ No newline at end of file diff --git a/d5/de2/sentinel__linear__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d5/de2/sentinel__linear__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..e21d5ebcd --- /dev/null +++ b/d5/de2/sentinel__linear__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,52 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +test + + + + + +Node1->Node2 + + + + + +Node3 + + +sentinel_linear_search + + + + + +Node2->Node3 + + + + + diff --git a/d5/df1/k__means__clustering_8c__incl.map b/d5/df1/k__means__clustering_8c__incl.map index 9c3199958..b2070f4fb 100644 --- a/d5/df1/k__means__clustering_8c__incl.map +++ b/d5/df1/k__means__clustering_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/d5/df1/k__means__clustering_8c__incl.svg b/d5/df1/k__means__clustering_8c__incl.svg index 727909a88..f191b79c7 100644 --- a/d5/df1/k__means__clustering_8c__incl.svg +++ b/d5/df1/k__means__clustering_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - -machine_learning/k + +machine_learning/k _means_clustering.c diff --git a/d5/df4/group__sudoku.html b/d5/df4/group__sudoku.html index 70e5d0696..9d4c1a685 100644 --- a/d5/df4/group__sudoku.html +++ b/d5/df4/group__sudoku.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Sudoku solver @@ -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,18 +93,17 @@ $(document).ready(function(){initNavTree('d5/df4/group__sudoku.html','../../'); -
-
Sudoku solver
+
Sudoku solver
-

+

Data Structures

struct  sudoku
 Structure to hold the matrix and dimensions. More...
 
- @@ -130,7 +129,7 @@ Functions

+

Functions

bool OKrow (const struct sudoku *a, int x, int y, int v)
 Check if x^th row is valid. More...

Detailed Description

Function Documentation

- +

◆ get_next_unknown()

@@ -174,27 +173,27 @@ Functions
Returns
true if an empty location was found
false if no more empty locations found
-
145 {
-
146  for (int i = 0; i < a->N; i++)
-
147  {
-
148  for (int j = 0; j < a->N; j++)
-
149  {
-
150  if (a->a[i * a->N + j] == 0)
-
151  {
-
152  *x = i;
-
153  *y = j;
-
154  return true;
-
155  }
-
156  }
-
157  }
-
158 
-
159  /* no unknown locations found */
-
160  return false;
-
161 }
+
145{
+
146 for (int i = 0; i < a->N; i++)
+
147 {
+
148 for (int j = 0; j < a->N; j++)
+
149 {
+
150 if (a->a[i * a->N + j] == 0)
+
151 {
+
152 *x = i;
+
153 *y = j;
+
154 return true;
+
155 }
+
156 }
+
157 }
+
158
+
159 /* no unknown locations found */
+
160 return false;
+
161}
- +

◆ OK()

@@ -245,15 +244,15 @@ Functions
Returns
true if valid
false if in-valid
-
112 {
-
113  bool result = OKrow(a, x, y, v);
-
114  if (result)
-
115  result = OKcol(a, x, y, v);
-
116  if (result)
-
117  result = OKbox(a, x, y, v);
-
118 
-
119  return result;
-
120 }
+
112{
+
113 bool result = OKrow(a, x, y, v);
+
114 if (result)
+
115 result = OKcol(a, x, y, v);
+
116 if (result)
+
117 result = OKbox(a, x, y, v);
+
118
+
119 return result;
+
120}
bool OKbox(const struct sudoku *a, int x, int y, int v)
Check if a 3x3 box is valid.
Definition: sudoku_solver.c:85
bool OKcol(const struct sudoku *a, int x, int y, int v)
Check if y^th column is valid.
Definition: sudoku_solver.c:67
bool OKrow(const struct sudoku *a, int x, int y, int v)
Check if x^th row is valid.
Definition: sudoku_solver.c:48
@@ -266,7 +265,7 @@ Here is the call graph for this function:
- +

◆ OKbox()

@@ -317,25 +316,25 @@ Here is the call graph for this function:
Returns
true if valid
false if in-valid
-
86 {
-
87  /* get start indices of the box that the current (x,y) lies in
-
88  remember that in C/C++, division operation always rounds towards
-
89  -infinity for signed integers and towards 0 for unsigned integers
-
90  */
-
91  int bi = x - x % a->N2, bj = y - y % a->N2;
-
92  // printf("Checking box: (%d,%d)\n", bi, bj);
-
93 
-
94  for (int i = bi; i < (bi + a->N2); i++)
-
95  for (int j = bj; j < (bj + a->N2); j++)
-
96  if (a->a[i * a->N + j] == v)
-
97  // if the value is found in the box
-
98  return false;
-
99  return true;
-
100 }
+
86{
+
87 /* get start indices of the box that the current (x,y) lies in
+
88 remember that in C/C++, division operation always rounds towards
+
89 -infinity for signed integers and towards 0 for unsigned integers
+
90 */
+
91 int bi = x - x % a->N2, bj = y - y % a->N2;
+
92 // printf("Checking box: (%d,%d)\n", bi, bj);
+
93
+
94 for (int i = bi; i < (bi + a->N2); i++)
+
95 for (int j = bj; j < (bj + a->N2); j++)
+
96 if (a->a[i * a->N + j] == v)
+
97 // if the value is found in the box
+
98 return false;
+
99 return true;
+
100}
- +

◆ OKcol()

@@ -386,17 +385,17 @@ Here is the call graph for this function:
Returns
true if valid
false if in-valid
-
68 {
-
69  for (int i = 0; i < a->N; i++)
-
70  if (a->a[i * a->N + y] == v)
-
71  // if the value is found in the column
-
72  return false;
-
73  return true;
-
74 }
+
68{
+
69 for (int i = 0; i < a->N; i++)
+
70 if (a->a[i * a->N + y] == v)
+
71 // if the value is found in the column
+
72 return false;
+
73 return true;
+
74}
- +

◆ OKrow()

@@ -447,18 +446,18 @@ Here is the call graph for this function:
Returns
true if valid
false if in-valid
-
49 {
-
50  int offset = x * a->N;
-
51  for (int j = 0; j < a->N; j++)
-
52  if (a->a[offset + j] == v)
-
53  // if the value is found in the row
-
54  return false;
-
55  return true;
-
56 }
+
49{
+
50 int offset = x * a->N;
+
51 for (int j = 0; j < a->N; j++)
+
52 if (a->a[offset + j] == v)
+
53 // if the value is found in the row
+
54 return false;
+
55 return true;
+
56}
- +

◆ print()

@@ -481,17 +480,17 @@ Here is the call graph for this function:
-
127 {
-
128  int i, j;
-
129  for (i = 0; i < a->N; i++)
-
130  for (j = 0; j < a->N; j++)
-
131  printf("%" SCNu8 "%c", a->a[i * a->N + j],
-
132  (j == a->N - 1 ? '\n' : ' '));
-
133 }
+
127{
+
128 int i, j;
+
129 for (i = 0; i < a->N; i++)
+
130 for (j = 0; j < a->N; j++)
+
131 printf("%" SCNu8 "%c", a->a[i * a->N + j],
+
132 (j == a->N - 1 ? '\n' : ' '));
+
133}
- +

◆ solve()

@@ -508,7 +507,7 @@ Here is the call graph for this function:

Function to solve a partially filled sudoku matrix.

-

For each unknown value (0), the function fills a possible value and calls the function again to check forvalid solution.

+

For each unknown value (0), the function fills a possible value and calls the function again to check forvalid solution.

Parameters
@@ -518,58 +517,58 @@ Here is the call graph for this function:
Returns
true if solution found
false if no solution found
-
173 {
-
174  static uint32_t counter = 0;
-
175  int i, j;
-
176  static char prefix[100] = ""; // enough memory
-
177 
-
178  if (!get_next_unknown(a, &i, &j))
-
179  {
-
180  /* no more empty location found
-
181  implies all good in the matrix
-
182  */
-
183  return true;
-
184  }
-
185 
-
186  /* try all possible values for the unknown */
-
187  for (uint8_t v = 1; v <= a->N; v++)
-
188  { /* try all possible values 1 thru N */
-
189  printf("%sTry (%d,%d) = %" SCNu8 "... ", prefix, i, j, v);
-
190  counter++;
-
191  if (OK(a, i, j, v))
-
192  {
-
193  /* if assignment checks satisfy, set the value and
-
194  continue with remaining elements */
-
195  printf("passed (counter=%" SCNu32 ")\n", counter);
-
196  a->a[i * a->N + j] = v;
-
197  strcat(prefix, " ");
-
198  if (solve(a))
-
199  {
-
200  /* solution found */
-
201  return true;
-
202  }
-
203 
-
204  printf("%sBacktrack (%d,%d) <- %" SCNu8 " (counter=%" SCNu32 ")\n",
-
205  prefix, i, j, a->a[i * a->N + j], counter);
-
206 
-
207  prefix[strlen(prefix) - 2] = '\0'; // truncate the prefix
-
208  a->a[i * a->N + j] = 0;
-
209  }
-
210  else
-
211  {
-
212  printf("\r");
-
213  }
-
214  }
-
215 
-
216  return false;
-
217 }
+
173{
+
174 static uint32_t counter = 0;
+
175 int i, j;
+
176 static char prefix[100] = ""; // enough memory
+
177
+
178 if (!get_next_unknown(a, &i, &j))
+
179 {
+
180 /* no more empty location found
+
181 implies all good in the matrix
+
182 */
+
183 return true;
+
184 }
+
185
+
186 /* try all possible values for the unknown */
+
187 for (uint8_t v = 1; v <= a->N; v++)
+
188 { /* try all possible values 1 thru N */
+
189 printf("%sTry (%d,%d) = %" SCNu8 "... ", prefix, i, j, v);
+
190 counter++;
+
191 if (OK(a, i, j, v))
+
192 {
+
193 /* if assignment checks satisfy, set the value and
+
194 continue with remaining elements */
+
195 printf("passed (counter=%" SCNu32 ")\n", counter);
+
196 a->a[i * a->N + j] = v;
+
197 strcat(prefix, " ");
+
198 if (solve(a))
+
199 {
+
200 /* solution found */
+
201 return true;
+
202 }
+
203
+
204 printf("%sBacktrack (%d,%d) <- %" SCNu8 " (counter=%" SCNu32 ")\n",
+
205 prefix, i, j, a->a[i * a->N + j], counter);
+
206
+
207 prefix[strlen(prefix) - 2] = '\0'; // truncate the prefix
+
208 a->a[i * a->N + j] = 0;
+
209 }
+
210 else
+
211 {
+
212 printf("\r");
+
213 }
+
214 }
+
215
+
216 return false;
+
217}
bool OK(const struct sudoku *a, int x, int y, int v)
Check if element v is valid to place at (x,y) location.
Definition: sudoku_solver.c:111
bool get_next_unknown(const struct sudoku *a, int *x, int *y)
Find and get the location for next empty cell.
Definition: sudoku_solver.c:144
bool solve(struct sudoku *a)
Function to solve a partially filled sudoku matrix.
Definition: sudoku_solver.c:172
Here is the call graph for this function:
-
+
@@ -580,7 +579,7 @@ Here is the call graph for this function:
diff --git a/d5/df4/group__sudoku_ga3a0ec150ac9d0cb6b28279d36d95d72f_cgraph.svg b/d5/df4/group__sudoku_ga3a0ec150ac9d0cb6b28279d36d95d72f_cgraph.svg index 779eaea96..e37a4e28c 100644 --- a/d5/df4/group__sudoku_ga3a0ec150ac9d0cb6b28279d36d95d72f_cgraph.svg +++ b/d5/df4/group__sudoku_ga3a0ec150ac9d0cb6b28279d36d95d72f_cgraph.svg @@ -1,7 +1,7 @@ - - - - - - + + + + + diff --git a/d5/df4/group__sudoku_gadfe0ed5085b4775d8fa00b434cc0fdfc_cgraph.md5 b/d5/df4/group__sudoku_gadfe0ed5085b4775d8fa00b434cc0fdfc_cgraph.md5 index 89b36486f..4ba1ed5ce 100644 --- a/d5/df4/group__sudoku_gadfe0ed5085b4775d8fa00b434cc0fdfc_cgraph.md5 +++ b/d5/df4/group__sudoku_gadfe0ed5085b4775d8fa00b434cc0fdfc_cgraph.md5 @@ -1 +1 @@ -c6225dfc668f26f302aace7b99f2791e \ No newline at end of file +94d7e4e46aea158245794739f2172b43 \ No newline at end of file diff --git a/d5/df4/group__sudoku_gadfe0ed5085b4775d8fa00b434cc0fdfc_cgraph.svg b/d5/df4/group__sudoku_gadfe0ed5085b4775d8fa00b434cc0fdfc_cgraph.svg index 64a3e7976..d5e8b7130 100644 --- a/d5/df4/group__sudoku_gadfe0ed5085b4775d8fa00b434cc0fdfc_cgraph.svg +++ b/d5/df4/group__sudoku_gadfe0ed5085b4775d8fa00b434cc0fdfc_cgraph.svg @@ -1,97 +1,103 @@ - - + solve - + Node1 - -solve + +solve + + +Node1->Node1 + + + Node2 - -get_next_unknown + +get_next_unknown Node1->Node2 - - + + Node3 - -OK + +OK Node1->Node3 - - + + Node4 - -OKbox + +OKbox Node3->Node4 - - + + Node5 - -OKcol + +OKcol Node3->Node5 - - + + Node6 - -OKrow + +OKrow Node3->Node6 - - + + diff --git a/d6/d1b/sol4_8c.html b/d6/d1b/sol4_8c.html index f436c0e7e..7edc51810 100644 --- a/d6/d1b/sol4_8c.html +++ b/d6/d1b/sol4_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_1/sol4.c File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@
@@ -42,21 +41,22 @@
[in,out]asudoku matrix to solve
-
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,38 +92,79 @@ $(document).ready(function(){initNavTree('d6/d1b/sol4_8c.html','../../'); initRe
-
-
sol4.c File Reference
+
sol4.c File Reference
-

Problem 1 solution +

Problem 1 solution More...

#include <stdio.h>
Include dependency graph for sol4.c:
-
+
- - - + +

+

Functions

-int main ()
 Main function.
int main ()
 Main function. More...
 

Detailed Description

-

Problem 1 solution

-

An Efficient code to print all the sum of all numbers that are multiples of 3 & 5 below N.

-
+

Problem 1 solution

+

An Efficient code to print all the sum of all numbers that are multiples of 3 & 5 below N.

+

Function Documentation

+ +

◆ main()

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

Main function.

+
13{
+
14 int t;
+
15 printf("Enter number of times you want to try");
+
16 scanf("%d", &t);
+
17 while (t--)
+
18 {
+
19 unsigned long long N, p = 0, sum = 0;
+
20 printf("Enter the value of N ");
+
21
+
22 scanf("%lld", &N); // Take input of N from user
+
23 for (int i = 0; i < N; i++)
+
24 {
+
25 if (i % 3 == 0 || i % 5 == 0)
+
26 {
+
27 sum = sum + i;
+
28 }
+
29 }
+
30 printf("%lld\n", sum); // print the sum of all numbers that are
+
31 // multiples of 3 & 5 below N
+
32 }
+
33 return 0;
+
34}
+
+
+
+
diff --git a/d6/d2b/tcp__half__duplex__server_8c.html b/d6/d2b/tcp__half__duplex__server_8c.html new file mode 100644 index 000000000..4da840db7 --- /dev/null +++ b/d6/d2b/tcp__half__duplex__server_8c.html @@ -0,0 +1,385 @@ + + + + + + + +Algorithms_in_C: client_server/tcp_half_duplex_server.c File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Algorithms_in_C 1.0.0 +
+
Set of algorithms implemented in C.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
tcp_half_duplex_server.c File Reference
+
+
+ +

Server-side implementation of TCP Half Duplex Communication +More...

+
#include <netdb.h>
+#include <netinet/in.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+Include dependency graph for tcp_half_duplex_server.c:
+
+
+
+
+
+ + + + +

+Macros

#define PORT   8100
 For structures returned by the network database library - formatted internet addresses and port numbers For in_addr and sockaddr_in structures. More...
 
+ + + + + + + +

+Functions

void error ()
 Utility function used to print an error message to stderr. More...
 
int main ()
 Main function. More...
 
+

Detailed Description

+

Server-side implementation of TCP Half Duplex Communication

+
Author
NVombat
+
See also
tcp_half_duplex_server.c
+

The algorithm is based on the simple TCP client and server model. However, instead of the server only sending and the client only receiving data, The server and client can both send data but only one at a time. This is implemented by using a particular ordering of the send() and recv() functions. When one of the clients or servers is sending, the other can only receive and vice-versa. In this way, the Half Duplex Form of communication can be represented using the TCP server-client model & socket programming

+

Macro Definition Documentation

+ +

◆ PORT

+ +
+
+ + + + +
#define PORT   8100
+
+ +

For structures returned by the network database library - formatted internet addresses and port numbers For in_addr and sockaddr_in structures.

+

For specific bit size values of variables Variable types, several macros, and various functions for performing input and output Variable types, several macros, and various functions for performing general functions Various functions for manipulating arrays of characters For macro definitions related to the creation of sockets For definitions to allow for the porting of BSD programs For miscellaneous symbolic constants and types, and miscellaneous functions

+ +
+
+

Function Documentation

+ +

◆ error()

+ +
+
+ + + + + + + +
void error ()
+
+ +

Utility function used to print an error message to stderr.

+

It prints str and an implementation-defined error message corresponding to the global variable errno.

Returns
void
+
37{
+
38 perror("Socket Creation Failed");
+
39 exit(EXIT_FAILURE);
+
40}
+
+
+
+ +

◆ main()

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

Main function.

+
Returns
0 on exit
+

Variable Declarations

+

< socket descriptors - Like file handles but for sockets

+

< character arrays to read and store string data for communication

+

< asic structures for all syscalls and functions that deal with internet addresses. Structures for handling internet addresses

+

The TCP socket is created using the socket function

+

AF_INET (Family) - it is an address family that is used to designate the type of addresses that your socket can communicate with

+

SOCK_STREAM (Type) - Indicates TCP Connection - A stream socket provides for the bidirectional, reliable, sequenced, and unduplicated flow of data without record boundaries. Aside from the bidirectionality of data flow, a pair of connected stream sockets provides an interface nearly identical to pipes

+

0 (Protocol) - Specifies a particular protocol to be used with the socket. Specifying a protocol of 0 causes socket() to use an unspecified default protocol appropriate for the requested socket type

+

< Error if the socket descriptor has a value lower than 0 - socket wasnt created

+

Server Address Information

+

The bzero() function erases the data in the n bytes of the memory starting at the location pointed to, by writing zeros (bytes containing '\0') to that area

+

We bind the server_addr to the internet address and port number thus giving our socket an identity with an address and port where it can listen for connections

+

htons - The htons() function translates a short integer from host byte order to network byte order

+

htonl - The htonl() function translates a long integer from host byte order to network byte order

+

These functions are necessary so that the binding of address and port takes place with data in the correct format

+

Domain/Family to be used

+

Port to be used

+

This binds the socket descriptor to the server thus enabling the server to listen for connections and communicate with other clients

+

If binding is unsuccessful

+

This is to listen for clients or connections made to the server

+

The limit is currently at 5 but can be increased to listen for more connections

+

It listens to connections through the socket descriptor

+

When a connection is found, a socket is created and connection is accepted and established through the socket descriptor

+

Communication between client and server

+

The bzero() function erases the data in the n bytes of the memory starting at the location pointed to, by writing zeros (bytes containing '\0') to that area. The variables are emptied and then ready for use

+

First the SERVER is prompted to type a message which is read from stdin and then sent over the connection that was established - the socket

    +
  • to be received by the client (send())
  • +
+

The SERVER then waits for the client to reply. It then receives the reply in the string variable and displays it (recv())

+

The server and client can communicate till one of them exits the connection

+

Since the exchange of information between the server and client take place one at a time this represents HALF DUPLEX COMMUNICATION

+

Send message

+

Receive Message

+

Close socket

+
47{
+
48 /** Variable Declarations */
+
49 uint32_t sockfd,
+
50 conn; ///< socket descriptors - Like file handles but for sockets
+
51 char server_msg[10000],
+
52 client_msg[10000]; ///< character arrays to read and store string data
+
53 /// for communication
+
54 struct sockaddr_in server_addr,
+
55 client_addr; ///< asic structures for all syscalls and functions that
+
56 /// deal with internet addresses. Structures for handling
+
57 /// internet addresses
+
58
+
59 /**
+
60 * The TCP socket is created using the socket function
+
61 *
+
62 * AF_INET (Family) - it is an address family that is used to designate the
+
63 * type of addresses that your socket can communicate with
+
64 *
+
65 * SOCK_STREAM (Type) - Indicates TCP Connection - A stream socket provides
+
66 * for the bidirectional, reliable, sequenced, and unduplicated flow of data
+
67 * without record boundaries. Aside from the bidirectionality of data flow,
+
68 * a pair of connected stream sockets provides an interface nearly identical
+
69 * to pipes
+
70 *
+
71 * 0 (Protocol) - Specifies a particular protocol to be used with the
+
72 * socket. Specifying a protocol of 0 causes socket() to use an unspecified
+
73 * default protocol appropriate for the requested socket type
+
74 */
+
75 if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
+
76 {
+
77 error(); ///< Error if the socket descriptor has a value lower than 0 -
+
78 /// socket wasnt created
+
79 }
+
80
+
81 /**
+
82 * Server Address Information
+
83 *
+
84 * The bzero() function erases the data in the n bytes of the memory
+
85 * starting at the location pointed to, by writing zeros (bytes
+
86 * containing '\0') to that area
+
87 *
+
88 * We bind the server_addr to the internet address and port number thus
+
89 * giving our socket an identity with an address and port where it can
+
90 * listen for connections
+
91 *
+
92 * htons - The htons() function translates a short integer from host byte
+
93 * order to network byte order
+
94 *
+
95 * htonl - The htonl() function translates a long integer from host byte
+
96 * order to network byte order
+
97 *
+
98 * These functions are necessary so that the binding of address and port
+
99 * takes place with data in the correct format
+
100 */
+
101 bzero(&server_addr, sizeof(server_addr));
+
102 server_addr.sin_family = AF_INET; /// Domain/Family to be used
+
103 server_addr.sin_port = htons(PORT); /// Port to be used
+
104 server_addr.sin_addr.s_addr = htonl(INADDR_ANY);
+
105
+
106 printf("Server is running...\n");
+
107
+
108 /**
+
109 * This binds the socket descriptor to the server thus enabling the server
+
110 * to listen for connections and communicate with other clients
+
111 */
+
112 if (bind(sockfd, (struct sockaddr *)&server_addr, sizeof(server_addr)) < 0)
+
113 {
+
114 error(); /// If binding is unsuccessful
+
115 }
+
116
+
117 /**
+
118 * This is to listen for clients or connections made to the server
+
119 *
+
120 * The limit is currently at 5 but can be increased to listen for
+
121 * more connections
+
122 *
+
123 * It listens to connections through the socket descriptor
+
124 */
+
125 listen(sockfd, 5);
+
126
+
127 printf("Server is listening...\n");
+
128
+
129 /**
+
130 * When a connection is found, a socket is created and connection is
+
131 * accepted and established through the socket descriptor
+
132 */
+
133 conn = accept(sockfd, (struct sockaddr *)NULL, NULL);
+
134
+
135 printf("Server is connected...\n");
+
136
+
137 /**
+
138 * Communication between client and server
+
139 *
+
140 * The bzero() function erases the data in the n bytes of the memory
+
141 * starting at the location pointed to, by writing zeros (bytes
+
142 * containing '\0') to that area. The variables are emptied and then
+
143 * ready for use
+
144 *
+
145 * First the SERVER is prompted to type a message which is read from
+
146 * stdin and then sent over the connection that was established - the socket
+
147 * - to be received by the client (send())
+
148 *
+
149 * The SERVER then waits for the client to reply. It then receives the reply
+
150 * in the string variable and displays it (recv())
+
151 *
+
152 * The server and client can communicate till one of them exits the
+
153 * connection
+
154 *
+
155 * Since the exchange of information between the server and client take
+
156 * place one at a time this represents HALF DUPLEX COMMUNICATION
+
157 */
+
158 while (1)
+
159 {
+
160 bzero(&server_msg, sizeof(server_msg));
+
161 bzero(&client_msg, sizeof(client_msg));
+
162
+
163 /// Send message
+
164 printf("\nEnter message here: ");
+
165 fgets(server_msg, 10000, stdin);
+
166 send(conn, server_msg, strlen(server_msg) + 1, 0);
+
167
+
168 /// Receive Message
+
169 recv(conn, client_msg, sizeof(client_msg), 0);
+
170 printf("\nClient Message: %s\n", client_msg);
+
171 }
+
172
+
173 /// Close socket
+
174 close(sockfd);
+
175 printf("Server is offline...\n");
+
176 return 0;
+
177}
+
#define PORT
For structures returned by the network database library - formatted internet addresses and port numbe...
Definition: tcp_half_duplex_server.c:28
+
void error()
Utility function used to print an error message to stderr.
Definition: tcp_half_duplex_server.c:36
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+
+
+ + + + diff --git a/d6/d2b/tcp__half__duplex__server_8c.js b/d6/d2b/tcp__half__duplex__server_8c.js new file mode 100644 index 000000000..77da144f2 --- /dev/null +++ b/d6/d2b/tcp__half__duplex__server_8c.js @@ -0,0 +1,6 @@ +var tcp__half__duplex__server_8c = +[ + [ "PORT", "d6/d2b/tcp__half__duplex__server_8c.html#a614217d263be1fb1a5f76e2ff7be19a2", null ], + [ "error", "d6/d2b/tcp__half__duplex__server_8c.html#a7e15c8e2885871839fc2b820dfbdb4ce", null ], + [ "main", "d6/d2b/tcp__half__duplex__server_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/d6/d2b/tcp__half__duplex__server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d6/d2b/tcp__half__duplex__server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..4718664e0 --- /dev/null +++ b/d6/d2b/tcp__half__duplex__server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/d6/d2b/tcp__half__duplex__server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d6/d2b/tcp__half__duplex__server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..7b23d836a --- /dev/null +++ b/d6/d2b/tcp__half__duplex__server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +529118b2f1256ed0dd72ed05c59004f8 \ No newline at end of file diff --git a/d6/d2b/tcp__half__duplex__server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d6/d2b/tcp__half__duplex__server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..5573eeee6 --- /dev/null +++ b/d6/d2b/tcp__half__duplex__server_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,37 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +error + + + + + +Node1->Node2 + + + + + diff --git a/d6/d2e/cartesian__to__polar_8c.html b/d6/d2e/cartesian__to__polar_8c.html index ab7aa225d..ed66555d9 100644 --- a/d6/d2e/cartesian__to__polar_8c.html +++ b/d6/d2e/cartesian__to__polar_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: misc/cartesian_to_polar.c 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('d6/d2e/cartesian__to__polar_8c.html',' -
-
cartesian_to_polar.c File Reference
+
cartesian_to_polar.c File Reference
@@ -111,14 +110,14 @@ Include dependency graph for cartesian_to_polar.c:
- - +

+

Macros

-#define _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES
 required for MS Visual C
 
- @@ -126,19 +125,17 @@ Functions - - + + - - + +

+

Functions

void to_polar (double x, double y, double *r, double *theta)
 Function to convert cartesian coordinates to polar. More...
double get_rand (double lim1, double lim2)
 Generate a random number in the given limits. More...
 
-void test ()
 Test implementation.
void test ()
 Test implementation. More...
 
-int main ()
 Main function.
int main ()
 Main function. More...
 

Detailed Description

-

Function to convert a Cartesian co-ordinate to polar form.

+

Function to convert a Cartesian co-ordinate to polar form.

Function Documentation

- +

◆ get_rand()

@@ -173,14 +170,91 @@ int 
Returns
random number in the given range
-
89 {
-
90  double r = (double)rand() / RAND_MAX; // value in [0,1)
-
91  return (lim2 - lim1) * r + lim1; // scale to range
-
92 }
+
89{
+
90 double r = (double)rand() / RAND_MAX; // value in [0,1)
+
91 return (lim2 - lim1) * r + lim1; // scale to range
+
92}
- + +

◆ main()

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

Main function.

+
119{
+
120 test();
+
121
+
122 return 0;
+
123}
+
void test()
Test implementation.
Definition: cartesian_to_polar.c:98
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ test()

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

Test implementation.

+
99{
+
100 srand(10);
+
101 int NUM_TESTS = 5;
+
102
+
103 for (int i = 0; i < NUM_TESTS; i++)
+
104 {
+
105 double r, theta;
+
106 printf("Test %d.... ", i);
+
107 double x = get_rand(-5, 5);
+
108 double y = get_rand(-5, 5);
+
109 printf("(%.2g, %.2g).... ", x, y);
+
110 to_polar(x, y, &r, &theta);
+
111 assert(fabs(r - hypot(x, y)) < 0.01);
+
112 assert(fabs(theta - atan2(y, x)) < 0.01);
+
113 printf("passed\n");
+
114 }
+
115}
+
double get_rand(double lim1, double lim2)
Generate a random number in the given limits.
Definition: cartesian_to_polar.c:88
+
void to_polar(double x, double y, double *r, double *theta)
Function to convert cartesian coordinates to polar.
Definition: cartesian_to_polar.c:22
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+

◆ to_polar()

@@ -231,63 +305,63 @@ int 
23 {
-
24  double thetaFinal = 0.f;
-
25 
-
26  *r = sqrt(x * x + y * y);
-
27 
-
28  if (x != 0)
-
29  {
-
30  if (y != 0)
-
31  {
-
32  *theta = atan(y / x);
-
33  if ((x > 0 && y > 0) || (x == -y))
-
34  { // Q1
-
35  thetaFinal = *theta;
-
36  }
-
37  else if (x < 0 && y > 0)
-
38  { // Q2
-
39  thetaFinal = *theta + M_PI;
-
40  }
-
41  else if (x < 0 && y < 0)
-
42  { // Q3
-
43  thetaFinal = *theta - M_PI;
-
44  }
-
45  else if (x > 0 && y < 0)
-
46  { // Q4
-
47  thetaFinal = 2 * M_PI - *theta;
-
48  }
-
49  else
-
50  {
-
51  fprintf(stderr, "Should not reach here!\n");
-
52  }
-
53  }
-
54  }
-
55  else
-
56  { // exceptions when no actual angle is present
-
57  if (y > 0)
-
58  {
-
59  thetaFinal = M_PI / 2;
-
60  }
-
61  else
-
62  {
-
63  thetaFinal = -(M_PI / 2);
-
64  }
-
65  }
-
66  if (y == 0)
-
67  {
-
68  if (x > 0)
-
69  {
-
70  thetaFinal = 0;
-
71  }
-
72  else
-
73  {
-
74  thetaFinal = -M_PI;
-
75  }
-
76  }
-
77 
-
78  *theta = thetaFinal;
-
79 }
+
23{
+
24 double thetaFinal = 0.f;
+
25
+
26 *r = sqrt(x * x + y * y);
+
27
+
28 if (x != 0)
+
29 {
+
30 if (y != 0)
+
31 {
+
32 *theta = atan(y / x);
+
33 if ((x > 0 && y > 0) || (x == -y))
+
34 { // Q1
+
35 thetaFinal = *theta;
+
36 }
+
37 else if (x < 0 && y > 0)
+
38 { // Q2
+
39 thetaFinal = *theta + M_PI;
+
40 }
+
41 else if (x < 0 && y < 0)
+
42 { // Q3
+
43 thetaFinal = *theta - M_PI;
+
44 }
+
45 else if (x > 0 && y < 0)
+
46 { // Q4
+
47 thetaFinal = 2 * M_PI - *theta;
+
48 }
+
49 else
+
50 {
+
51 fprintf(stderr, "Should not reach here!\n");
+
52 }
+
53 }
+
54 }
+
55 else
+
56 { // exceptions when no actual angle is present
+
57 if (y > 0)
+
58 {
+
59 thetaFinal = M_PI / 2;
+
60 }
+
61 else
+
62 {
+
63 thetaFinal = -(M_PI / 2);
+
64 }
+
65 }
+
66 if (y == 0)
+
67 {
+
68 if (x > 0)
+
69 {
+
70 thetaFinal = 0;
+
71 }
+
72 else
+
73 {
+
74 thetaFinal = -M_PI;
+
75 }
+
76 }
+
77
+
78 *theta = thetaFinal;
+
79}
@@ -297,7 +371,7 @@ int  diff --git a/d6/d2e/cartesian__to__polar_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.map b/d6/d2e/cartesian__to__polar_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.map new file mode 100644 index 000000000..744c8741a --- /dev/null +++ b/d6/d2e/cartesian__to__polar_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/d6/d2e/cartesian__to__polar_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.md5 b/d6/d2e/cartesian__to__polar_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.md5 new file mode 100644 index 000000000..a1b85eb28 --- /dev/null +++ b/d6/d2e/cartesian__to__polar_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.md5 @@ -0,0 +1 @@ +2c5d2f5e5189556fa8fce980a3d56f4a \ No newline at end of file diff --git a/d6/d2e/cartesian__to__polar_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg b/d6/d2e/cartesian__to__polar_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg new file mode 100644 index 000000000..44902cf04 --- /dev/null +++ b/d6/d2e/cartesian__to__polar_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg @@ -0,0 +1,52 @@ + + + + + + +test + + + +Node1 + + +test + + + + + +Node2 + + +get_rand + + + + + +Node1->Node2 + + + + + +Node3 + + +to_polar + + + + + +Node1->Node3 + + + + + diff --git a/d6/d2e/cartesian__to__polar_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d6/d2e/cartesian__to__polar_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..5127132db --- /dev/null +++ b/d6/d2e/cartesian__to__polar_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/d6/d2e/cartesian__to__polar_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d6/d2e/cartesian__to__polar_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..d82378155 --- /dev/null +++ b/d6/d2e/cartesian__to__polar_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +aeb75ed09d62e2633f19079559919c13 \ No newline at end of file diff --git a/d6/d2e/cartesian__to__polar_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d6/d2e/cartesian__to__polar_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..4c9892ee3 --- /dev/null +++ b/d6/d2e/cartesian__to__polar_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,67 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +test + + + + + +Node1->Node2 + + + + + +Node3 + + +get_rand + + + + + +Node2->Node3 + + + + + +Node4 + + +to_polar + + + + + +Node2->Node4 + + + + + diff --git a/d6/d3d/factorial__large__number_8c.html b/d6/d3d/factorial__large__number_8c.html index a8f6c894b..f0ac63c52 100644 --- a/d6/d3d/factorial__large__number_8c.html +++ b/d6/d3d/factorial__large__number_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: misc/factorial_large_number.c 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('d6/d3d/factorial__large__number_8c.htm Data Structures | Typedefs | Functions -
-
factorial_large_number.c File Reference
+
factorial_large_number.c File Reference
@@ -111,44 +110,42 @@ Include dependency graph for factorial_large_number.c:
-

+

Data Structures

struct  _large_num
 dynamically large number More...
 
- - +

+

Typedefs

-typedef struct _large_num large_num
+typedef struct _large_num large_num
 dynamically large number
 
- - - - + + + - - + + - - + +

+

Functions

large_num * new_number (void)
 create a new large number More...
 
large_num * new_number (void)
 create a new large number More...
 
void delete_number (large_num *num)
 delete all memory allocated for large number More...
 
void add_digit (large_num *num, unsigned int value)
 add a digit to the large number More...
 
-void multiply (large_num *num, unsigned long n)
 multiply large number with another integer and store the result in the same large number
void multiply (large_num *num, unsigned long n)
 multiply large number with another integer and store the result in the same large number More...
 
-int main (int argc, char *argv[])
 main function
int main (int argc, char *argv[])
 main function More...
 

Detailed Description

-

Compute factorial of arbitrarily large numbers by storing individual digits in a byte.

-
Author
Krishna Vedala
+

Compute factorial of arbitrarily large numbers by storing individual digits in a byte.

+
Author
Krishna Vedala

Function Documentation

- +

◆ add_digit()

@@ -182,31 +179,31 @@ int 
49 {
-
50  if (value > 9)
-
51  {
-
52  fprintf(stderr, "digit > 9!!\n");
-
53  delete_number(num);
-
54  exit(EXIT_FAILURE);
-
55  }
-
56 
-
57  num->num_digits++;
-
58  num->digits = (char *)realloc(num->digits, num->num_digits * sizeof(char));
-
59  num->digits[num->num_digits - 1] = value;
-
60 }
+
49{
+
50 if (value > 9)
+
51 {
+
52 fprintf(stderr, "digit > 9!!\n");
+
53 delete_number(num);
+
54 exit(EXIT_FAILURE);
+
55 }
+
56
+
57 num->num_digits++;
+
58 num->digits = (char *)realloc(num->digits, num->num_digits * sizeof(char));
+
59 num->digits[num->num_digits - 1] = value;
+
60}
void delete_number(large_num *num)
delete all memory allocated for large number
Definition: factorial_large_number.c:37
unsigned int num_digits
number of digits in the number
Definition: factorial_large_number.c:17
char * digits
array to store individual digits
Definition: factorial_large_number.c:16
Here is the call graph for this function:
-
+
- +

◆ delete_number()

@@ -229,22 +226,149 @@ Here is the call graph for this function:
-
38 {
-
39  free(num->digits);
-
40  free(num);
-
41 }
+
38{
+
39 free(num->digits);
+
40 free(num);
+
41}
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
- -

◆ new_number()

+ +

◆ main()

- + + + + + + + + + + + + + + + + +
large_num* new_number int main (int argc,
char * argv[] 
)
+
+ +

main function

+
95{
+
96 int number, i;
+
97
+
98 // Asks for the number/position of term in Fibonnacci sequence
+
99 if (argc == 2)
+
100 number = atoi(argv[1]);
+
101 else
+
102 {
+
103 printf("Enter the value of n(n starts from 0 ): ");
+
104 scanf("%d", &number);
+
105 }
+
106
+
107 large_num *result = new_number();
+
108
+
109 clock_t start_time = clock();
+
110 for (i = 2; i <= number; i++) /* Multiply every number from 2 thru N */
+
111 multiply(result, i);
+
112 double time_taken = (clock() - start_time) * (double)1e3 / CLOCKS_PER_SEC;
+
113 // time_taken = (clock() - start_time) / (double) CLOCKS_PER_SEC;
+
114
+
115 printf("%d! = ", number);
+
116 for (i = result->num_digits; i > 0; i--)
+
117 putchar(result->digits[i - 1] + '0');
+
118 printf("\nTime taken: %.4g ms\n", time_taken);
+
119
+
120 delete_number(result);
+
121 return 0;
+
122}
+
large_num * new_number(void)
create a new large number
Definition: factorial_large_number.c:24
+
void multiply(large_num *num, unsigned long n)
multiply large number with another integer and store the result in the same large number
Definition: factorial_large_number.c:66
+
dynamically large number
Definition: factorial_large_number.c:15
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ multiply()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void multiply (large_num * num,
unsigned long n 
)
+
+ +

multiply large number with another integer and store the result in the same large number

+
67{
+
68 int i;
+
69 unsigned long carry = 0, temp;
+
70 for (i = 0; i < num->num_digits; i++)
+
71 {
+
72 temp = num->digits[i] * n;
+
73 temp += carry;
+
74 if (temp < 10)
+
75 carry = 0;
+
76 else
+
77 {
+
78 carry = temp / 10;
+
79 temp = temp % 10;
+
80 }
+
81 num->digits[i] = temp;
+
82 }
+
83
+
84 while (carry != 0)
+
85 {
+
86 add_digit(num, carry % 10);
+
87 carry /= 10;
+
88 }
+
89}
+
void add_digit(large_num *num, unsigned int value)
add a digit to the large number
Definition: factorial_large_number.c:48
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ new_number()

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

create a new large number

Returns
pointer to a large number
-
25 {
-
26  large_num *new_num = (large_num *)malloc(sizeof(large_num));
-
27  new_num->num_digits = 1;
-
28  new_num->digits = (char *)malloc(1 * sizeof(char));
-
29  new_num->digits[0] = 1;
-
30  return new_num;
-
31 }
+
25{
+
26 large_num *new_num = (large_num *)malloc(sizeof(large_num));
+
27 new_num->num_digits = 1;
+
28 new_num->digits = (char *)malloc(1 * sizeof(char));
+
29 new_num->digits[0] = 1;
+
30 return new_num;
+
31}
#define malloc(bytes)
This macro replace the standard malloc function with malloc_dbg.
Definition: malloc_dbg.h:18
-
dynamically large number
Definition: factorial_large_number.c:15
@@ -273,7 +396,7 @@ Here is the call graph for this function: diff --git a/d6/d3d/factorial__large__number_8c.js b/d6/d3d/factorial__large__number_8c.js index 4acff56dc..a9b8f7ef0 100644 --- a/d6/d3d/factorial__large__number_8c.js +++ b/d6/d3d/factorial__large__number_8c.js @@ -6,5 +6,5 @@ var factorial__large__number_8c = [ "delete_number", "d6/d3d/factorial__large__number_8c.html#ab5c854e0df76165c31899e69eceeeaae", null ], [ "main", "d6/d3d/factorial__large__number_8c.html#a0ddf1224851353fc92bfbff6f499fa97", null ], [ "multiply", "d6/d3d/factorial__large__number_8c.html#ad398ddbd594ca69a5e6dfc894925341e", null ], - [ "new_number", "d6/d3d/factorial__large__number_8c.html#ad8101f58545bd891ae8b6e11caadd7eb", null ] + [ "new_number", "d6/d3d/factorial__large__number_8c.html#ace5f6aa21955d4e4bdc89228c2f91234", null ] ]; \ No newline at end of file diff --git a/d6/d3d/factorial__large__number_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map b/d6/d3d/factorial__large__number_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map new file mode 100644 index 000000000..2ea806ade --- /dev/null +++ b/d6/d3d/factorial__large__number_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/d6/d3d/factorial__large__number_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 b/d6/d3d/factorial__large__number_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 new file mode 100644 index 000000000..81ad9e088 --- /dev/null +++ b/d6/d3d/factorial__large__number_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 @@ -0,0 +1 @@ +a42f5ee5a7c9103c8021af0675e363c0 \ No newline at end of file diff --git a/d6/d3d/factorial__large__number_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg b/d6/d3d/factorial__large__number_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg new file mode 100644 index 000000000..0adf74272 --- /dev/null +++ b/d6/d3d/factorial__large__number_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg @@ -0,0 +1,88 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +delete_number + + + + + +Node1->Node2 + + + + + +Node3 + + +multiply + + + + + +Node1->Node3 + + + + + +Node5 + + +new_number + + + + + +Node1->Node5 + + + + + +Node4 + + +add_digit + + + + + +Node3->Node4 + + + + + +Node4->Node2 + + + + + diff --git a/d6/d3d/factorial__large__number_8c_ad398ddbd594ca69a5e6dfc894925341e_cgraph.map b/d6/d3d/factorial__large__number_8c_ad398ddbd594ca69a5e6dfc894925341e_cgraph.map new file mode 100644 index 000000000..d2565471b --- /dev/null +++ b/d6/d3d/factorial__large__number_8c_ad398ddbd594ca69a5e6dfc894925341e_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/d6/d3d/factorial__large__number_8c_ad398ddbd594ca69a5e6dfc894925341e_cgraph.md5 b/d6/d3d/factorial__large__number_8c_ad398ddbd594ca69a5e6dfc894925341e_cgraph.md5 new file mode 100644 index 000000000..7d0a24a5c --- /dev/null +++ b/d6/d3d/factorial__large__number_8c_ad398ddbd594ca69a5e6dfc894925341e_cgraph.md5 @@ -0,0 +1 @@ +b9deb12f29a00302080e58d7daf8f954 \ No newline at end of file diff --git a/d6/d3d/factorial__large__number_8c_ad398ddbd594ca69a5e6dfc894925341e_cgraph.svg b/d6/d3d/factorial__large__number_8c_ad398ddbd594ca69a5e6dfc894925341e_cgraph.svg new file mode 100644 index 000000000..f4fb94ab6 --- /dev/null +++ b/d6/d3d/factorial__large__number_8c_ad398ddbd594ca69a5e6dfc894925341e_cgraph.svg @@ -0,0 +1,52 @@ + + + + + + +multiply + + + +Node1 + + +multiply + + + + + +Node2 + + +add_digit + + + + + +Node1->Node2 + + + + + +Node3 + + +delete_number + + + + + +Node2->Node3 + + + + + diff --git a/d6/d3d/factorial__large__number_8c_af2869d36c22a2b8f93d3166a84e124b3_cgraph.map b/d6/d3d/factorial__large__number_8c_af2869d36c22a2b8f93d3166a84e124b3_cgraph.map index f51f025d0..7a11914d0 100644 --- a/d6/d3d/factorial__large__number_8c_af2869d36c22a2b8f93d3166a84e124b3_cgraph.map +++ b/d6/d3d/factorial__large__number_8c_af2869d36c22a2b8f93d3166a84e124b3_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/d6/d3d/factorial__large__number_8c_af2869d36c22a2b8f93d3166a84e124b3_cgraph.svg b/d6/d3d/factorial__large__number_8c_af2869d36c22a2b8f93d3166a84e124b3_cgraph.svg index 8fd4fc3e6..e275908c0 100644 --- a/d6/d3d/factorial__large__number_8c_af2869d36c22a2b8f93d3166a84e124b3_cgraph.svg +++ b/d6/d3d/factorial__large__number_8c_af2869d36c22a2b8f93d3166a84e124b3_cgraph.svg @@ -1,20 +1,20 @@ - - + add_digit - + Node1 - -add_digit + +add_digit @@ -22,16 +22,16 @@ Node2 - -delete_number + +delete_number Node1->Node2 - - + + diff --git a/d6/d42/problem__22_2sol1_8c__incl.map b/d6/d42/problem__22_2sol1_8c__incl.map index f4c2e09c0..e739348f7 100644 --- a/d6/d42/problem__22_2sol1_8c__incl.map +++ b/d6/d42/problem__22_2sol1_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/d6/d42/problem__22_2sol1_8c__incl.svg b/d6/d42/problem__22_2sol1_8c__incl.svg index f8ee57b88..e5c986750 100644 --- a/d6/d42/problem__22_2sol1_8c__incl.svg +++ b/d6/d42/problem__22_2sol1_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - -project_euler/problem + +project_euler/problem _22/sol1.c diff --git a/d6/d42/structdynamic__array.html b/d6/d42/structdynamic__array.html index 705e8dc95..5b12c0f6b 100644 --- a/d6/d42/structdynamic__array.html +++ b/d6/d42/structdynamic__array.html @@ -2,8 +2,8 @@ - - + +Algorithms_in_C: dynamic_array Struct Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ @@ -42,21 +41,22 @@
large_num * new_number ( void  )
-
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,20 +92,19 @@ $(document).ready(function(){initNavTree('d6/d42/structdynamic__array.html','../
-
-
dynamic_array Struct Reference
+
dynamic_array Struct Reference
- - - -

+

Data Fields

+
void ** items
 
+
unsigned size
 
+
unsigned capacity
 
@@ -118,7 +117,7 @@ unsigned capacity diff --git a/d6/d42/structdynamic__array.js b/d6/d42/structdynamic__array.js deleted file mode 100644 index be2ea990f..000000000 --- a/d6/d42/structdynamic__array.js +++ /dev/null @@ -1,6 +0,0 @@ -var structdynamic__array = -[ - [ "capacity", "d6/d42/structdynamic__array.html#a9ddb0f64ade5d5e74b7fd091158958e4", null ], - [ "items", "d6/d42/structdynamic__array.html#a7e3fbd203b3b86401c17dede7a33f781", null ], - [ "size", "d6/d42/structdynamic__array.html#a79c587474e35f99510ca3018bf700007", null ] -]; \ No newline at end of file diff --git a/d6/d48/isogram_8h_source.html b/d6/d48/isogram_8h_source.html index c79b4ee20..587660af2 100644 --- a/d6/d48/isogram_8h_source.html +++ b/d6/d48/isogram_8h_source.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: exercism/isogram/isogram.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,25 +90,24 @@ $(document).ready(function(){initNavTree('d6/d48/isogram_8h_source.html','../../
-
-
isogram.h
+
isogram.h
-
1 #ifndef ISOGRAM_H
-
2 #define ISOGRAM_H
-
3 
-
4 #include <stdbool.h>
-
5 
-
6 bool is_isogram(const char phrase[]);
-
7 
-
8 #endif
+
1#ifndef ISOGRAM_H
+
2#define ISOGRAM_H
+
3
+
4#include <stdbool.h>
+
5
+
6bool is_isogram(const char phrase[]);
+
7
+
8#endif
diff --git a/d6/d64/problem__7_2sol2_8c.html b/d6/d64/problem__7_2sol2_8c.html index 82093e007..0e603436d 100644 --- a/d6/d64/problem__7_2sol2_8c.html +++ b/d6/d64/problem__7_2sol2_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_7/sol2.c 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,32 +92,31 @@ $(document).ready(function(){initNavTree('d6/d64/problem__7_2sol2_8c.html','../.
-
-
sol2.c File Reference
+
sol2.c File Reference
-

Problem 7 solution. +

Problem 7 solution. More...

#include <stdio.h>
Include dependency graph for sol2.c:
-
+
-

+

Functions

int main ()
 Main function. More...
 

Detailed Description

-

Problem 7 solution.

+

Problem 7 solution.

See also
Faster version problem_7/sol.c

Function Documentation

- +

◆ main()

@@ -135,33 +134,33 @@ Functions

Main function.

Returns
0 on exit
-
12 {
-
13  int n;
-
14  scanf("%d", &n);
-
15  int number_of_prime = 0;
-
16  for (int i = 2;; i++)
-
17  {
-
18  int divisors = 0;
-
19  for (int j = 1; j <= i; j++)
-
20  {
-
21  if (i % j == 0)
-
22  {
-
23  divisors++;
-
24  }
-
25  }
-
26  if (divisors == 2)
-
27  {
-
28  number_of_prime++;
-
29  if (number_of_prime == n)
-
30  {
-
31  printf("%d", i);
-
32  break;
-
33  }
-
34  }
-
35  }
-
36 
-
37  return 0;
-
38 }
+
12{
+
13 int n;
+
14 scanf("%d", &n);
+
15 int number_of_prime = 0;
+
16 for (int i = 2;; i++)
+
17 {
+
18 int divisors = 0;
+
19 for (int j = 1; j <= i; j++)
+
20 {
+
21 if (i % j == 0)
+
22 {
+
23 divisors++;
+
24 }
+
25 }
+
26 if (divisors == 2)
+
27 {
+
28 number_of_prime++;
+
29 if (number_of_prime == n)
+
30 {
+
31 printf("%d", i);
+
32 break;
+
33 }
+
34 }
+
35 }
+
36
+
37 return 0;
+
38}
static unsigned int divisors[]
Hack to store divisors between 1 & 20.
Definition: sol2.c:21
@@ -172,7 +171,7 @@ Functions diff --git a/d6/d6d/struct_graph__coll__graph.map b/d6/d6d/struct_graph__coll__graph.map index cd57a2227..aecef059a 100644 --- a/d6/d6d/struct_graph__coll__graph.map +++ b/d6/d6d/struct_graph__coll__graph.map @@ -1,5 +1,5 @@ - - - + + + diff --git a/d6/d6d/struct_graph__coll__graph.md5 b/d6/d6d/struct_graph__coll__graph.md5 index ac2074817..78c385aeb 100644 --- a/d6/d6d/struct_graph__coll__graph.md5 +++ b/d6/d6d/struct_graph__coll__graph.md5 @@ -1 +1 @@ -e81771ba1c248d3bf33961ad6c102d42 \ No newline at end of file +83a7cdfb8dcecf4a3103f649fd61be01 \ No newline at end of file diff --git a/d6/d6d/struct_graph__coll__graph.svg b/d6/d6d/struct_graph__coll__graph.svg index b1c97da57..3430b3f40 100644 --- a/d6/d6d/struct_graph__coll__graph.svg +++ b/d6/d6d/struct_graph__coll__graph.svg @@ -1,69 +1,69 @@ - - + Graph - + Node1 - -Graph + +Graph Node2 - - -node + + +Edge Node2->Node1 - - - adjLists - - - -Node2->Node2 - - - left -leftNode -link -next -par -pre -right -rightNode + + + edge +edges Node3 - - -Edge + + +node - + Node3->Node1 - - - edge -edges + + + adjLists + + + +Node3->Node3 + + + left +leftNode +link +next +par +pre +right +rightNode diff --git a/d6/d76/k__means__clustering_8c.html b/d6/d76/k__means__clustering_8c.html index 0bb8ac39b..de61f393a 100644 --- a/d6/d76/k__means__clustering_8c.html +++ b/d6/d76/k__means__clustering_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: machine_learning/k_means_clustering.c 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('d6/d76/k__means__clustering_8c.html',' Macros | Typedefs | Functions
-
-
k_means_clustering.c File Reference
+
k_means_clustering.c File Reference
@@ -115,20 +114,20 @@ Include dependency graph for k_means_clustering.c:
-

+

Data Structures

struct  observation
 
struct  cluster
 
- -

+

Macros

+
#define _USE_MATH_DEFINES   /* required for MS Visual C */
 
- @@ -137,14 +136,14 @@ typedef struct observat typedef struct cluster 

+

Typedefs

typedef struct observation observation
cluster
 
- - - + + @@ -155,11 +154,11 @@ Functions

+

Functions

int calculateNearst (observation *o, cluster clusters[], int k)
 
void calculateCentroid (observation observations[], size_t size, cluster *centroid)
 
cluster * kMeans (observation observations[], size_t size, int k)
 
cluster * kMeans (observation observations[], size_t size, int k)
 
void printEPS (observation pts[], size_t len, cluster cent[], int k)
 
static void test ()
 

Detailed Description

-

K Means Clustering Algorithm implemented.

-

This file has K Means algorithm implemmented It prints test output in eps format

-

Note: Though the code for clustering works for all the 2D data points and can be extended for any size vector by making the required changes, but note that the output method i.e. printEPS is only good for polar data points i.e. in a circle and both test use the same.

Author
Lakhan Nad
+

K Means Clustering Algorithm implemented.

+

This file has K Means algorithm implemmented It prints test output in eps format

+

Note: Though the code for clustering works for all the 2D data points and can be extended for any size vector by making the required changes, but note that the output method i.e. printEPS is only good for polar data points i.e. in a circle and both test use the same.

Author
Lakhan Nad

Function Documentation

- +

◆ main()

@@ -174,24 +173,24 @@ Functions
-

This function calls the test function

-
385 {
-
386  srand(time(NULL));
-
387  test();
-
388  /* test2(); */
-
389  return 0;
-
390 }
+

This function calls the test function

+
385{
+
386 srand(time(NULL));
+
387 test();
+
388 /* test2(); */
+
389 return 0;
+
390}
static void test()
Definition: k_means_clustering.c:321
Here is the call graph for this function:
-
+
- +

◆ printEPS()

@@ -228,7 +227,7 @@ Here is the call graph for this function:
-

A function to print observations and clusters The code is taken from http://rosettacode.org/wiki/K-means%2B%2B_clustering. Even the K Means code is also inspired from it

+

A function to print observations and clusters The code is taken from http://rosettacode.org/wiki/K-means%2B%2B_clustering. Even the K Means code is also inspired from it

Note
To print in a file use pipeline operator
./k_means_clustering > image.eps
Parameters
@@ -240,77 +239,77 @@ Here is the call graph for this function:
-
238 {
-
239  int W = 400, H = 400;
-
240  double min_x = DBL_MAX, max_x = DBL_MIN, min_y = DBL_MAX, max_y = DBL_MIN;
-
241  double scale = 0, cx = 0, cy = 0;
-
242  double* colors = (double*)malloc(sizeof(double) * (k * 3));
-
243  int i;
-
244  size_t j;
-
245  double kd = k * 1.0;
-
246  for (i = 0; i < k; i++)
-
247  {
-
248  *(colors + 3 * i) = (3 * (i + 1) % k) / kd;
-
249  *(colors + 3 * i + 1) = (7 * i % k) / kd;
-
250  *(colors + 3 * i + 2) = (9 * i % k) / kd;
-
251  }
-
252 
-
253  for (j = 0; j < len; j++)
-
254  {
-
255  if (max_x < pts[j].x)
-
256  {
-
257  max_x = pts[j].x;
-
258  }
-
259  if (min_x > pts[j].x)
-
260  {
-
261  min_x = pts[j].x;
-
262  }
-
263  if (max_y < pts[j].y)
-
264  {
-
265  max_y = pts[j].y;
-
266  }
-
267  if (min_y > pts[j].y)
-
268  {
-
269  min_y = pts[j].y;
-
270  }
-
271  }
-
272  scale = W / (max_x - min_x);
-
273  if (scale > (H / (max_y - min_y)))
-
274  {
-
275  scale = H / (max_y - min_y);
-
276  };
-
277  cx = (max_x + min_x) / 2;
-
278  cy = (max_y + min_y) / 2;
-
279 
-
280  printf("%%!PS-Adobe-3.0 EPSF-3.0\n%%%%BoundingBox: -5 -5 %d %d\n", W + 10,
-
281  H + 10);
-
282  printf(
-
283  "/l {rlineto} def /m {rmoveto} def\n"
-
284  "/c { .25 sub exch .25 sub exch .5 0 360 arc fill } def\n"
-
285  "/s { moveto -2 0 m 2 2 l 2 -2 l -2 -2 l closepath "
-
286  " gsave 1 setgray fill grestore gsave 3 setlinewidth"
-
287  " 1 setgray stroke grestore 0 setgray stroke }def\n");
-
288  for (int i = 0; i < k; i++)
-
289  {
-
290  printf("%g %g %g setrgbcolor\n", *(colors + 3 * i),
-
291  *(colors + 3 * i + 1), *(colors + 3 * i + 2));
-
292  for (j = 0; j < len; j++)
-
293  {
-
294  if (pts[j].group != i)
-
295  {
-
296  continue;
-
297  }
-
298  printf("%.3f %.3f c\n", (pts[j].x - cx) * scale + W / 2,
-
299  (pts[j].y - cy) * scale + H / 2);
-
300  }
-
301  printf("\n0 setgray %g %g s\n", (cent[i].x - cx) * scale + W / 2,
-
302  (cent[i].y - cy) * scale + H / 2);
-
303  }
-
304  printf("\n%%%%EOF");
-
305 
-
306  // free accquired memory
-
307  free(colors);
-
308 }
+
238{
+
239 int W = 400, H = 400;
+
240 double min_x = DBL_MAX, max_x = DBL_MIN, min_y = DBL_MAX, max_y = DBL_MIN;
+
241 double scale = 0, cx = 0, cy = 0;
+
242 double* colors = (double*)malloc(sizeof(double) * (k * 3));
+
243 int i;
+
244 size_t j;
+
245 double kd = k * 1.0;
+
246 for (i = 0; i < k; i++)
+
247 {
+
248 *(colors + 3 * i) = (3 * (i + 1) % k) / kd;
+
249 *(colors + 3 * i + 1) = (7 * i % k) / kd;
+
250 *(colors + 3 * i + 2) = (9 * i % k) / kd;
+
251 }
+
252
+
253 for (j = 0; j < len; j++)
+
254 {
+
255 if (max_x < pts[j].x)
+
256 {
+
257 max_x = pts[j].x;
+
258 }
+
259 if (min_x > pts[j].x)
+
260 {
+
261 min_x = pts[j].x;
+
262 }
+
263 if (max_y < pts[j].y)
+
264 {
+
265 max_y = pts[j].y;
+
266 }
+
267 if (min_y > pts[j].y)
+
268 {
+
269 min_y = pts[j].y;
+
270 }
+
271 }
+
272 scale = W / (max_x - min_x);
+
273 if (scale > (H / (max_y - min_y)))
+
274 {
+
275 scale = H / (max_y - min_y);
+
276 };
+
277 cx = (max_x + min_x) / 2;
+
278 cy = (max_y + min_y) / 2;
+
279
+
280 printf("%%!PS-Adobe-3.0 EPSF-3.0\n%%%%BoundingBox: -5 -5 %d %d\n", W + 10,
+
281 H + 10);
+
282 printf(
+
283 "/l {rlineto} def /m {rmoveto} def\n"
+
284 "/c { .25 sub exch .25 sub exch .5 0 360 arc fill } def\n"
+
285 "/s { moveto -2 0 m 2 2 l 2 -2 l -2 -2 l closepath "
+
286 " gsave 1 setgray fill grestore gsave 3 setlinewidth"
+
287 " 1 setgray stroke grestore 0 setgray stroke }def\n");
+
288 for (int i = 0; i < k; i++)
+
289 {
+
290 printf("%g %g %g setrgbcolor\n", *(colors + 3 * i),
+
291 *(colors + 3 * i + 1), *(colors + 3 * i + 2));
+
292 for (j = 0; j < len; j++)
+
293 {
+
294 if (pts[j].group != i)
+
295 {
+
296 continue;
+
297 }
+
298 printf("%.3f %.3f c\n", (pts[j].x - cx) * scale + W / 2,
+
299 (pts[j].y - cy) * scale + H / 2);
+
300 }
+
301 printf("\n0 setgray %g %g s\n", (cent[i].x - cx) * scale + W / 2,
+
302 (cent[i].y - cy) * scale + H / 2);
+
303 }
+
304 printf("\n%%%%EOF");
+
305
+
306 // free accquired memory
+
307 free(colors);
+
308}
#define malloc(bytes)
This macro replace the standard malloc function with malloc_dbg.
Definition: malloc_dbg.h:18
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
double x
abscissa of 2D data point
Definition: k_means_clustering.c:40
@@ -318,7 +317,7 @@ Here is the call graph for this function:
- +

◆ test()

@@ -341,44 +340,44 @@ Here is the call graph for this function:
-

A function to test the kMeans function Generates 100000 points in a circle of radius 20.0 with center at (0,0) and cluster them into 5 clusters

-

Output for 100000 points divided in 5 clusters

Returns
None
-
322 {
-
323  size_t size = 100000L;
-
324  observation* observations =
-
325  (observation*)malloc(sizeof(observation) * size);
-
326  double maxRadius = 20.00;
-
327  double radius = 0;
-
328  double ang = 0;
-
329  size_t i = 0;
-
330  for (; i < size; i++)
-
331  {
-
332  radius = maxRadius * ((double)rand() / RAND_MAX);
-
333  ang = 2 * M_PI * ((double)rand() / RAND_MAX);
-
334  observations[i].x = radius * cos(ang);
-
335  observations[i].y = radius * sin(ang);
-
336  }
-
337  int k = 5; // No of clusters
-
338  cluster* clusters = kMeans(observations, size, k);
-
339  printEPS(observations, size, clusters, k);
-
340  // Free the accquired memory
-
341  free(observations);
-
342  free(clusters);
-
343 }
-
cluster * kMeans(observation observations[], size_t size, int k)
Definition: k_means_clustering.c:134
+

A function to test the kMeans function Generates 100000 points in a circle of radius 20.0 with center at (0,0) and cluster them into 5 clusters

+

Output for 100000 points divided in 5 clusters

Returns
None
+
322{
+
323 size_t size = 100000L;
+
324 observation* observations =
+
325 (observation*)malloc(sizeof(observation) * size);
+
326 double maxRadius = 20.00;
+
327 double radius = 0;
+
328 double ang = 0;
+
329 size_t i = 0;
+
330 for (; i < size; i++)
+
331 {
+
332 radius = maxRadius * ((double)rand() / RAND_MAX);
+
333 ang = 2 * M_PI * ((double)rand() / RAND_MAX);
+
334 observations[i].x = radius * cos(ang);
+
335 observations[i].y = radius * sin(ang);
+
336 }
+
337 int k = 5; // No of clusters
+
338 cluster* clusters = kMeans(observations, size, k);
+
339 printEPS(observations, size, clusters, k);
+
340 // Free the accquired memory
+
341 free(observations);
+
342 free(clusters);
+
343}
+
cluster * kMeans(observation observations[], size_t size, int k)
Definition: k_means_clustering.c:134
void printEPS(observation pts[], size_t len, cluster cent[], int k)
Definition: k_means_clustering.c:237
Definition: k_means_clustering.c:53
Definition: k_means_clustering.c:39
Here is the call graph for this function:
-
+
- +

◆ test2()

@@ -392,34 +391,34 @@ Here is the call graph for this function:
-

A function to test the kMeans function Generates 1000000 points in a circle of radius 20.0 with center at (0,0) and cluster them into 11 clusters

-

Output for 1000000 points divided in 11 clusters

Returns
None
-
357 {
-
358  size_t size = 1000000L;
-
359  observation* observations =
-
360  (observation*)malloc(sizeof(observation) * size);
-
361  double maxRadius = 20.00;
-
362  double radius = 0;
-
363  double ang = 0;
-
364  size_t i = 0;
-
365  for (; i < size; i++)
-
366  {
-
367  radius = maxRadius * ((double)rand() / RAND_MAX);
-
368  ang = 2 * M_PI * ((double)rand() / RAND_MAX);
-
369  observations[i].x = radius * cos(ang);
-
370  observations[i].y = radius * sin(ang);
-
371  }
-
372  int k = 11; // No of clusters
-
373  cluster* clusters = kMeans(observations, size, k);
-
374  printEPS(observations, size, clusters, k);
-
375  // Free the accquired memory
-
376  free(observations);
-
377  free(clusters);
-
378 }
+

A function to test the kMeans function Generates 1000000 points in a circle of radius 20.0 with center at (0,0) and cluster them into 11 clusters

+

Output for 1000000 points divided in 11 clusters

Returns
None
+
357{
+
358 size_t size = 1000000L;
+
359 observation* observations =
+
360 (observation*)malloc(sizeof(observation) * size);
+
361 double maxRadius = 20.00;
+
362 double radius = 0;
+
363 double ang = 0;
+
364 size_t i = 0;
+
365 for (; i < size; i++)
+
366 {
+
367 radius = maxRadius * ((double)rand() / RAND_MAX);
+
368 ang = 2 * M_PI * ((double)rand() / RAND_MAX);
+
369 observations[i].x = radius * cos(ang);
+
370 observations[i].y = radius * sin(ang);
+
371 }
+
372 int k = 11; // No of clusters
+
373 cluster* clusters = kMeans(observations, size, k);
+
374 printEPS(observations, size, clusters, k);
+
375 // Free the accquired memory
+
376 free(observations);
+
377 free(clusters);
+
378}
Here is the call graph for this function:
-
+
@@ -431,7 +430,7 @@ Here is the call graph for this function:
diff --git a/d6/d76/k__means__clustering_8c.js b/d6/d76/k__means__clustering_8c.js index 36a3296b8..e5f6f9a33 100644 --- a/d6/d76/k__means__clustering_8c.js +++ b/d6/d76/k__means__clustering_8c.js @@ -1,11 +1,8 @@ var k__means__clustering_8c = [ - [ "_USE_MATH_DEFINES", "d6/d76/k__means__clustering_8c.html#a525335710b53cb064ca56b936120431e", null ], - [ "cluster", "d8/d71/group__k__means.html#gabe256d797c00b793041eac33f07804c1", null ], - [ "observation", "d8/d71/group__k__means.html#ga8cc0f5e9645e6faf40d1746acf777944", null ], [ "calculateCentroid", "d8/d71/group__k__means.html#gadee39a3f17bf5144df5592e48dbfc9f7", null ], [ "calculateNearst", "d8/d71/group__k__means.html#gad339c41d3ee9e6729aca9e9ab3f7d2d9", null ], - [ "kMeans", "d8/d71/group__k__means.html#gad229b1dc406cb5ea510f26a373ed8bfd", null ], + [ "kMeans", "d8/d71/group__k__means.html#gaf6259432561e794dea0e060f482d15e2", null ], [ "main", "d6/d76/k__means__clustering_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], [ "printEPS", "d6/d76/k__means__clustering_8c.html#a5b4ba704e02672e59cfa35f82e3db28a", null ], [ "test", "d6/d76/k__means__clustering_8c.html#aa8dca7b867074164d5f45b0f3851269d", null ], diff --git a/d6/d76/k__means__clustering_8c_a0283886819c7c140a023582b7269e2d0_cgraph.map b/d6/d76/k__means__clustering_8c_a0283886819c7c140a023582b7269e2d0_cgraph.map index b1a600f78..46a7ccc08 100644 --- a/d6/d76/k__means__clustering_8c_a0283886819c7c140a023582b7269e2d0_cgraph.map +++ b/d6/d76/k__means__clustering_8c_a0283886819c7c140a023582b7269e2d0_cgraph.map @@ -1,7 +1,7 @@ - + - - + + diff --git a/d6/d76/k__means__clustering_8c_a0283886819c7c140a023582b7269e2d0_cgraph.md5 b/d6/d76/k__means__clustering_8c_a0283886819c7c140a023582b7269e2d0_cgraph.md5 index 32add5355..c33c060ab 100644 --- a/d6/d76/k__means__clustering_8c_a0283886819c7c140a023582b7269e2d0_cgraph.md5 +++ b/d6/d76/k__means__clustering_8c_a0283886819c7c140a023582b7269e2d0_cgraph.md5 @@ -1 +1 @@ -081cfa9a8a595152abead37957945f5e \ No newline at end of file +688d6fdbb72bc9babd85a0091f57435b \ No newline at end of file diff --git a/d6/d76/k__means__clustering_8c_a0283886819c7c140a023582b7269e2d0_cgraph.svg b/d6/d76/k__means__clustering_8c_a0283886819c7c140a023582b7269e2d0_cgraph.svg index c311246e6..8fa82b85b 100644 --- a/d6/d76/k__means__clustering_8c_a0283886819c7c140a023582b7269e2d0_cgraph.svg +++ b/d6/d76/k__means__clustering_8c_a0283886819c7c140a023582b7269e2d0_cgraph.svg @@ -1,14 +1,14 @@ - - + test2 - + Node1 @@ -21,8 +21,8 @@ Node2 - - + + kMeans @@ -30,8 +30,8 @@ Node1->Node2 - - + + @@ -52,31 +52,31 @@ Node3 - -calculateCentroid + +calculateCentroid Node2->Node3 - - + + Node4 - -calculateNearst + +calculateNearst Node2->Node4 - - + + diff --git a/d6/d76/k__means__clustering_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map b/d6/d76/k__means__clustering_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map index ec0b228d8..b2fb1223d 100644 --- a/d6/d76/k__means__clustering_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map +++ b/d6/d76/k__means__clustering_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map @@ -1,7 +1,7 @@ - + - - + + diff --git a/d6/d76/k__means__clustering_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 b/d6/d76/k__means__clustering_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 index 46edb5ff7..359205710 100644 --- a/d6/d76/k__means__clustering_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 +++ b/d6/d76/k__means__clustering_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 @@ -1 +1 @@ -b967e366d703701eb2bd21d75547a442 \ No newline at end of file +e33aa999f15a4683ee6b906907a5c0aa \ No newline at end of file diff --git a/d6/d76/k__means__clustering_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/d6/d76/k__means__clustering_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg index 24e6deee9..d7a895c9c 100644 --- a/d6/d76/k__means__clustering_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg +++ b/d6/d76/k__means__clustering_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg @@ -1,14 +1,14 @@ - - + test - + Node1 @@ -21,8 +21,8 @@ Node2 - - + + kMeans @@ -30,8 +30,8 @@ Node1->Node2 - - + + @@ -52,31 +52,31 @@ Node3 - -calculateCentroid + +calculateCentroid Node2->Node3 - - + + Node4 - -calculateNearst + +calculateNearst Node2->Node4 - - + + diff --git a/d6/d76/k__means__clustering_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d6/d76/k__means__clustering_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map index cdd362238..847222578 100644 --- a/d6/d76/k__means__clustering_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map +++ b/d6/d76/k__means__clustering_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -1,8 +1,8 @@ - + - - + + diff --git a/d6/d76/k__means__clustering_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d6/d76/k__means__clustering_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 index 5f8640f70..7f015b329 100644 --- a/d6/d76/k__means__clustering_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 +++ b/d6/d76/k__means__clustering_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -1 +1 @@ -ead209d8b126bdb7b79b6607b6109cdc \ No newline at end of file +b271a7cedf520691668b83ff26464bfe \ No newline at end of file diff --git a/d6/d76/k__means__clustering_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d6/d76/k__means__clustering_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index ba0b74246..6141dafe3 100644 --- a/d6/d76/k__means__clustering_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/d6/d76/k__means__clustering_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,14 +1,14 @@ - - + main - + Node1 @@ -36,8 +36,8 @@ Node3 - - + + kMeans @@ -45,8 +45,8 @@ Node2->Node3 - - + + @@ -67,31 +67,31 @@ Node4 - -calculateCentroid + +calculateCentroid Node3->Node4 - - + + Node5 - -calculateNearst + +calculateNearst Node3->Node5 - - + + diff --git a/d6/d7b/jump__search_8c.html b/d6/d7b/jump__search_8c.html index edeab864f..c49287615 100644 --- a/d6/d7b/jump__search_8c.html +++ b/d6/d7b/jump__search_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: searching/jump_search.c 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/jump__search_8c.html','../../') -
-
jump_search.c File Reference
+
jump_search.c File Reference
-

Implementation of jump search algorithm. +

Implementation of jump search algorithm. More...

#include <assert.h>
#include <math.h>
@@ -110,31 +109,29 @@ Include dependency graph for jump_search.c:
- - +

+

Macros

-#define min(X, Y)   ((X) < (Y) ? (X) : (Y))
+#define min(X, Y)   ((X) < (Y) ? (X) : (Y))
 Macro to return the minimum of two values.
 
- - - + + - - + +

+

Functions

int jump_search (const int *arr, int x, size_t n)
 Implement Jump-search algorithm. More...
 
-void test ()
 Test implementation of the function.
void test ()
 Test implementation of the function. More...
 
-int main ()
 Main function.
int main ()
 Main function. More...
 

Detailed Description

-

Implementation of jump search algorithm.

+

Implementation of jump search algorithm.

Function Documentation

- +

◆ jump_search()

@@ -178,36 +175,112 @@ int 
Returns
index where the value was found
-1 if value not found
-
25 {
-
26  int step = floor(sqrt(n));
-
27  int prev = 0;
-
28 
-
29  while (arr[min(step, n) - 1] < x)
-
30  {
-
31  prev = step;
-
32  step += floor(sqrt(n));
-
33  if (prev >= n)
-
34  {
-
35  return -1;
-
36  }
-
37  }
-
38 
-
39  while (arr[prev] < x)
-
40  {
-
41  prev = prev + 1;
-
42  if (prev == min(step, n))
-
43  {
-
44  return -1;
-
45  }
-
46  }
-
47  if (arr[prev] == x)
-
48  {
-
49  return prev;
-
50  }
-
51  return -1;
-
52 }
+
25{
+
26 int step = floor(sqrt(n));
+
27 int prev = 0;
+
28
+
29 while (arr[min(step, n) - 1] < x)
+
30 {
+
31 prev = step;
+
32 step += floor(sqrt(n));
+
33 if (prev >= n)
+
34 {
+
35 return -1;
+
36 }
+
37 }
+
38
+
39 while (arr[prev] < x)
+
40 {
+
41 prev = prev + 1;
+
42 if (prev == min(step, n))
+
43 {
+
44 return -1;
+
45 }
+
46 }
+
47 if (arr[prev] == x)
+
48 {
+
49 return prev;
+
50 }
+
51 return -1;
+
52}
#define min(X, Y)
Macro to return the minimum of two values.
Definition: jump_search.c:13
+
+
+ +

◆ main()

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

Main function.

+
82{
+
83 test();
+
84 return 0;
+
85}
+
void test()
Test implementation of the function.
Definition: jump_search.c:58
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ test()

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

Test implementation of the function.

+
59{
+
60 int arr[] = {0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610};
+
61 size_t n = sizeof(arr) / sizeof(int);
+
62
+
63 int x = 55;
+
64 printf("Test 1.... ");
+
65 int index = jump_search(arr, x, n);
+
66 assert(index == 10);
+
67 printf("passed\nTest 2.... ");
+
68 x = 56;
+
69 index = jump_search(arr, x, n);
+
70 assert(index == -1);
+
71 printf("passed\nTest 3.... ");
+
72 x = 13;
+
73 index = jump_search(arr, x, n);
+
74 assert(index == 7);
+
75 printf("passed\n");
+
76}
+
int jump_search(const int *arr, int x, size_t n)
Implement Jump-search algorithm.
Definition: jump_search.c:24
+
+Here is the call graph for this function:
+
+
+
+
+
@@ -216,7 +289,7 @@ int  diff --git a/d6/d7b/jump__search_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.map b/d6/d7b/jump__search_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.map new file mode 100644 index 000000000..096177b69 --- /dev/null +++ b/d6/d7b/jump__search_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/d6/d7b/jump__search_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.md5 b/d6/d7b/jump__search_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.md5 new file mode 100644 index 000000000..094d5b081 --- /dev/null +++ b/d6/d7b/jump__search_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.md5 @@ -0,0 +1 @@ +175f6e30064c05e79538752a9553ecbc \ No newline at end of file diff --git a/d6/d7b/jump__search_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg b/d6/d7b/jump__search_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg new file mode 100644 index 000000000..4684a9100 --- /dev/null +++ b/d6/d7b/jump__search_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg @@ -0,0 +1,37 @@ + + + + + + +test + + + +Node1 + + +test + + + + + +Node2 + + +jump_search + + + + + +Node1->Node2 + + + + + diff --git a/d6/d7b/jump__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d6/d7b/jump__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..c93cb1933 --- /dev/null +++ b/d6/d7b/jump__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/d6/d7b/jump__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d6/d7b/jump__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..74c6dc646 --- /dev/null +++ b/d6/d7b/jump__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +f304b3693614f74922e1b9696ad60526 \ No newline at end of file diff --git a/d6/d7b/jump__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d6/d7b/jump__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..ed147b4cf --- /dev/null +++ b/d6/d7b/jump__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,52 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +test + + + + + +Node1->Node2 + + + + + +Node3 + + +jump_search + + + + + +Node2->Node3 + + + + + diff --git a/d6/d88/problem__16_2sol1_8c.html b/d6/d88/problem__16_2sol1_8c.html index 38bf62098..97124e29b 100644 --- a/d6/d88/problem__16_2sol1_8c.html +++ b/d6/d88/problem__16_2sol1_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_16/sol1.c 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/d88/problem__16_2sol1_8c.html','../
-
-
sol1.c File Reference
+
sol1.c File Reference
-

Problem 16 solution +

Problem 16 solution More...

#include <math.h>
#include <stdint.h>
@@ -110,23 +109,105 @@ Include dependency graph for sol1.c:
- - - + +

+

Functions

-int main (int argc, char **argv)
 Main function.
int main (int argc, char **argv)
 Main function. More...
 

Detailed Description

-

Problem 16 solution

-
Author
Krishna Vedala
-
+

Problem 16 solution

+
Author
Krishna Vedala
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char ** argv 
)
+
+ +

Main function.

+
13{
+
14 const double tmp = log(10) / log(2); /* required to get number of digits */
+
15 unsigned long MAX_NUM_DIGITS;
+
16 uint8_t *digits =
+
17 NULL; /* array to store individual digits. index 0 = units place */
+
18 int N = 1000, sum = 0;
+
19
+
20 if (argc == 2)
+
21 N = atoi(argv[1]);
+
22
+
23 MAX_NUM_DIGITS = (N + tmp) / tmp;
+
24
+
25 digits = calloc(MAX_NUM_DIGITS, sizeof(uint8_t));
+
26 digits[0] = 1;
+
27
+
28 if (!digits)
+
29 {
+
30 perror("Unable to allocate memory!");
+
31 return -1;
+
32 }
+
33
+
34 for (int i = 0; i < N; i++)
+
35 {
+
36 int carry = 0;
+
37 for (int j = 0; j < MAX_NUM_DIGITS; j++)
+
38 {
+
39 digits[j] = (digits[j] << 1) + carry; /* digit * 2 + carry */
+
40 // printf("\t value: %d\t", digits[j]);
+
41 if (digits[j] > 9)
+
42 {
+
43 carry = 1;
+
44 digits[j] -= 10;
+
45 }
+
46 else
+
47 carry = 0;
+
48 // printf("carry: %d\t value: %d\n", carry, digits[j]);
+
49
+
50 /* accumulate sum for last multiplication */
+
51 if (i == N - 1)
+
52 sum += digits[j];
+
53 }
+
54 }
+
55
+
56 printf("2^%d = ", N);
+
57 for (int i = MAX_NUM_DIGITS - 1; i >= 0; i--) putchar(digits[i] + 0x30);
+
58 printf("\n\t Sum: %d\t Num. digits: %lu\n", sum, MAX_NUM_DIGITS);
+
59
+
60 free(digits);
+
61 return 0;
+
62}
+
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
+
#define calloc(elemCount, elemSize)
This macro replace the standard calloc function with calloc_dbg.
Definition: malloc_dbg.h:22
+
+
+
+ diff --git a/d6/d92/odd__even__sort_8c__incl.map b/d6/d92/odd__even__sort_8c__incl.map new file mode 100644 index 000000000..b35c86112 --- /dev/null +++ b/d6/d92/odd__even__sort_8c__incl.map @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/d6/d92/odd__even__sort_8c__incl.md5 b/d6/d92/odd__even__sort_8c__incl.md5 new file mode 100644 index 000000000..31b0c7d9c --- /dev/null +++ b/d6/d92/odd__even__sort_8c__incl.md5 @@ -0,0 +1 @@ +3a8e7f6ea8dc24e4adf6b3a089657da5 \ No newline at end of file diff --git a/d6/d92/odd__even__sort_8c__incl.svg b/d6/d92/odd__even__sort_8c__incl.svg new file mode 100644 index 000000000..1fe9fee2a --- /dev/null +++ b/d6/d92/odd__even__sort_8c__incl.svg @@ -0,0 +1,112 @@ + + + + + + +sorting/odd_even_sort.c + + + +Node1 + + +sorting/odd_even_sort.c + + + + + +Node2 + + +assert.h + + + + + +Node1->Node2 + + + + + +Node3 + + +stdbool.h + + + + + +Node1->Node3 + + + + + +Node4 + + +stdio.h + + + + + +Node1->Node4 + + + + + +Node5 + + +stdlib.h + + + + + +Node1->Node5 + + + + + +Node6 + + +time.h + + + + + +Node1->Node6 + + + + + +Node7 + + +inttypes.h + + + + + +Node1->Node7 + + + + + diff --git a/d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html b/d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html index 816e7570c..d11bb8e1d 100644 --- a/d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html +++ b/d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: CONTRIBUTION GUIDELINES @@ -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,228 +89,222 @@ $(document).ready(function(){initNavTree('d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.htm -
-
-
CONTRIBUTION GUIDELINES
+
+
CONTRIBUTION GUIDELINES

Before contributing

-

Welcome to TheAlgorithms/C! Before submitting pull requests, please make sure that you have read the whole guidelines. If you have any doubts about this contribution guide, please open an issue and clearly state your concerns.

+

Welcome to TheAlgorithms/C! Before submitting pull requests, please make sure that you have read the whole guidelines. If you have any doubts about this contribution guide, please open an issue or ask in our Discord server, and clearly state your concerns.

Contributing

-Maintainer/developer

-

If you are a maintainer of this repository, please consider the following:

-
    -
  • It is a protocol to contribute via pull requests.
      -
    • Reviewers will advise and guide you up to make the code refined and documented.
    • -
    -
  • -
  • When reviewing pull requests, be sure to:
      -
    • Be kind.
    • -
    • Be respectful.
    • -
    • Make useful suggestions/comments.
    • -
    • Be sure not to make invalid suggestions/comments.
    • -
    • Guide and advise up the pull request author.
    • -
    -
  • -
+Maintainer/reviewer +

Please check the reviewer code file for maintainers and reviewers.

Contributor

-

We are very happy that you consider implementing algorithms and data structures for others! This repository is referred to and used by learners from around the globe. Being one of our contributors, you agree and confirm that:

+

Being a contributor at The Algorithms, we request you to follow the points mentioned below:

  • You did your own work.
    • No plagiarism allowed. Any plagiarized work will not be merged.
  • -
  • Your work will be distributed under the GNU General Public License v3.0 once your pull request has been merged.
  • -
  • You submitted work fulfils or mostly fulfils our styles and standards.
  • +
  • Your work will be distributed under the GNU General Public License v3.0 once your pull request has been merged.
  • +
  • Please follow the repository guidelines and standards mentioned below.
-

New implementation New implementation are welcome!

-

Improving comments and adding tests to existing algorithms are much appreciated.

-

Issues Please avoid opening issues asking to be "assigned” to a particular algorithm. This merely creates unnecessary noise for maintainers. Instead, please submit your implementation in a pull request and it will be evaluated by project maintainers.

-

-Making Changes

-

-Code

-
    -
  • Please use the directory structure of the repository.
  • -
  • File extension for code should be *.h *.c
  • -
  • Organize your code using **struct** keywords
  • -
  • If an implementation of the algorithm already exists, please refer to the file-name section below.
  • -
  • You can suggest reasonable changes to existing algorithms.
  • -
  • Strictly use snake_case (underscore_separated) in filenames.
  • -
  • If you have added or modified code, please make sure the code compiles before submitting.
  • -
  • Our automated testing runs CMake on all pull requests so please be sure that your code passes before submitting.
  • -
  • Please conform to doxygen standard and document the code as much as possible. This not only facilitates the readers but also generates the correct info on website.
  • -
  • Be consistent in use of these guidelines.
  • -
-

-Documentation

-
    -
  • Make sure you put useful comments in your code. Do not comment things that are obvious.
  • -
  • Please avoid creating new directories if at all possible. Try to fit your work into the existing directory structure. If you want to create a new directory, then please check if a similar category has been recently suggested or created by other pull requests.
  • -
  • If you have modified/added documentation, please ensure that your language is concise and contains no grammar errors.
  • -
  • Do not update README.md along with other changes, first create an issue and then link to that issue in your pull request to suggest specific changes required to README.md
  • -
  • The repository follows Doxygen standards and auto-generates the repository website. Please ensure the code is documented in this structure. Sample implementation is given below.
  • -
-

-Test

-
    -
  • Make sure to add examples and test cases in your main() function.
  • -
  • If you find any algorithm or document without tests, please feel free to create a pull request or issue describing suggested changes.
  • -
  • Please try to add one or more test() functions that will invoke the algorithm implementation on random test data with expected output. Use assert() function to confirm that the tests will pass. Requires adding the assert.h library.
  • -
-

-Typical structure of a program

-
/**
-
* @file
-
* @brief Add one line description here
-
* @details
-
* This is a multi line
-
* description containing links, references,
-
* math equations, etc
-
* @author [Name](https://github.com/handle)
-
* @see related_file.c, another_file.c
-
*/
-
-
#include <assert.h>
-
#include
-
-
/**
-
* @brief Struct documentation
-
*/
-
struct struct_name {
-
int variable; ///< short info of this variable
-
char message; ///< short info
-
};
-
-
/**
-
* Function documentation
-
* @param param1 one-line info about param1
-
* @param param2 one-line info about param2
-
* @returns `true` if ...
-
* @returns `false` if ...
-
*/
-
bool func(int param1, int param2) {
-
// function statements here
-
if (/*something bad*/) {
-
return false;
-
}
-
-
return true;
-
}
-
-
/**
-
* @brief Test function
-
* @returns void
-
*/
-
static void test() {
-
/* desciptions of the following test */
-
assert(func(...) == ...); // this ensures that the algorithm works as expected
-
-
// can have multiple checks
-
}
-
-
/**
-
* @brief Main function
-
* @returns 0 on exit
-
*/
-
int main() {
-
test(); // execute the tests
-
// code here
-
return 0;
-
}
-
void func(int sockfd)
Continuous loop to send and receive over the socket.
Definition: client.c:37
-
int main()
Driver code.
Definition: client.c:70
-
void test()
Test function.
Definition: decimal_to_binary_recursion.c:20
-

-File name guidelines

-
    -
  • Use lowercase words with "_" as separator
  • -
  • For instance
  • -
-
MyNewCStruct.C is incorrect
-
my_new_c_struct.c is correct format
-
    -
  • It will be used to dynamically create a directory of files and implementation.
  • -
  • File name validation will run on docker to ensure the validity.
  • -
  • If an implementation of the algorithm already exists and your version is different from that implemented, please use incremental numeric digit as a suffix. For example, if median_search.c already exists in the search folder and you are contributing a new implementation, the filename should be median_search2.c and for a third implementation, median_search3.c.
  • -
-

-Directory guidelines

-
    -
  • We recommend adding files to existing directories as much as possible.
  • -
  • Use lowercase words with "_" as separator ( no spaces or "-" allowed )
  • -
  • For instance
  • -
-
SomeNew Fancy-Category is incorrect
-
some_new_fancy_category is correct
-
    -
  • Filepaths will be used to dynamically create a directory of our algorithms.
  • -
  • Filepath validation will run on GitHub Actions to ensure compliance.
  • -
-

-Commit Guidelines

-
    -
  • It is recommended to keep your changes grouped logically within individual commits. Maintainers find it easier to understand changes that are logically spilt across multiple commits. Try to modify just one or two files in the same directory. Pull requests that span multiple directories are often rejected.
  • -
-
git add file_xyz.c
-
git commit -m "your message"
-

Examples of commit messages with semantic prefixes:

-
fix: xyz algorithm bug
-
feat: add xyx algorithm, struct xyz
-
test: add test for xyz algorithm
-
docs: add comments and explanation to xyz algorithm
-

Common prefixes:

-
    -
  • fix: A bug fix
  • -
  • feat: A new feature
  • -
  • docs: Documentation changes
  • -
  • test: Correct existing tests or add new ones
  • -
-

-Pull Requests

- -

-Building Locally

-

Before submitting a pull request, build the code locally or using the convenient Gitpod Ready-to-Code service.

-
cmake -B build -S .
-

-Static Code Analyzer

-

We use clang-tidy as a static code analyzer with a configuration in .clang-tidy.

-
clang-tidy --fix --quiet -p build subfolder/file_to_check.c --
-

-Code Formatter

-

clang-format is used for code forrmating.

-
    -
  • Installation (only needs to be installed once.)
      -
    • Mac (using home-brew): brew install clang-format
    • -
    • Mac (using macports): sudo port install clang-10 +analyzer
    • -
    • Windows (MSYS2 64-bit): pacman -S mingw-w64-x86_64-clang-tools-extra
    • -
    • Linux (Debian): sudo apt-get install clang-format-10 clang-tidy-10
    • -
    -
  • -
  • Running (all platforms): clang-format -i -style="file" my_file.c
  • -
-

-GitHub Actions

-
    -
  • Enable GitHub Actions on your fork of the repository. After enabling it will execute clang-tidy and clang-format after every a push (not a commit).
      -
    • Click on the tab "Actions", then click on the big green button to enable it.
    • -
    -
  • -
-

GitHub Actions

+

New implementation New implementations are welcome!

+

You can add new algorithms or data structures which are not present in the repository or that can improve the old implementations (documentation, improving test cases, removing bugs or in any other resonable sense)

+

Issues Please avoid opening issues asking to be "assigned” to a particular algorithm. This merely creates unnecessary noise for maintainers. Instead, please submit your implementation in a pull request, and it will be evaluated by project maintainers. + +@subsection autotoc_md17 Making Changes + +@subsubsection autotoc_md18 Code + +- Please use the directory structure of the repository. +- Make sure the file extensions should be <tt>*.h</tt> <tt>*.c</tt> +- Organize your code using the **<tt>struct</tt>** keyword +- If an implementation of the algorithm already exists, please refer to the <a href="#file-name-guidelines" target="_blank" >file-name section below</a>. +- You can suggest reasonable changes to existing algorithms. +- Strictly use snake_case (underscore_separated) in filenames. +- If you have added or modified code, please make sure the code compiles before submitting. +- Our automated testing runs <a href="https://cmake.org/" target="_blank" ><strong>CMake</strong></a> on all the pull requests, so please be sure that your code passes before submitting. +- Please conform to <a href="https://www.doxygen.nl/manual/docblocks.html" target="_blank" >Doxygen</a> standard and document the code as much as possible. This not only facilitates the readers but also generates the correct info on website. +- <strong>Be consistent in the use of these guidelines.</strong> + +@subsubsection autotoc_md19 Documentation + +- Make sure you put useful comments in your code. Do not comment on obvious things. +- Please avoid creating new directories if at all possible. Try to fit your work into the existing directory structure. If you want to create a new directory, then please check if a similar category has been recently suggested or created by other pull requests. +- If you have modified/added documentation, please ensure that your language is concise and must not contain grammatical errors. +- Do not update <a href="https://github.com/TheAlgorithms/C/blob/master/README.md" target="_blank" ><tt>README.md</tt></a> along with other changes. First, create an issue and then link to that issue in your pull request to suggest specific changes required to <a href="https://github.com/TheAlgorithms/C/blob/master/README.md" target="_blank" ><tt>README.md</tt></a>. +- The repository follows <a href="https://www.doxygen.nl/manual/docblocks.html" target="_blank" >Doxygen</a> standards and auto-generates the <a href="https://thealgorithms.github.io/C" target="_blank" >repository website</a>. Please ensure the code is documented in this structure. A sample implementation is given below. + +@subsubsection autotoc_md20 Test + +- Make sure to add examples and test cases in your <tt>main()</tt> function. +- If you find an algorithm or document without tests, please feel free to create a pull request or issue describing suggested changes. +- Please try to add one or more <tt>test()</tt> functions that will invoke the algorithm implementation on random test data with the expected output. Use the <tt>assert()</tt> function to confirm that the tests will pass. Requires including the <tt>assert.h</tt> library. + +@subsubsection autotoc_md21 Typical structure of a program + +@code{c} +/** + * @file + * @brief Add one line description here + * @details + * This is a multi-line + * description containing links, references, + * math equations, etc. + * @author [Name](https://github.com/handle) + * @see related_file.c, another_file.c + */ + +#include <assert.h> /// for assert +#include /// for `some function here` + +/** + * @brief Struct documentation + */ +struct struct_name { + int variable; ///< short info of this variable + char message; ///< short info +}; + +/** + * @brief Function documentation + * @param param1 one-line info about param1 + * @param param2 one-line info about param2 + * @returns `true` if ... + * @returns `false` if ... + */ +bool func(int param1, int param2) { + // function statements here + if (/*something bad*/) { + return false; + } + + return true; +} + +/** + * @brief Self-test implementations + * @returns void + */ +static void test() { + /* desciptions of the following test */ + assert(func(...) == ...); // this ensures that the algorithm works as expected + + // can have multiple checks +} + +/** + * @brief Main function + * @returns 0 on exit + */ +int main() { + test(); // run self-test implementations + // code here + return 0; +} +@endcode + +@subsubsection autotoc_md22 File name guidelines + +- Use lowercase words with <tt>"_"</tt> as a separator +- For instance + +@code{markdown} +MyNewCStruct.C is incorrect +my_new_c_struct.c is correct format +@endcode + +- It will be used to dynamically create a directory of files and implementation. +- File name validation will run on Docker to ensure validity. +- If an implementation of the algorithm already exists and your version is different from that implemented, please use incremental numeric digit as a suffix. For example: if <tt>median_search.c</tt> already exists in the <tt>search</tt> folder, and you are contributing a new implementation, the filename should be <tt>median_search2.c</tt> and for a third implementation, <tt>median_search3.c</tt>. + +@subsubsection autotoc_md23 Directory guidelines + +- We recommend adding files to existing directories as much as possible. +- Use lowercase words with <tt>"_"</tt> as separator ( no spaces or <tt>"-"</tt> allowed ) +- For instance + +@code{markdown} +SomeNew Fancy-Category is incorrect +some_new_fancy_category is correct +@endcode + +- Filepaths will be used to dynamically create a directory of our algorithms. +- Filepath validation will run on GitHub Actions to ensure compliance. + +@subsubsection autotoc_md24 Commit Guidelines + +- It is recommended to keep your changes grouped logically within individual commits. Maintainers find it easier to understand changes that are logically spilt across multiple commits. Try to modify just one or two files in the same directory. Pull requests that span multiple directories are often rejected. + +@code{bash} +git add file_xyz.c +git commit -m "your message" +@endcode + +Examples of commit messages with semantic prefixes: + +@code{markdown} +fix: xyz algorithm bug +feat: add xyx algorithm, struct xyz +test: add test for xyz algorithm +docs: add comments and explanation to xyz algorithm +@endcode + +Common prefixes: + +- fix: A bug fix +- feat: A new feature +- docs: Documentation changes +- test: Correct existing tests or add new ones + +@subsection autotoc_md25 Pull Requests + +- Checkout our <a href="https://github.com/TheAlgorithms/C/blob/master/.github/pull_request_template.md" target="_blank" >pull request template</a> + +@subsubsection autotoc_md26 Building Locally + +Before submitting a pull request, build the code locally or using the convenient <a href="https://gitpod.io/#https://github.com/TheAlgorithms/C" target="_blank" ><img src="https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod" alt="Gitpod Ready-to-Code"/></a> service. + +@code{bash} +cmake -B build -S . +@endcode + +@subsubsection autotoc_md27 Static Code Analyzer + +We use <a href="https://clang.llvm.org/extra/clang-tidy/" target="_blank" >clang-tidy</a> as a static code analyzer with a configuration in <a href=".clang-tidy" target="_blank" >.clang-tidy</a>. + +@code{bash} +clang-tidy --fix --quiet -p build subfolder/file_to_check.c -- +@endcode + +@subsubsection autotoc_md28 Code Formatter + +<a href="https://clang.llvm.org/docs/ClangFormat.html" target="_blank" ><strong>clang-format</strong></a> is used for code forrmating. + +- Installation (only needs to be installed once.) + - Mac (using home-brew): <tt>brew install clang-format</tt> + - Mac (using macports): <tt>sudo port install clang-10 +analyzer</tt> + - Windows (MSYS2 64-bit): <tt>pacman -S mingw-w64-x86_64-clang-tools-extra</tt> + - Linux (Debian): <tt>sudo apt-get install clang-format-10 clang-tidy-10</tt> +- Running (all platforms): <tt>clang-format -i -style="file" my_file.c</tt> + +@subsubsection autotoc_md29 GitHub Actions + +- Enable GitHub Actions on your fork of the repository. +After enabling, it will execute <tt>clang-tidy</tt> and <tt>clang-format</tt> after every a push (not a commit). + - Click on the tab "Actions", then click on the big green button to enable it. + +<img src="https://user-images.githubusercontent.com/51391473/94609466-6e925100-0264-11eb-9d6f-3706190eab2b.png" alt="GitHub Actions"/>

  • The result can create another commit if the actions made any changes on your behalf.
  • Hence, it is better to wait and check the results of GitHub Actions after every push.
  • -
  • Run git pull in your local clone if these actions made many changes in order to avoid merge conflicts.
  • +
  • Run git pull in your local clone if these actions made many changes to avoid merge conflicts.
-

Most importantly,

+

Most importantly,

  • Happy coding!
@@ -320,7 +314,7 @@ GitHub Actions diff --git a/d6/ddc/segment__tree_8c__incl.map b/d6/ddc/segment__tree_8c__incl.map index 97439a2b9..1aa8d6ac5 100644 --- a/d6/ddc/segment__tree_8c__incl.map +++ b/d6/ddc/segment__tree_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/d6/ddc/segment__tree_8c__incl.svg b/d6/ddc/segment__tree_8c__incl.svg index 90c9d5a12..fe150eae1 100644 --- a/d6/ddc/segment__tree_8c__incl.svg +++ b/d6/ddc/segment__tree_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - -data_structures/binary + +data_structures/binary _trees/segment_tree.c diff --git a/d6/ded/shell__sort2_8c.html b/d6/ded/shell__sort2_8c.html index 16c3f0ba2..a4c90c3b2 100644 --- a/d6/ded/shell__sort2_8c.html +++ b/d6/ded/shell__sort2_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: sorting/shell_sort2.c 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/ded/shell__sort2_8c.html','../../')
-
-
shell_sort2.c File Reference
+
shell_sort2.c File Reference
-

Shell sort algorithm implementation. +

Shell sort algorithm implementation. More...

#include <stdio.h>
#include <stdlib.h>
@@ -109,33 +108,103 @@ Include dependency graph for shell_sort2.c:
- - - + + - + - - + +

+

Functions

-void show_data (int *arr, long len)
 Helper function to print array values.
void show_data (int *arr, long len)
 Helper function to print array values. More...
 
void swap (int *a, int *b)
 Swap two integer variables. More...
 
void shell_sort (int *array, long LEN)
void shell_sort (int *array, long LEN)
 Shell sort algorithm. More...
 
-int main (int argc, char *argv[])
 Main function.
int main (int argc, char *argv[])
 Main function. More...
 

Detailed Description

-

Shell sort algorithm implementation.

-
Author
Krishna Vedala
-
+

Shell sort algorithm implementation.

+
Author
Krishna Vedala
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char * argv[] 
)
+
+ +

Main function.

+
67{
+
68 int i;
+
69 long size = 500;
+
70 if (argc == 2)
+
71 size = atol(argv[1]);
+
72 else if (argc > 2)
+
73 fprintf(stderr, "Usage: ./shell_sort [number of values]\n");
+
74
+
75 int *array = (int *)malloc(size * sizeof(int));
+
76 int range = 500; // range of array values
+
77 double time_spent;
+
78
+
79 srand(time(NULL)); // initialize random number generator
+
80 for (i = 0; i < size; i++)
+
81 // fill array with random integers
+
82 array[i] = rand() % range + 1;
+
83
+
84 show_data(array, size); // show array before sorting
+
85 clock_t t1 = clock(); // start timer
+
86 shell_sort(array, size); // sort the array
+
87 clock_t t2 = clock(); // end timer
+
88
+
89 printf("Data Sorted\n");
+
90 show_data(array, size); // display array after sorting
+
91
+
92 printf("Time spent sorting: %.4g s\n", (t2 - t1) / CLOCKS_PER_SEC);
+
93
+
94 free(array);
+
95 return 0;
+
96}
+
void shell_sort(int *array, long LEN)
Shell sort algorithm.
Definition: shell_sort2.c:41
+
void show_data(int *arr, long len)
Helper function to print array values.
Definition: shell_sort2.c:16
+
#define malloc(bytes)
This macro replace the standard malloc function with malloc_dbg.
Definition: malloc_dbg.h:18
+
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
+
Definition: prime_factoriziation.c:25
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ diff --git a/d6/ded/shell__sort2_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map b/d6/ded/shell__sort2_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map new file mode 100644 index 000000000..764a94cba --- /dev/null +++ b/d6/ded/shell__sort2_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/d6/ded/shell__sort2_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 b/d6/ded/shell__sort2_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 new file mode 100644 index 000000000..7720d93ea --- /dev/null +++ b/d6/ded/shell__sort2_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 @@ -0,0 +1 @@ +856788b216eea5365f97b31e8006eacc \ No newline at end of file diff --git a/d6/ded/shell__sort2_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg b/d6/ded/shell__sort2_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg new file mode 100644 index 000000000..a627739ca --- /dev/null +++ b/d6/ded/shell__sort2_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg @@ -0,0 +1,52 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +shell_sort + + + + + +Node1->Node2 + + + + + +Node3 + + +show_data + + + + + +Node1->Node3 + + + + + diff --git a/d6/df3/graph_8h_source.html b/d6/df3/graph_8h_source.html index ae0132600..2a382dc30 100644 --- a/d6/df3/graph_8h_source.html +++ b/d6/df3/graph_8h_source.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: data_structures/graphs/graph.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,55 +90,54 @@ $(document).ready(function(){initNavTree('d6/df3/graph_8h_source.html','../../')
-
-
graph.h
+
graph.h
-
1 // Graph ADT interface ... COMP2521
-
2 #include <stdbool.h>
-
3 
-
4 typedef struct GraphRep *Graph;
-
5 
-
6 // vertices are ints
-
7 typedef int Vertex;
-
8 
-
9 // edges are pairs of vertices (end-points)
-
10 typedef struct Edge
-
11 {
-
12  Vertex v;
-
13  Vertex w;
-
14 } Edge;
-
15 
-
16 Graph newGraph(int);
-
17 void insertEdge(Graph, Edge);
-
18 void removeEdge(Graph, Edge);
-
19 bool adjacent(Graph, Vertex, Vertex);
-
20 void showGraph(Graph);
-
21 void freeGraph(Graph);
-
22 
-
23 // By
-
24 // .----------------. .----------------. .----------------.
-
25 // .-----------------. .----------------. .----------------.
-
26 // | .--------------. || .--------------. || .--------------. ||
-
27 // .--------------. | | .--------------. || .--------------. | | | _________ |
-
28 // || | _____ _____ | || | __ | || | ____ _____ | | | | ____ ____
-
29 // | || | ____ | | | | | _ _ | | || ||_ _||_ _|| || | / \
-
30 // | || ||_ \|_ _| | | | | |_ || _| | || | .' `. | | | | |_/ | |
-
31 // \_| | || | | | | | | || | / /\ \ | || | | \ | | | | | | |
-
32 // |__| | | || | / .--. \ | | | | | | | || | | ' ' | | || |
-
33 // / ____ \ | || | | |\ \| | | | | | | __ | | || | | | | | | |
-
34 // | | _| |_ | || | \ `--' / | || | _/ / \ \_ | || | _| |_\ |_
-
35 // | | | | _| | | |_ | || | \ `--' / | | | | |_____| | || | `.__.'
-
36 // | || ||____| |____|| || ||_____|\____| | | | | |____||____| | || | `.____.'
-
37 // | | | | | || | | || | | || | | | | |
-
38 // | || | | | | '--------------' || '--------------' ||
-
39 // '--------------' || '--------------' | | '--------------' || '--------------'
-
40 // |
-
41 // '----------------' '----------------' '----------------'
-
42 // '----------------' '----------------' '----------------'
-
43 
-
44 // Email : z5261243@unsw.edu.au
-
45 // hhoanhtuann@gmail.com
+
1// Graph ADT interface ... COMP2521
+
2#include <stdbool.h>
+
3
+
4typedef struct GraphRep *Graph;
+
5
+
6// vertices are ints
+
7typedef int Vertex;
+
8
+
9// edges are pairs of vertices (end-points)
+
10typedef struct Edge
+
11{
+
12 Vertex v;
+
13 Vertex w;
+
14} Edge;
+
15
+
16Graph newGraph(int);
+
17void insertEdge(Graph, Edge);
+
18void removeEdge(Graph, Edge);
+
19bool adjacent(Graph, Vertex, Vertex);
+
20void showGraph(Graph);
+
21void freeGraph(Graph);
+
22
+
23// By
+
24// .----------------. .----------------. .----------------.
+
25// .-----------------. .----------------. .----------------.
+
26// | .--------------. || .--------------. || .--------------. ||
+
27// .--------------. | | .--------------. || .--------------. | | | _________ |
+
28// || | _____ _____ | || | __ | || | ____ _____ | | | | ____ ____
+
29// | || | ____ | | | | | _ _ | | || ||_ _||_ _|| || | / \
+
30// | || ||_ \|_ _| | | | | |_ || _| | || | .' `. | | | | |_/ | |
+
31// \_| | || | | | | | | || | / /\ \ | || | | \ | | | | | | |
+
32// |__| | | || | / .--. \ | | | | | | | || | | ' ' | | || |
+
33// / ____ \ | || | | |\ \| | | | | | | __ | | || | | | | | | |
+
34// | | _| |_ | || | \ `--' / | || | _/ / \ \_ | || | _| |_\ |_
+
35// | | | | _| | | |_ | || | \ `--' / | | | | |_____| | || | `.__.'
+
36// | || ||____| |____|| || ||_____|\____| | | | | |____||____| | || | `.____.'
+
37// | | | | | || | | || | | || | | | | |
+
38// | || | | | | '--------------' || '--------------' ||
+
39// '--------------' || '--------------' | | '--------------' || '--------------'
+
40// |
+
41// '----------------' '----------------' '----------------'
+
42// '----------------' '----------------' '----------------'
+
43
+
44// Email : z5261243@unsw.edu.au
+
45// hhoanhtuann@gmail.com
Definition: bellman_ford.c:8
Definition: bellman_ford.c:14
Definition: graph.c:9
@@ -148,7 +147,7 @@ $(document).ready(function(){initNavTree('d6/df3/graph_8h_source.html','../../') diff --git a/d6/df6/hash__djb2_8c__incl.map b/d6/df6/hash__djb2_8c__incl.map index fabbefc13..422b39440 100644 --- a/d6/df6/hash__djb2_8c__incl.map +++ b/d6/df6/hash__djb2_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/d6/df6/hash__djb2_8c__incl.svg b/d6/df6/hash__djb2_8c__incl.svg index f10f82623..7253e424e 100644 --- a/d6/df6/hash__djb2_8c__incl.svg +++ b/d6/df6/hash__djb2_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - + hash/hash_djb2.c diff --git a/d7/d0a/fibonacci__fast_8c__incl.map b/d7/d0a/fibonacci__fast_8c__incl.map index 9a848064b..496f0d93d 100644 --- a/d7/d0a/fibonacci__fast_8c__incl.map +++ b/d7/d0a/fibonacci__fast_8c__incl.map @@ -1,6 +1,6 @@ - - - - + + + + diff --git a/d7/d0a/fibonacci__fast_8c__incl.svg b/d7/d0a/fibonacci__fast_8c__incl.svg index c43df89dd..26c01976a 100644 --- a/d7/d0a/fibonacci__fast_8c__incl.svg +++ b/d7/d0a/fibonacci__fast_8c__incl.svg @@ -1,20 +1,20 @@ - - + misc/fibonacci_fast.c - + Node1 - -misc/fibonacci_fast.c + +misc/fibonacci_fast.c @@ -22,46 +22,46 @@ Node2 - -locale.h + +locale.h Node1->Node2 - - + + Node3 - -stdio.h + +stdio.h Node1->Node3 - - + + Node4 - -stdlib.h + +stdlib.h Node1->Node4 - - + + diff --git a/d7/d0c/hash__sdbm_8c.html b/d7/d0c/hash__sdbm_8c.html index 1c132e745..e19d2bde7 100644 --- a/d7/d0c/hash__sdbm_8c.html +++ b/d7/d0c/hash__sdbm_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: hash/hash_sdbm.c 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('d7/d0c/hash__sdbm_8c.html','../../');
-
-
hash_sdbm.c File Reference
+
hash_sdbm.c File Reference
-

SDBM hash algorithm +

SDBM hash algorithm More...

#include <assert.h>
#include <inttypes.h>
@@ -109,7 +108,7 @@ Include dependency graph for hash_sdbm.c:
- @@ -117,21 +116,52 @@ Functions - - + +

+

Functions

uint64_t sdbm (const char *s)
 SDBM algorithm implementation. More...
void test_sdbm ()
 Test function for sdbm. More...
 
-int main ()
 Main function.
int main ()
 Main function. More...
 

Detailed Description

- +

Function Documentation

+ +

◆ main()

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

Main function.

+
47{
+
48 test_sdbm();
+
49 return 0;
+
50}
+
void test_sdbm()
Test function for sdbm.
Definition: hash_sdbm.c:34
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ diff --git a/d7/d0c/hash__sdbm_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d7/d0c/hash__sdbm_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..1f3ec9dd0 --- /dev/null +++ b/d7/d0c/hash__sdbm_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/d7/d0c/hash__sdbm_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d7/d0c/hash__sdbm_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..ca72f412a --- /dev/null +++ b/d7/d0c/hash__sdbm_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +174feffbf7e19274a863386ce5e55e89 \ No newline at end of file diff --git a/d7/d0c/hash__sdbm_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d7/d0c/hash__sdbm_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..0cbd03cee --- /dev/null +++ b/d7/d0c/hash__sdbm_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,52 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +test_sdbm + + + + + +Node1->Node2 + + + + + +Node3 + + +sdbm + + + + + +Node2->Node3 + + + + + diff --git a/d7/d1f/problem__12_2sol1_8c.html b/d7/d1f/problem__12_2sol1_8c.html index b4947dc13..88cc2d596 100644 --- a/d7/d1f/problem__12_2sol1_8c.html +++ b/d7/d1f/problem__12_2sol1_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_12/sol1.c 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('d7/d1f/problem__12_2sol1_8c.html','../
-
-
sol1.c File Reference
+
sol1.c File Reference
-

Problem 12 solution +

Problem 12 solution More...

#include <math.h>
#include <stdio.h>
@@ -109,21 +108,20 @@ Include dependency graph for sol1.c:
- - - + +

+

Functions

long count_divisors (long long n)
 Get number of divisors of a given number. More...
 
-int main (int argc, char **argv)
 Main function.
int main (int argc, char **argv)
 Main function. More...
 

Detailed Description

-

Problem 12 solution

-
Author
Krishna Vedala
+

Problem 12 solution

+
Author
Krishna Vedala

Function Documentation

- +

◆ count_divisors()

@@ -140,19 +138,78 @@ int 

Get number of divisors of a given number.

-

If \(x = a \times b\), then both \(a\) and \(b\) are divisors of \(x\). Since multiplication is commutative, we only need to search till a maximum of \(a=b = a^2\) i.e., till \(\sqrt{x}\). At every integer till then, there are eaxctly 2 divisors and at \(a=b\), there is only one divisor.

-
20 {
-
21  long num_divisors = 0;
-
22 
-
23  for (long long i = 1; i < sqrtl(n) + 1; i++)
-
24  if (n % i == 0)
-
25  num_divisors += 2;
-
26  else if (i * i == n)
-
27  num_divisors += 1;
-
28 
-
29  return num_divisors;
-
30 }
+

If \(x = a \times b\), then both \(a\) and \(b\) are divisors of \(x\). Since multiplication is commutative, we only need to search till a maximum of \(a=b = a^2\) i.e., till \(\sqrt{x}\). At every integer till then, there are eaxctly 2 divisors and at \(a=b\), there is only one divisor.

+
20{
+
21 long num_divisors = 0;
+
22
+
23 for (long long i = 1; i < sqrtl(n) + 1; i++)
+
24 if (n % i == 0)
+
25 num_divisors += 2;
+
26 else if (i * i == n)
+
27 num_divisors += 1;
+
28
+
29 return num_divisors;
+
30}
+
+
+ +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char ** argv 
)
+
+ +

Main function.

+
34{
+
35 int MAX_DIVISORS = 500;
+
36 long i = 1, num_divisors;
+
37 long long triangle_number = 1;
+
38
+
39 if (argc == 2)
+
40 MAX_DIVISORS = atoi(argv[1]);
+
41
+
42 while (1)
+
43 {
+
44 i++;
+
45 triangle_number += i;
+
46 num_divisors = count_divisors(triangle_number);
+
47 if (num_divisors > MAX_DIVISORS)
+
48 break;
+
49 }
+
50
+
51 printf("First Triangle number with more than %d divisors: %lld\n",
+
52 MAX_DIVISORS, triangle_number);
+
53
+
54 return 0;
+
55}
+
long count_divisors(long long n)
Get number of divisors of a given number.
Definition: sol1.c:19
+
+Here is the call graph for this function:
+
+
+
+
+
@@ -161,7 +218,7 @@ int  diff --git a/d7/d1f/problem__12_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map b/d7/d1f/problem__12_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map new file mode 100644 index 000000000..17767add0 --- /dev/null +++ b/d7/d1f/problem__12_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/d7/d1f/problem__12_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 b/d7/d1f/problem__12_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 new file mode 100644 index 000000000..492a04850 --- /dev/null +++ b/d7/d1f/problem__12_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 @@ -0,0 +1 @@ +9a43a46c36e619b982b81e5380ecae78 \ No newline at end of file diff --git a/d7/d1f/problem__12_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg b/d7/d1f/problem__12_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg new file mode 100644 index 000000000..7789c0f73 --- /dev/null +++ b/d7/d1f/problem__12_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg @@ -0,0 +1,37 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +count_divisors + + + + + +Node1->Node2 + + + + + diff --git a/d7/d3b/group__hash.html b/d7/d3b/group__hash.html index 52cd876e2..3f59cf851 100644 --- a/d7/d3b/group__hash.html +++ b/d7/d3b/group__hash.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Hash algorithms @@ -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,30 +93,29 @@ $(document).ready(function(){initNavTree('d7/d3b/group__hash.html','../../'); in -
-
Hash algorithms
+
Hash algorithms
- - + - + - + - + - +

+

Files

file  hash_adler32.c
 32-bit Adler hash algorithm
 32-bit Adler hash algorithm
 
file  hash_crc32.c
 32-bit CRC hash algorithm
 32-bit CRC hash algorithm
 
file  hash_djb2.c
 DJB2 hash algorithm
 DJB2 hash algorithm
 
file  hash_sdbm.c
 SDBM hash algorithm
 SDBM hash algorithm
 
file  hash_xor8.c
 8-bit XOR hash algorithm for ASCII characters
 8-bit XOR hash algorithm for ASCII characters
 
- @@ -151,7 +150,7 @@ Functions

+

Functions

uint32_t adler32 (const char *s)
 32-bit Adler algorithm implementation More...

Detailed Description

Function Documentation

- +

◆ adler32()

@@ -175,24 +174,24 @@ Functions
Returns
32-bit hash result
-
19 {
-
20  uint32_t a = 1;
-
21  uint32_t b = 0;
-
22  const uint32_t MODADLER = 65521;
-
23 
-
24  size_t i = 0;
-
25  while (s[i] != '\0')
-
26  {
-
27  a = (a + s[i]) % MODADLER;
-
28  b = (b + a) % MODADLER;
-
29  i++;
-
30  }
-
31  return (b << 16) | a;
-
32 }
+
19{
+
20 uint32_t a = 1;
+
21 uint32_t b = 0;
+
22 const uint32_t MODADLER = 65521;
+
23
+
24 size_t i = 0;
+
25 while (s[i] != '\0')
+
26 {
+
27 a = (a + s[i]) % MODADLER;
+
28 b = (b + a) % MODADLER;
+
29 i++;
+
30 }
+
31 return (b << 16) | a;
+
32}
- +

◆ crc32()

@@ -216,26 +215,26 @@ Functions
Returns
32-bit hash result
-
21 {
-
22  uint32_t crc = 0xffffffff;
-
23  size_t i = 0;
-
24  while (s[i] != '\0')
-
25  {
-
26  uint8_t byte = s[i];
-
27  crc = crc ^ byte;
-
28  for (uint8_t j = 8; j > 0; --j)
-
29  {
-
30  crc = (crc >> 1) ^ (0xEDB88320 & (-(crc & 1)));
-
31  }
-
32 
-
33  i++;
-
34  }
-
35  return crc ^ 0xffffffff;
-
36 }
+
21{
+
22 uint32_t crc = 0xffffffff;
+
23 size_t i = 0;
+
24 while (s[i] != '\0')
+
25 {
+
26 uint8_t byte = s[i];
+
27 crc = crc ^ byte;
+
28 for (uint8_t j = 8; j > 0; --j)
+
29 {
+
30 crc = (crc >> 1) ^ (0xEDB88320 & (-(crc & 1)));
+
31 }
+
32
+
33 i++;
+
34 }
+
35 return crc ^ 0xffffffff;
+
36}
- +

◆ djb2()

@@ -259,20 +258,20 @@ Functions
Returns
64-bit hash result
-
19 {
-
20  uint64_t hash = 5381; /* init value */
-
21  size_t i = 0;
-
22  while (s[i] != '\0')
-
23  {
-
24  hash = ((hash << 5) + hash) + s[i];
-
25  i++;
-
26  }
-
27  return hash;
-
28 }
+
19{
+
20 uint64_t hash = 5381; /* init value */
+
21 size_t i = 0;
+
22 while (s[i] != '\0')
+
23 {
+
24 hash = ((hash << 5) + hash) + s[i];
+
25 i++;
+
26 }
+
27 return hash;
+
28}
- +

◆ sdbm()

@@ -296,20 +295,20 @@ Functions
Returns
64-bit hash result
-
19 {
-
20  uint64_t hash = 0;
-
21  size_t i = 0;
-
22  while (s[i] != '\0')
-
23  {
-
24  hash = s[i] + (hash << 6) + (hash << 16) - hash;
-
25  i++;
-
26  }
-
27  return hash;
-
28 }
+
19{
+
20 uint64_t hash = 0;
+
21 size_t i = 0;
+
22 while (s[i] != '\0')
+
23 {
+
24 hash = s[i] + (hash << 6) + (hash << 16) - hash;
+
25 i++;
+
26 }
+
27 return hash;
+
28}
- +

◆ test_adler32()

@@ -326,24 +325,24 @@ Functions

Test function for adler32.

Returns
None
-
39 {
-
40  assert(adler32("Hello World") == 403375133);
-
41  assert(adler32("Hello World!") == 474547262);
-
42  assert(adler32("Hello world") == 413860925);
-
43  assert(adler32("Hello world!") == 487130206);
-
44  printf("Tests passed\n");
-
45 }
+
39{
+
40 assert(adler32("Hello World") == 403375133);
+
41 assert(adler32("Hello World!") == 474547262);
+
42 assert(adler32("Hello world") == 413860925);
+
43 assert(adler32("Hello world!") == 487130206);
+
44 printf("Tests passed\n");
+
45}
uint32_t adler32(const char *s)
32-bit Adler algorithm implementation
Definition: hash_adler32.c:18
Here is the call graph for this function:
-
+
- +

◆ test_crc32()

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

Test function for crc32.

Returns
None
-
43 {
-
44  assert(crc32("Hello World") == 1243066710);
-
45  assert(crc32("Hello World!") == 472456355);
-
46  assert(crc32("Hello world") == 2346098258);
-
47  assert(crc32("Hello world!") == 461707669);
-
48  // printf("%" PRIu32 "\n", crc32("Hello World"));
-
49  // printf("%" PRIu32 "\n", crc32("Hello World!"));
-
50  // printf("%" PRIu32 "\n", crc32("Hello world"));
-
51  // printf("%" PRIX32 "\n", crc32("Hello world!"));
-
52  printf("Tests passed\n");
-
53 }
+
43{
+
44 assert(crc32("Hello World") == 1243066710);
+
45 assert(crc32("Hello World!") == 472456355);
+
46 assert(crc32("Hello world") == 2346098258);
+
47 assert(crc32("Hello world!") == 461707669);
+
48 printf("Tests passed\n");
+
49}
uint32_t crc32(const char *s)
32-bit CRC algorithm implementation
Definition: hash_crc32.c:20
Here is the call graph for this function:
-
+
- +

◆ test_djb2()

@@ -399,24 +394,24 @@ Here is the call graph for this function:

Test function for djb2.

Returns
none
-
35 {
-
36  assert(djb2("Hello World") == 13827776004929097857);
-
37  assert(djb2("Hello World!") == 13594750393630990530);
-
38  assert(djb2("Hello world") == 13827776004967047329);
-
39  assert(djb2("Hello world!") == 13594750394883323106);
-
40  printf("Tests passed\n");
-
41 }
+
35{
+
36 assert(djb2("Hello World") == 13827776004929097857);
+
37 assert(djb2("Hello World!") == 13594750393630990530);
+
38 assert(djb2("Hello world") == 13827776004967047329);
+
39 assert(djb2("Hello world!") == 13594750394883323106);
+
40 printf("Tests passed\n");
+
41}
uint64_t djb2(const char *s)
DJB2 algorithm implementation.
Definition: hash_djb2.c:18
Here is the call graph for this function:
-
+
- +

◆ test_sdbm()

@@ -433,24 +428,24 @@ Here is the call graph for this function:

Test function for sdbm.

Returns
None
-
35 {
-
36  assert(sdbm("Hello World") == 12881824461405877380U);
-
37  assert(sdbm("Hello World!") == 7903571203300273309);
-
38  assert(sdbm("Hello world") == 15154913742888948900U);
-
39  assert(sdbm("Hello world!") == 15254999417003201661U);
-
40  printf("Tests passed\n");
-
41 }
+
35{
+
36 assert(sdbm("Hello World") == 12881824461405877380U);
+
37 assert(sdbm("Hello World!") == 7903571203300273309);
+
38 assert(sdbm("Hello world") == 15154913742888948900U);
+
39 assert(sdbm("Hello world!") == 15254999417003201661U);
+
40 printf("Tests passed\n");
+
41}
uint64_t sdbm(const char *s)
SDBM algorithm implementation.
Definition: hash_sdbm.c:18
Here is the call graph for this function:
-
+
- +

◆ test_xor8()

@@ -467,24 +462,24 @@ Here is the call graph for this function:

Test function for xor8.

Returns
None
-
36 {
-
37  assert(xor8("Hello World") == 228);
-
38  assert(xor8("Hello World!") == 195);
-
39  assert(xor8("Hello world") == 196);
-
40  assert(xor8("Hello world!") == 163);
-
41  printf("Tests passed\n");
-
42 }
+
36{
+
37 assert(xor8("Hello World") == 228);
+
38 assert(xor8("Hello World!") == 195);
+
39 assert(xor8("Hello world") == 196);
+
40 assert(xor8("Hello world!") == 163);
+
41 printf("Tests passed\n");
+
42}
uint8_t xor8(const char *s)
8-bit XOR algorithm implementation
Definition: hash_xor8.c:19
Here is the call graph for this function:
-
+
- +

◆ xor8()

@@ -508,16 +503,16 @@ Here is the call graph for this function:
Returns
8-bit hash result
-
20 {
-
21  uint8_t hash = 0;
-
22  size_t i = 0;
-
23  while (s[i] != '\0')
-
24  {
-
25  hash = (hash + s[i]) & 0xff;
-
26  i++;
-
27  }
-
28  return (((hash ^ 0xff) + 1) & 0xff);
-
29 }
+
20{
+
21 uint8_t hash = 0;
+
22 size_t i = 0;
+
23 while (s[i] != '\0')
+
24 {
+
25 hash = (hash + s[i]) & 0xff;
+
26 i++;
+
27 }
+
28 return (((hash ^ 0xff) + 1) & 0xff);
+
29}
@@ -526,7 +521,7 @@ Here is the call graph for this function:
diff --git a/d7/d3b/group__hash_ga39d4c16427acbf8bbe744f6d8ed61dc0_cgraph.map b/d7/d3b/group__hash_ga39d4c16427acbf8bbe744f6d8ed61dc0_cgraph.map index f7c8f8a4b..ec65de8c7 100644 --- a/d7/d3b/group__hash_ga39d4c16427acbf8bbe744f6d8ed61dc0_cgraph.map +++ b/d7/d3b/group__hash_ga39d4c16427acbf8bbe744f6d8ed61dc0_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/d7/d3b/group__hash_ga39d4c16427acbf8bbe744f6d8ed61dc0_cgraph.svg b/d7/d3b/group__hash_ga39d4c16427acbf8bbe744f6d8ed61dc0_cgraph.svg index b80eb849e..fe7d41956 100644 --- a/d7/d3b/group__hash_ga39d4c16427acbf8bbe744f6d8ed61dc0_cgraph.svg +++ b/d7/d3b/group__hash_ga39d4c16427acbf8bbe744f6d8ed61dc0_cgraph.svg @@ -1,20 +1,20 @@ - - + test_xor8 - + Node1 - -test_xor8 + +test_xor8 @@ -22,16 +22,16 @@ Node2 - -xor8 + +xor8 Node1->Node2 - - + + diff --git a/d7/d3b/group__hash_ga994ea8b243b6c0fbef734551ec5765dd_cgraph.map b/d7/d3b/group__hash_ga994ea8b243b6c0fbef734551ec5765dd_cgraph.map index 873001c71..611fc082c 100644 --- a/d7/d3b/group__hash_ga994ea8b243b6c0fbef734551ec5765dd_cgraph.map +++ b/d7/d3b/group__hash_ga994ea8b243b6c0fbef734551ec5765dd_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/d7/d3b/group__hash_ga994ea8b243b6c0fbef734551ec5765dd_cgraph.svg b/d7/d3b/group__hash_ga994ea8b243b6c0fbef734551ec5765dd_cgraph.svg index 1dc46c395..17863cd9c 100644 --- a/d7/d3b/group__hash_ga994ea8b243b6c0fbef734551ec5765dd_cgraph.svg +++ b/d7/d3b/group__hash_ga994ea8b243b6c0fbef734551ec5765dd_cgraph.svg @@ -1,20 +1,20 @@ - - + test_adler32 - + Node1 - -test_adler32 + +test_adler32 @@ -22,16 +22,16 @@ Node2 - -adler32 + +adler32 Node1->Node2 - - + + diff --git a/d7/d3b/group__hash_ga9f76001544014905468dc812336110d5_cgraph.map b/d7/d3b/group__hash_ga9f76001544014905468dc812336110d5_cgraph.map index 636bcce47..59ea376db 100644 --- a/d7/d3b/group__hash_ga9f76001544014905468dc812336110d5_cgraph.map +++ b/d7/d3b/group__hash_ga9f76001544014905468dc812336110d5_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/d7/d3b/group__hash_ga9f76001544014905468dc812336110d5_cgraph.svg b/d7/d3b/group__hash_ga9f76001544014905468dc812336110d5_cgraph.svg index c128e5146..bb1e21a9a 100644 --- a/d7/d3b/group__hash_ga9f76001544014905468dc812336110d5_cgraph.svg +++ b/d7/d3b/group__hash_ga9f76001544014905468dc812336110d5_cgraph.svg @@ -1,20 +1,20 @@ - - + test_djb2 - + Node1 - -test_djb2 + +test_djb2 @@ -22,16 +22,16 @@ Node2 - -djb2 + +djb2 Node1->Node2 - - + + diff --git a/d7/d3b/group__hash_gab87679863646255178427a56dc33e453_cgraph.map b/d7/d3b/group__hash_gab87679863646255178427a56dc33e453_cgraph.map index efd4250f5..6ec6ded6e 100644 --- a/d7/d3b/group__hash_gab87679863646255178427a56dc33e453_cgraph.map +++ b/d7/d3b/group__hash_gab87679863646255178427a56dc33e453_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/d7/d3b/group__hash_gab87679863646255178427a56dc33e453_cgraph.svg b/d7/d3b/group__hash_gab87679863646255178427a56dc33e453_cgraph.svg index 3f5f591f7..63607780f 100644 --- a/d7/d3b/group__hash_gab87679863646255178427a56dc33e453_cgraph.svg +++ b/d7/d3b/group__hash_gab87679863646255178427a56dc33e453_cgraph.svg @@ -1,20 +1,20 @@ - - + test_sdbm - + Node1 - -test_sdbm + +test_sdbm @@ -22,16 +22,16 @@ Node2 - -sdbm + +sdbm Node1->Node2 - - + + diff --git a/d7/d3b/group__hash_gad451622bbdca271edfa8e0d98ca422f2_cgraph.map b/d7/d3b/group__hash_gad451622bbdca271edfa8e0d98ca422f2_cgraph.map index 42fcd1ade..b50f08a0b 100644 --- a/d7/d3b/group__hash_gad451622bbdca271edfa8e0d98ca422f2_cgraph.map +++ b/d7/d3b/group__hash_gad451622bbdca271edfa8e0d98ca422f2_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/d7/d3b/group__hash_gad451622bbdca271edfa8e0d98ca422f2_cgraph.svg b/d7/d3b/group__hash_gad451622bbdca271edfa8e0d98ca422f2_cgraph.svg index ab169d2c1..cde868c9a 100644 --- a/d7/d3b/group__hash_gad451622bbdca271edfa8e0d98ca422f2_cgraph.svg +++ b/d7/d3b/group__hash_gad451622bbdca271edfa8e0d98ca422f2_cgraph.svg @@ -1,20 +1,20 @@ - - + test_crc32 - + Node1 - -test_crc32 + +test_crc32 @@ -22,16 +22,16 @@ Node2 - -crc32 + +crc32 Node1->Node2 - - + + diff --git a/d7/d50/qr__eigen__values_8c.html b/d7/d50/qr__eigen__values_8c.html index 025f26808..d968963ad 100644 --- a/d7/d50/qr__eigen__values_8c.html +++ b/d7/d50/qr__eigen__values_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: numerical_methods/qr_eigen_values.c 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('d7/d50/qr__eigen__values_8c.html','../ -
-
qr_eigen_values.c File Reference
+
qr_eigen_values.c 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 <assert.h>
#include <math.h>
@@ -109,29 +108,29 @@ $(document).ready(function(){initNavTree('d7/d50/qr__eigen__values_8c.html','../
Include dependency graph for qr_eigen_values.c:
-
+
- - + - +

+

Macros

-#define LIMS   9
+#define LIMS   9
 limit of range of matrix values
 
-#define EPSILON   1e-10
+#define EPSILON   1e-10
 accuracy tolerance limit
 
- - - - + + + @@ -141,16 +140,15 @@ Functions - - + +

+

Functions

void create_matrix (double **A, int N)
 create a square matrix of given size with random elements More...
 
double ** mat_mul (double **A, double **B, double **OUT, int R1, int C1, int R2, int C2)
 Perform multiplication of two matrices. More...
 
double ** mat_mul (double **A, double **B, double **OUT, int R1, int C1, int R2, int C2)
 Perform multiplication of two matrices. More...
 
double eigen_values (double **A, double *eigen_vals, int mat_size, char debug_print)
 Compute eigen values using iterative shifted QR decomposition algorithm as follows: More...
 
void test2 ()
 test function to compute eigen values of a 2x2 matrix More...
 
-int main (int argc, char **argv)
 main function
int main (int argc, char **argv)
 main function More...
 

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

Function Documentation

- +

◆ create_matrix()

@@ -184,28 +182,28 @@ int 
28 {
-
29  int i, j, tmp, lim2 = LIMS >> 1;
-
30 
-
31 #ifdef _OPENMP
-
32 #pragma omp for
-
33 #endif
-
34  for (i = 0; i < N; i++)
-
35  {
-
36  A[i][i] = (rand() % LIMS) - lim2;
-
37  for (j = i + 1; j < N; j++)
-
38  {
-
39  tmp = (rand() % LIMS) - lim2;
-
40  A[i][j] = tmp;
-
41  A[j][i] = tmp;
-
42  }
-
43  }
-
44 }
+
28{
+
29 int i, j, tmp, lim2 = LIMS >> 1;
+
30
+
31#ifdef _OPENMP
+
32#pragma omp for
+
33#endif
+
34 for (i = 0; i < N; i++)
+
35 {
+
36 A[i][i] = (rand() % LIMS) - lim2;
+
37 for (j = i + 1; j < N; j++)
+
38 {
+
39 tmp = (rand() % LIMS) - lim2;
+
40 A[i][j] = tmp;
+
41 A[j][i] = tmp;
+
42 }
+
43 }
+
44}
#define LIMS
limit of range of matrix values
Definition: qr_eigen_values.c:19
- +

◆ eigen_values()

@@ -273,136 +271,230 @@ int 
Returns
time for computation in seconds
-
108 {
-
109  if (!eigen_vals)
-
110  {
-
111  perror("Output eigen value vector cannot be NULL!");
-
112  return -1;
-
113  }
-
114  double **R = (double **)malloc(sizeof(double *) * mat_size);
-
115  double **Q = (double **)malloc(sizeof(double *) * mat_size);
-
116  if (!Q || !R)
-
117  {
-
118  perror("Unable to allocate memory for Q & R!");
-
119  if (Q)
-
120  {
-
121  free(Q);
-
122  }
-
123  if (R)
-
124  {
-
125  free(R);
-
126  }
-
127  return -1;
-
128  }
-
129 
-
130  /* allocate dynamic memory for matrices */
-
131  for (int i = 0; i < mat_size; i++)
-
132  {
-
133  R[i] = (double *)malloc(sizeof(double) * mat_size);
-
134  Q[i] = (double *)malloc(sizeof(double) * mat_size);
-
135  if (!Q[i] || !R[i])
-
136  {
-
137  perror("Unable to allocate memory for Q & R.");
-
138  for (; i >= 0; i--)
-
139  {
-
140  free(R[i]);
-
141  free(Q[i]);
-
142  }
-
143  free(Q);
-
144  free(R);
-
145  return -1;
-
146  }
-
147  }
-
148 
-
149  if (debug_print)
-
150  {
-
151  print_matrix(A, mat_size, mat_size);
-
152  }
-
153 
-
154  int rows = mat_size, columns = mat_size;
-
155  int counter = 0, num_eigs = rows - 1;
-
156  double last_eig = 0;
-
157 
-
158  clock_t t1 = clock();
-
159  while (num_eigs > 0) /* continue till all eigen values are found */
-
160  {
-
161  /* iterate with QR decomposition */
-
162  while (fabs(A[num_eigs][num_eigs - 1]) > EPSILON)
-
163  {
-
164  last_eig = A[num_eigs][num_eigs];
-
165  for (int i = 0; i < rows; i++) A[i][i] -= last_eig; /* A - cI */
-
166  qr_decompose(A, Q, R, rows, columns);
-
167 
-
168  if (debug_print)
-
169  {
-
170  print_matrix(A, rows, columns);
-
171  print_matrix(Q, rows, columns);
-
172  print_matrix(R, columns, columns);
-
173  printf("-------------------- %d ---------------------\n",
-
174  ++counter);
-
175  }
-
176 
-
177  mat_mul(R, Q, A, columns, columns, rows, columns);
-
178  for (int i = 0; i < rows; i++) A[i][i] += last_eig; /* A + cI */
-
179  }
-
180 
-
181  /* store the converged eigen value */
-
182  eigen_vals[num_eigs] = last_eig;
-
183 
-
184  if (debug_print)
-
185  {
-
186  printf("========================\n");
-
187  printf("Eigen value: % g,\n", last_eig);
-
188  printf("========================\n");
-
189  }
-
190 
-
191  num_eigs--;
-
192  rows--;
-
193  columns--;
-
194  }
-
195  eigen_vals[0] = A[0][0];
-
196  double dtime = (double)(clock() - t1) / CLOCKS_PER_SEC;
-
197 
-
198  if (debug_print)
-
199  {
-
200  print_matrix(R, mat_size, mat_size);
-
201  print_matrix(Q, mat_size, mat_size);
-
202  }
-
203 
-
204  /* cleanup dynamic memory */
-
205  for (int i = 0; i < mat_size; i++)
-
206  {
-
207  free(R[i]);
-
208  free(Q[i]);
-
209  }
-
210  free(R);
-
211  free(Q);
-
212 
-
213  return dtime;
-
214 }
+
108{
+
109 if (!eigen_vals)
+
110 {
+
111 perror("Output eigen value vector cannot be NULL!");
+
112 return -1;
+
113 }
+
114 double **R = (double **)malloc(sizeof(double *) * mat_size);
+
115 double **Q = (double **)malloc(sizeof(double *) * mat_size);
+
116 if (!Q || !R)
+
117 {
+
118 perror("Unable to allocate memory for Q & R!");
+
119 if (Q)
+
120 {
+
121 free(Q);
+
122 }
+
123 if (R)
+
124 {
+
125 free(R);
+
126 }
+
127 return -1;
+
128 }
+
129
+
130 /* allocate dynamic memory for matrices */
+
131 for (int i = 0; i < mat_size; i++)
+
132 {
+
133 R[i] = (double *)malloc(sizeof(double) * mat_size);
+
134 Q[i] = (double *)malloc(sizeof(double) * mat_size);
+
135 if (!Q[i] || !R[i])
+
136 {
+
137 perror("Unable to allocate memory for Q & R.");
+
138 for (; i >= 0; i--)
+
139 {
+
140 free(R[i]);
+
141 free(Q[i]);
+
142 }
+
143 free(Q);
+
144 free(R);
+
145 return -1;
+
146 }
+
147 }
+
148
+
149 if (debug_print)
+
150 {
+
151 print_matrix(A, mat_size, mat_size);
+
152 }
+
153
+
154 int rows = mat_size, columns = mat_size;
+
155 int counter = 0, num_eigs = rows - 1;
+
156 double last_eig = 0;
+
157
+
158 clock_t t1 = clock();
+
159 while (num_eigs > 0) /* continue till all eigen values are found */
+
160 {
+
161 /* iterate with QR decomposition */
+
162 while (fabs(A[num_eigs][num_eigs - 1]) > EPSILON)
+
163 {
+
164 last_eig = A[num_eigs][num_eigs];
+
165 for (int i = 0; i < rows; i++) A[i][i] -= last_eig; /* A - cI */
+
166 qr_decompose(A, Q, R, rows, columns);
+
167
+
168 if (debug_print)
+
169 {
+
170 print_matrix(A, rows, columns);
+
171 print_matrix(Q, rows, columns);
+
172 print_matrix(R, columns, columns);
+
173 printf("-------------------- %d ---------------------\n",
+
174 ++counter);
+
175 }
+
176
+
177 mat_mul(R, Q, A, columns, columns, rows, columns);
+
178 for (int i = 0; i < rows; i++) A[i][i] += last_eig; /* A + cI */
+
179 }
+
180
+
181 /* store the converged eigen value */
+
182 eigen_vals[num_eigs] = last_eig;
+
183
+
184 if (debug_print)
+
185 {
+
186 printf("========================\n");
+
187 printf("Eigen value: % g,\n", last_eig);
+
188 printf("========================\n");
+
189 }
+
190
+
191 num_eigs--;
+
192 rows--;
+
193 columns--;
+
194 }
+
195 eigen_vals[0] = A[0][0];
+
196 double dtime = (double)(clock() - t1) / CLOCKS_PER_SEC;
+
197
+
198 if (debug_print)
+
199 {
+
200 print_matrix(R, mat_size, mat_size);
+
201 print_matrix(Q, mat_size, mat_size);
+
202 }
+
203
+
204 /* cleanup dynamic memory */
+
205 for (int i = 0; i < mat_size; i++)
+
206 {
+
207 free(R[i]);
+
208 free(Q[i]);
+
209 }
+
210 free(R);
+
211 free(Q);
+
212
+
213 return dtime;
+
214}
#define malloc(bytes)
This macro replace the standard malloc function with malloc_dbg.
Definition: malloc_dbg.h:18
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
void qr_decompose(double **A, double **Q, double **R, int M, int N)
Decompose matrix using Gram-Schmidt process.
Definition: qr_decompose.h:142
void print_matrix(double **A, int M, int N)
function to display matrix on stdout
Definition: qr_decompose.h:22
#define EPSILON
accuracy tolerance limit
Definition: qr_eigen_values.c:20
-
double ** mat_mul(double **A, double **B, double **OUT, int R1, int C1, int R2, int C2)
Perform multiplication of two matrices.
Definition: qr_eigen_values.c:59
+
double ** mat_mul(double **A, double **B, double **OUT, int R1, int C1, int R2, int C2)
Perform multiplication of two matrices.
Definition: qr_eigen_values.c:59
Here is the call graph for this function:
-
+
- -

◆ mat_mul()

+ +

◆ main()

- + + + + + + + + + + + + + + + + +
double** mat_mul int main (int argc,
char ** argv 
)
+
+ +

main function

+
316{
+
317 srand(time(NULL));
+
318
+
319 int mat_size = 5;
+
320 if (argc == 2)
+
321 {
+
322 mat_size = atoi(argv[1]);
+
323 }
+
324 else
+
325 { // if invalid input argument is given run tests
+
326 test1();
+
327 test2();
+
328 printf("Usage: ./qr_eigen_values [mat_size]\n");
+
329 return 0;
+
330 }
+
331
+
332 if (mat_size < 2)
+
333 {
+
334 fprintf(stderr, "Matrix size should be > 2\n");
+
335 return -1;
+
336 }
+
337
+
338 int i;
+
339
+
340 double **A = (double **)malloc(sizeof(double *) * mat_size);
+
341 /* number of eigen values = matrix size */
+
342 double *eigen_vals = (double *)malloc(sizeof(double) * mat_size);
+
343 if (!eigen_vals)
+
344 {
+
345 perror("Unable to allocate memory for eigen values!");
+
346 free(A);
+
347 return -1;
+
348 }
+
349 for (i = 0; i < mat_size; i++)
+
350 {
+
351 A[i] = (double *)malloc(sizeof(double) * mat_size);
+
352 eigen_vals[i] = 0.f;
+
353 }
+
354
+
355 /* create a random matrix */
+
356 create_matrix(A, mat_size);
+
357
+
358 print_matrix(A, mat_size, mat_size);
+
359
+
360 double dtime = eigen_values(A, eigen_vals, mat_size, 0);
+
361 printf("Eigen vals: ");
+
362 for (i = 0; i < mat_size; i++) printf("% 9.4g\t", eigen_vals[i]);
+
363 printf("\nTime taken to compute: % .4g sec\n", dtime);
+
364
+
365 for (int i = 0; i < mat_size; i++) free(A[i]);
+
366 free(A);
+
367 free(eigen_vals);
+
368 return 0;
+
369}
+
void test2()
test function to compute eigen values of a 2x2 matrix
Definition: qr_eigen_values.c:271
+
double eigen_values(double **A, double *eigen_vals, int mat_size, char debug_print)
Compute eigen values using iterative shifted QR decomposition algorithm as follows:
Definition: qr_eigen_values.c:106
+
void test1()
test function to compute eigen values of a 2x2 matrix
Definition: qr_eigen_values.c:224
+
void create_matrix(double **A, int N)
create a square matrix of given size with random elements
Definition: qr_eigen_values.c:27
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ mat_mul()

+ +
+
+ + + @@ -469,31 +561,31 @@ Here is the call graph for this function:
Returns
pointer to resultant matrix
-
61 {
-
62  if (C1 != R2)
-
63  {
-
64  perror("Matrix dimensions mismatch!");
-
65  return OUT;
-
66  }
-
67 
-
68  int i;
-
69 #ifdef _OPENMP
-
70 #pragma omp for
-
71 #endif
-
72  for (i = 0; i < R1; i++)
-
73  {
-
74  for (int j = 0; j < C2; j++)
-
75  {
-
76  OUT[i][j] = 0.f;
-
77  for (int k = 0; k < C1; k++) OUT[i][j] += A[i][k] * B[k][j];
-
78  }
-
79  }
-
80  return OUT;
-
81 }
+
61{
+
62 if (C1 != R2)
+
63 {
+
64 perror("Matrix dimensions mismatch!");
+
65 return OUT;
+
66 }
+
67
+
68 int i;
+
69#ifdef _OPENMP
+
70#pragma omp for
+
71#endif
+
72 for (i = 0; i < R1; i++)
+
73 {
+
74 for (int j = 0; j < C2; j++)
+
75 {
+
76 OUT[i][j] = 0.f;
+
77 for (int k = 0; k < C1; k++) OUT[i][j] += A[i][k] * B[k][j];
+
78 }
+
79 }
+
80 return OUT;
+
81}
- +

◆ test1()

@@ -513,51 +605,50 @@ Here is the call graph for this function:
\[\begin{bmatrix} 5 & 7\\ 7 & 11 \end{bmatrix}\]

which are approximately, {15.56158, 0.384227}

-
225 {
-
226  int mat_size = 2;
-
227  double X[][2] = {{5, 7}, {7, 11}};
-
228  double y[] = {15.56158, 0.384227}; // corresponding y-values
-
229  double eig_vals[2] = {0, 0};
-
230 
-
231  // The following steps are to convert a "double[][]" to "double **"
-
232  double **A = (double **)malloc(mat_size * sizeof(double *));
-
233  for (int i = 0; i < mat_size; i++) A[i] = X[i];
-
234 
-
235  printf("------- Test 1 -------\n");
-
236 
-
237  double dtime = eigen_values(A, eig_vals, mat_size, 0);
-
238 
-
239  for (int i = 0; i < mat_size; i++)
-
240  {
-
241  printf("%d/5 Checking for %.3g --> ", i + 1, y[i]);
-
242  char result = 0;
-
243  for (int j = 0; j < mat_size && !result; j++)
-
244  {
-
245  if (fabs(y[i] - eig_vals[j]) < 0.1)
-
246  {
-
247  result = 1;
-
248  printf("(%.3g) ", eig_vals[j]);
-
249  }
-
250  }
-
251 
-
252  // ensure that i^th expected eigen value was computed
-
253  assert(result != 0);
-
254  printf("found\n");
-
255  }
-
256  printf("Test 1 Passed in %.3g sec\n\n", dtime);
-
257  free(A);
-
258 }
-
double eigen_values(double **A, double *eigen_vals, int mat_size, char debug_print)
Compute eigen values using iterative shifted QR decomposition algorithm as follows:
Definition: qr_eigen_values.c:106
+
225{
+
226 int mat_size = 2;
+
227 double X[][2] = {{5, 7}, {7, 11}};
+
228 double y[] = {15.56158, 0.384227}; // corresponding y-values
+
229 double eig_vals[2] = {0, 0};
+
230
+
231 // The following steps are to convert a "double[][]" to "double **"
+
232 double **A = (double **)malloc(mat_size * sizeof(double *));
+
233 for (int i = 0; i < mat_size; i++) A[i] = X[i];
+
234
+
235 printf("------- Test 1 -------\n");
+
236
+
237 double dtime = eigen_values(A, eig_vals, mat_size, 0);
+
238
+
239 for (int i = 0; i < mat_size; i++)
+
240 {
+
241 printf("%d/5 Checking for %.3g --> ", i + 1, y[i]);
+
242 char result = 0;
+
243 for (int j = 0; j < mat_size && !result; j++)
+
244 {
+
245 if (fabs(y[i] - eig_vals[j]) < 0.1)
+
246 {
+
247 result = 1;
+
248 printf("(%.3g) ", eig_vals[j]);
+
249 }
+
250 }
+
251
+
252 // ensure that i^th expected eigen value was computed
+
253 assert(result != 0);
+
254 printf("found\n");
+
255 }
+
256 printf("Test 1 Passed in %.3g sec\n\n", dtime);
+
257 free(A);
+
258}
Here is the call graph for this function:
-
+
- +

◆ test2()

@@ -577,49 +668,49 @@ Here is the call graph for this function:
\[\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}

-
272 {
-
273  int mat_size = 5;
-
274  double X[][5] = {{-4, 4, 2, 0, -3},
-
275  {4, -4, 4, -3, -1},
-
276  {2, 4, 4, 3, -3},
-
277  {0, -3, 3, -1, -3},
-
278  {-3, -1, -3, -3, 0}};
-
279  double y[] = {9.27648, -9.26948, 2.0181, -1.03516,
-
280  -5.98994}; // corresponding y-values
-
281  double eig_vals[5];
-
282 
-
283  // The following steps are to convert a "double[][]" to "double **"
-
284  double **A = (double **)malloc(mat_size * sizeof(double *));
-
285  for (int i = 0; i < mat_size; i++) A[i] = X[i];
-
286 
-
287  printf("------- Test 2 -------\n");
-
288 
-
289  double dtime = eigen_values(A, eig_vals, mat_size, 0);
-
290 
-
291  for (int i = 0; i < mat_size; i++)
-
292  {
-
293  printf("%d/5 Checking for %.3g --> ", i + 1, y[i]);
-
294  char result = 0;
-
295  for (int j = 0; j < mat_size && !result; j++)
-
296  {
-
297  if (fabs(y[i] - eig_vals[j]) < 0.1)
-
298  {
-
299  result = 1;
-
300  printf("(%.3g) ", eig_vals[j]);
-
301  }
-
302  }
-
303 
-
304  // ensure that i^th expected eigen value was computed
-
305  assert(result != 0);
-
306  printf("found\n");
-
307  }
-
308  printf("Test 2 Passed in %.3g sec\n\n", dtime);
-
309  free(A);
-
310 }
+
272{
+
273 int mat_size = 5;
+
274 double X[][5] = {{-4, 4, 2, 0, -3},
+
275 {4, -4, 4, -3, -1},
+
276 {2, 4, 4, 3, -3},
+
277 {0, -3, 3, -1, -3},
+
278 {-3, -1, -3, -3, 0}};
+
279 double y[] = {9.27648, -9.26948, 2.0181, -1.03516,
+
280 -5.98994}; // corresponding y-values
+
281 double eig_vals[5];
+
282
+
283 // The following steps are to convert a "double[][]" to "double **"
+
284 double **A = (double **)malloc(mat_size * sizeof(double *));
+
285 for (int i = 0; i < mat_size; i++) A[i] = X[i];
+
286
+
287 printf("------- Test 2 -------\n");
+
288
+
289 double dtime = eigen_values(A, eig_vals, mat_size, 0);
+
290
+
291 for (int i = 0; i < mat_size; i++)
+
292 {
+
293 printf("%d/5 Checking for %.3g --> ", i + 1, y[i]);
+
294 char result = 0;
+
295 for (int j = 0; j < mat_size && !result; j++)
+
296 {
+
297 if (fabs(y[i] - eig_vals[j]) < 0.1)
+
298 {
+
299 result = 1;
+
300 printf("(%.3g) ", eig_vals[j]);
+
301 }
+
302 }
+
303
+
304 // ensure that i^th expected eigen value was computed
+
305 assert(result != 0);
+
306 printf("found\n");
+
307 }
+
308 printf("Test 2 Passed in %.3g sec\n\n", dtime);
+
309 free(A);
+
310}
Here is the call graph for this function:
-
+
@@ -631,7 +722,7 @@ Here is the call graph for this function:
diff --git a/d7/d50/qr__eigen__values_8c.js b/d7/d50/qr__eigen__values_8c.js index e513452c5..fcdff976b 100644 --- a/d7/d50/qr__eigen__values_8c.js +++ b/d7/d50/qr__eigen__values_8c.js @@ -5,7 +5,7 @@ var qr__eigen__values_8c = [ "create_matrix", "d7/d50/qr__eigen__values_8c.html#a7d96c5e4ae1bd6d29791bcc23a4cb2b0", null ], [ "eigen_values", "d7/d50/qr__eigen__values_8c.html#a0d8ed79786d17df48396b333c09d05bb", null ], [ "main", "d7/d50/qr__eigen__values_8c.html#a3c04138a5bfe5d72780bb7e82a18e627", null ], - [ "mat_mul", "d7/d50/qr__eigen__values_8c.html#a741477692f001a805b0fea942c9dc2b9", null ], + [ "mat_mul", "d7/d50/qr__eigen__values_8c.html#a5835240036dc02ee9a13e65c559fb907", null ], [ "test1", "d7/d50/qr__eigen__values_8c.html#a1440a7779ac56f47a3f355ce4a8c7da0", null ], [ "test2", "d7/d50/qr__eigen__values_8c.html#a0283886819c7c140a023582b7269e2d0", null ] ]; \ No newline at end of file diff --git a/d7/d50/qr__eigen__values_8c_a0283886819c7c140a023582b7269e2d0_cgraph.map b/d7/d50/qr__eigen__values_8c_a0283886819c7c140a023582b7269e2d0_cgraph.map index 84fcc17b9..db1c7bddc 100644 --- a/d7/d50/qr__eigen__values_8c_a0283886819c7c140a023582b7269e2d0_cgraph.map +++ b/d7/d50/qr__eigen__values_8c_a0283886819c7c140a023582b7269e2d0_cgraph.map @@ -1,11 +1,11 @@ - - - - - - - - + + + + + + + + diff --git a/d7/d50/qr__eigen__values_8c_a0283886819c7c140a023582b7269e2d0_cgraph.md5 b/d7/d50/qr__eigen__values_8c_a0283886819c7c140a023582b7269e2d0_cgraph.md5 index 567adce14..2e80f4b3b 100644 --- a/d7/d50/qr__eigen__values_8c_a0283886819c7c140a023582b7269e2d0_cgraph.md5 +++ b/d7/d50/qr__eigen__values_8c_a0283886819c7c140a023582b7269e2d0_cgraph.md5 @@ -1 +1 @@ -7f8bfcc647bf383024a73f7b9bce7b08 \ No newline at end of file +80cedc4b4082036460211ed0bccde908 \ No newline at end of file diff --git a/d7/d50/qr__eigen__values_8c_a0283886819c7c140a023582b7269e2d0_cgraph.svg b/d7/d50/qr__eigen__values_8c_a0283886819c7c140a023582b7269e2d0_cgraph.svg index ab879607b..38d27669b 100644 --- a/d7/d50/qr__eigen__values_8c_a0283886819c7c140a023582b7269e2d0_cgraph.svg +++ b/d7/d50/qr__eigen__values_8c_a0283886819c7c140a023582b7269e2d0_cgraph.svg @@ -1,14 +1,14 @@ - - + test2 - + Node1 @@ -22,133 +22,133 @@ Node2 - -eigen_values + +eigen_values Node1->Node2 - - + + Node3 - - -mat_mul + + +mat_mul Node2->Node3 - - + + Node4 - -print_matrix + +print_matrix Node2->Node4 - - + + Node5 - -qr_decompose + +qr_decompose Node2->Node5 - - + + Node6 - -vector_dot + +vector_dot Node5->Node6 - - + + Node7 - -vector_mag + +vector_mag Node5->Node7 - - + + Node8 - - -vector_proj + + +vector_proj Node5->Node8 - - + + Node9 - - -vector_sub + + +vector_sub Node5->Node9 - - + + Node7->Node6 - - + + Node8->Node6 - - + + diff --git a/d7/d50/qr__eigen__values_8c_a0d8ed79786d17df48396b333c09d05bb_cgraph.map b/d7/d50/qr__eigen__values_8c_a0d8ed79786d17df48396b333c09d05bb_cgraph.map index c7fc3623d..f8c2c097c 100644 --- a/d7/d50/qr__eigen__values_8c_a0d8ed79786d17df48396b333c09d05bb_cgraph.map +++ b/d7/d50/qr__eigen__values_8c_a0d8ed79786d17df48396b333c09d05bb_cgraph.map @@ -1,10 +1,10 @@ - - - - - - - - + + + + + + + + diff --git a/d7/d50/qr__eigen__values_8c_a0d8ed79786d17df48396b333c09d05bb_cgraph.md5 b/d7/d50/qr__eigen__values_8c_a0d8ed79786d17df48396b333c09d05bb_cgraph.md5 index e7da46d3e..9262350db 100644 --- a/d7/d50/qr__eigen__values_8c_a0d8ed79786d17df48396b333c09d05bb_cgraph.md5 +++ b/d7/d50/qr__eigen__values_8c_a0d8ed79786d17df48396b333c09d05bb_cgraph.md5 @@ -1 +1 @@ -e16f141ccc160aacd4280d442ae0ed85 \ No newline at end of file +058670ad1dd27e3ad0204f0015c39072 \ No newline at end of file diff --git a/d7/d50/qr__eigen__values_8c_a0d8ed79786d17df48396b333c09d05bb_cgraph.svg b/d7/d50/qr__eigen__values_8c_a0d8ed79786d17df48396b333c09d05bb_cgraph.svg index 605f93662..766d075a0 100644 --- a/d7/d50/qr__eigen__values_8c_a0d8ed79786d17df48396b333c09d05bb_cgraph.svg +++ b/d7/d50/qr__eigen__values_8c_a0d8ed79786d17df48396b333c09d05bb_cgraph.svg @@ -1,139 +1,139 @@ - - + eigen_values - + Node1 - -eigen_values + +eigen_values Node2 - - -mat_mul + + +mat_mul Node1->Node2 - - + + Node3 - -print_matrix + +print_matrix Node1->Node3 - - + + Node4 - -qr_decompose + +qr_decompose Node1->Node4 - - + + Node5 - -vector_dot + +vector_dot Node4->Node5 - - + + Node6 - -vector_mag + +vector_mag Node4->Node6 - - + + Node7 - - -vector_proj + + +vector_proj Node4->Node7 - - + + Node8 - - -vector_sub + + +vector_sub Node4->Node8 - - + + Node6->Node5 - - + + Node7->Node5 - - + + diff --git a/d7/d50/qr__eigen__values_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.map b/d7/d50/qr__eigen__values_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.map index 03313e14a..7d68ed602 100644 --- a/d7/d50/qr__eigen__values_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.map +++ b/d7/d50/qr__eigen__values_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.map @@ -1,11 +1,11 @@ - - - - - - - - + + + + + + + + diff --git a/d7/d50/qr__eigen__values_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.md5 b/d7/d50/qr__eigen__values_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.md5 index 48f960951..524976bde 100644 --- a/d7/d50/qr__eigen__values_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.md5 +++ b/d7/d50/qr__eigen__values_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.md5 @@ -1 +1 @@ -20328ba6c0e21c234eef6c631ff1b07f \ No newline at end of file +69e522496991fe3cecae99008cb6157e \ No newline at end of file diff --git a/d7/d50/qr__eigen__values_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg b/d7/d50/qr__eigen__values_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg index 58766e11d..227027939 100644 --- a/d7/d50/qr__eigen__values_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg +++ b/d7/d50/qr__eigen__values_8c_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg @@ -1,14 +1,14 @@ - - + test1 - + Node1 @@ -22,133 +22,133 @@ Node2 - -eigen_values + +eigen_values Node1->Node2 - - + + Node3 - - -mat_mul + + +mat_mul Node2->Node3 - - + + Node4 - -print_matrix + +print_matrix Node2->Node4 - - + + Node5 - -qr_decompose + +qr_decompose Node2->Node5 - - + + Node6 - -vector_dot + +vector_dot Node5->Node6 - - + + Node7 - -vector_mag + +vector_mag Node5->Node7 - - + + Node8 - - -vector_proj + + +vector_proj Node5->Node8 - - + + Node9 - - -vector_sub + + +vector_sub Node5->Node9 - - + + Node7->Node6 - - + + Node8->Node6 - - + + diff --git a/d7/d50/qr__eigen__values_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map b/d7/d50/qr__eigen__values_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map new file mode 100644 index 000000000..5a7057c47 --- /dev/null +++ b/d7/d50/qr__eigen__values_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/d7/d50/qr__eigen__values_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 b/d7/d50/qr__eigen__values_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 new file mode 100644 index 000000000..1f75b378e --- /dev/null +++ b/d7/d50/qr__eigen__values_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 @@ -0,0 +1 @@ +bbe2811cf3929328d6cd4945ff82dcc2 \ No newline at end of file diff --git a/d7/d50/qr__eigen__values_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg b/d7/d50/qr__eigen__values_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg new file mode 100644 index 000000000..a0931e674 --- /dev/null +++ b/d7/d50/qr__eigen__values_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg @@ -0,0 +1,305 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +create_matrix + + + + + +Node1->Node2 + + + + + +Node3 + + +eigen_values + + + + + +Node1->Node3 + + + + + +Node5 + + +print_matrix + + + + + +Node1->Node5 + + + + + +Node11 + + +test1 + + + + + +Node1->Node11 + + + + + +Node12 + + +test2 + + + + + +Node1->Node12 + + + + + +Node4 + + +mat_mul + + + + + +Node3->Node4 + + + + + +Node3->Node5 + + + + + +Node6 + + +qr_decompose + + + + + +Node3->Node6 + + + + + +Node7 + + +vector_dot + + + + + +Node6->Node7 + + + + + +Node8 + + +vector_mag + + + + + +Node6->Node8 + + + + + +Node9 + + +vector_proj + + + + + +Node6->Node9 + + + + + +Node10 + + +vector_sub + + + + + +Node6->Node10 + + + + + +Node8->Node7 + + + + + +Node9->Node7 + + + + + +Node11->Node3 + + + + + +Node12->Node3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/d7/d50/qr__eigen__values_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph_org.svg b/d7/d50/qr__eigen__values_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph_org.svg new file mode 100644 index 000000000..9005d0adc --- /dev/null +++ b/d7/d50/qr__eigen__values_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph_org.svg @@ -0,0 +1,217 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +create_matrix + + + + + +Node1->Node2 + + + + + +Node3 + + +eigen_values + + + + + +Node1->Node3 + + + + + +Node5 + + +print_matrix + + + + + +Node1->Node5 + + + + + +Node11 + + +test1 + + + + + +Node1->Node11 + + + + + +Node12 + + +test2 + + + + + +Node1->Node12 + + + + + +Node4 + + +mat_mul + + + + + +Node3->Node4 + + + + + +Node3->Node5 + + + + + +Node6 + + +qr_decompose + + + + + +Node3->Node6 + + + + + +Node7 + + +vector_dot + + + + + +Node6->Node7 + + + + + +Node8 + + +vector_mag + + + + + +Node6->Node8 + + + + + +Node9 + + +vector_proj + + + + + +Node6->Node9 + + + + + +Node10 + + +vector_sub + + + + + +Node6->Node10 + + + + + +Node8->Node7 + + + + + +Node9->Node7 + + + + + +Node11->Node3 + + + + + +Node12->Node3 + + + + + diff --git a/d7/d6d/client_8c__incl.map b/d7/d6d/client_8c__incl.map index e9931ff77..c8a65edf8 100644 --- a/d7/d6d/client_8c__incl.map +++ b/d7/d6d/client_8c__incl.map @@ -1,10 +1,10 @@ - + - - - - + + + + diff --git a/d7/d6d/client_8c__incl.svg b/d7/d6d/client_8c__incl.svg index c1edb89b1..1e34062b5 100644 --- a/d7/d6d/client_8c__incl.svg +++ b/d7/d6d/client_8c__incl.svg @@ -1,20 +1,20 @@ - - + client_server/client.c - + Node1 - -client_server/client.c + +client_server/client.c @@ -30,8 +30,8 @@ Node1->Node2 - - + + @@ -45,8 +45,8 @@ Node1->Node3 - - + + @@ -60,68 +60,68 @@ Node1->Node4 - - + + Node5 - -arpa/inet.h + +arpa/inet.h Node1->Node5 - - + + Node6 - -netdb.h + +netdb.h Node1->Node6 - - + + Node7 - -sys/socket.h + +sys/socket.h Node1->Node7 - - + + Node8 - -unistd.h + +unistd.h Node1->Node8 - - + + diff --git a/d7/d70/malloc__dbg_8c__incl.map b/d7/d70/malloc__dbg_8c__incl.map index 9138e9701..71c4213c4 100644 --- a/d7/d70/malloc__dbg_8c__incl.map +++ b/d7/d70/malloc__dbg_8c__incl.map @@ -1,7 +1,7 @@ - + - + diff --git a/d7/d70/malloc__dbg_8c__incl.svg b/d7/d70/malloc__dbg_8c__incl.svg index 106a8d82f..537498269 100644 --- a/d7/d70/malloc__dbg_8c__incl.svg +++ b/d7/d70/malloc__dbg_8c__incl.svg @@ -1,20 +1,20 @@ - - + developer_tools/malloc_dbg.c - + Node1 - -developer_tools/malloc + +developer_tools/malloc _dbg.c @@ -68,16 +68,16 @@ Node5 - -malloc_dbg.h + +malloc_dbg.h Node1->Node5 - - + + diff --git a/d7/d86/struct__big__int__coll__graph.map b/d7/d86/struct__big__int__coll__graph.map index d58e35819..6ba8b7938 100644 --- a/d7/d86/struct__big__int__coll__graph.map +++ b/d7/d86/struct__big__int__coll__graph.map @@ -1,3 +1,3 @@ - + diff --git a/d7/d86/struct__big__int__coll__graph.svg b/d7/d86/struct__big__int__coll__graph.svg index 45a1404e5..be4673488 100644 --- a/d7/d86/struct__big__int__coll__graph.svg +++ b/d7/d86/struct__big__int__coll__graph.svg @@ -1,30 +1,30 @@ - - + _big_int - + Node1 - -_big_int + +_big_int Node1->Node1 - - - next_digit -prev_digit + + + next_digit +prev_digit diff --git a/d7/d90/rna__transcription_8h_source.html b/d7/d90/rna__transcription_8h_source.html index a749ece44..a6303ded5 100644 --- a/d7/d90/rna__transcription_8h_source.html +++ b/d7/d90/rna__transcription_8h_source.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: exercism/rna_transcription/rna_transcription.h Source File @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@
@@ -42,21 +41,22 @@
double ** mat_mul ( double **  A,
-
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,24 +90,23 @@ $(document).ready(function(){initNavTree('d7/d90/rna__transcription_8h_source.ht
-
-
rna_transcription.h
+
rna_transcription.h
-
1 #ifndef __RNA_TRANSCRIPTION__H
-
2 #define __RNA_TRANSCRIPTION__H
-
3 
-
4 /* to_rna: compiles a DNA strand in its RNA complement */
-
5 char *to_rna(const char s[]);
-
6 
-
7 #endif
+
1#ifndef __RNA_TRANSCRIPTION__H
+
2#define __RNA_TRANSCRIPTION__H
+
3
+
4/* to_rna: compiles a DNA strand in its RNA complement */
+
5char *to_rna(const char s[]);
+
6
+
7#endif
diff --git a/d7/d91/problem__15_2sol1_8c.html b/d7/d91/problem__15_2sol1_8c.html index 2cafd2919..73e58f1b3 100644 --- a/d7/d91/problem__15_2sol1_8c.html +++ b/d7/d91/problem__15_2sol1_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_15/sol1.c 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('d7/d91/problem__15_2sol1_8c.html','../
-
-
sol1.c File Reference
+
sol1.c File Reference
-

Problem 15 solution +

Problem 15 solution More...

#include <stdint.h>
#include <stdio.h>
@@ -109,21 +108,68 @@ Include dependency graph for sol1.c:
- - - + +

+

Functions

unsigned long long number_of_paths (int N)
 At every node, there are 2 possible ways to move -> down or right. More...
 
-int main (int argc, char **argv)
 Main function.
int main (int argc, char **argv)
 Main function. More...
 

Detailed Description

-

Problem 15 solution

-
Author
Krishna Vedala
+

Problem 15 solution

+
Author
Krishna Vedala

Function Documentation

- + +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char ** argv 
)
+
+ +

Main function.

+
31{
+
32 int N = 20;
+
33
+
34 if (argc == 2)
+
35 N = atoi(argv[1]);
+
36
+
37 printf("Number of ways to traverse diagonal of %dx%d grid = %llu\n", N, N,
+ +
39
+
40 return 0;
+
41}
+
unsigned long long number_of_paths(int N)
At every node, there are 2 possible ways to move -> down or right.
Definition: sol1.c:17
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+

◆ number_of_paths()

@@ -140,17 +186,17 @@ int 

At every node, there are 2 possible ways to move -> down or right.

-

Since it is a square grid, there are in all, 2N steps with N down and N right options, without preference for order. Hence, the path can be be traced in N out of 2N number of ways. This is the same as binomial coeeficient.

-
18 {
-
19  unsigned long long path = 1;
-
20  for (int i = 0; i < N; i++)
-
21  {
-
22  path *= (N << 1) - i;
-
23  path /= i + 1;
-
24  }
-
25 
-
26  return path;
-
27 }
+

Since it is a square grid, there are in all, 2N steps with N down and N right options, without preference for order. Hence, the path can be be traced in N out of 2N number of ways. This is the same as binomial coeeficient.

+
18{
+
19 unsigned long long path = 1;
+
20 for (int i = 0; i < N; i++)
+
21 {
+
22 path *= (N << 1) - i;
+
23 path /= i + 1;
+
24 }
+
25
+
26 return path;
+
27}
@@ -160,7 +206,7 @@ int 
diff --git a/d7/d91/problem__15_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map b/d7/d91/problem__15_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map new file mode 100644 index 000000000..53d2416ff --- /dev/null +++ b/d7/d91/problem__15_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/d7/d91/problem__15_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 b/d7/d91/problem__15_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 new file mode 100644 index 000000000..5c3637565 --- /dev/null +++ b/d7/d91/problem__15_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 @@ -0,0 +1 @@ +17535e544ff14bbc70eea2f8a7a435d9 \ No newline at end of file diff --git a/d7/d91/problem__15_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg b/d7/d91/problem__15_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg new file mode 100644 index 000000000..891e64f86 --- /dev/null +++ b/d7/d91/problem__15_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg @@ -0,0 +1,37 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +number_of_paths + + + + + +Node1->Node2 + + + + + diff --git a/d7/d98/spirograph_8c.html b/d7/d98/spirograph_8c.html index 84e885a61..d57187146 100644 --- a/d7/d98/spirograph_8c.html +++ b/d7/d98/spirograph_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: graphics/spirograph.c 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('d7/d98/spirograph_8c.html','../../'); -
-
spirograph.c File Reference
+
spirograph.c File Reference
-

Implementation of Spirograph +

Implementation of Spirograph More...

#include <math.h>
#include <stdbool.h>
@@ -108,38 +107,91 @@ $(document).ready(function(){initNavTree('d7/d98/spirograph_8c.html','../../');
Include dependency graph for spirograph.c:
-
+
- - +

+

Macros

-#define _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES
 required for MSVC compiler
 
- - - + + - - + +

+

Functions

void spirograph (double *x, double *y, double l, double k, size_t N, double rot)
 Generate spirograph curve into arrays x and y such that the i^th point in 2D is represented by (x[i],y[i]). More...
 
-void test (void)
 Test function to save resulting points to a CSV file.
void test (void)
 Test function to save resulting points to a CSV file. More...
 
-int main (int argc, char **argv)
 Main function.
int main (int argc, char **argv)
 Main function. More...
 

Detailed Description

-

Implementation of Spirograph

-
Author
Krishna Vedala
+

Implementation of Spirograph

+
Author
Krishna Vedala

Implementation of the program is based on the geometry shown in the figure below:

-

Spirograph geometry from Wikipedia

+

Spirograph geometry from Wikipedia

Function Documentation

- + +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char ** argv 
)
+
+ +

Main function.

+
272{
+
273 test();
+
274
+
275#ifdef USE_GLUT
+
276 glutInit(&argc, argv);
+
277 glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
+
278 glutCreateWindow("Spirograph");
+
279 glutInitWindowSize(400, 400);
+
280 // glutIdleFunc(glutPostRedisplay);
+
281 glutTimerFunc(animation_speed, timer_cb, 0);
+
282 glutKeyboardFunc(keyboard_cb);
+
283 glutDisplayFunc(test2);
+
284 glutMainLoop();
+
285#endif
+
286
+
287 return 0;
+
288}
+
void test2(double eta)
test function to predict points in a 2D coordinate system above the line as +1 and others as -1.
Definition: adaline_learning.c:273
+
void test(void)
Test function to save resulting points to a CSV file.
Definition: spirograph.c:74
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+

◆ spirograph()

@@ -190,7 +242,7 @@ int 

Generate spirograph curve into arrays x and y such that the i^th point in 2D is represented by (x[i],y[i]).

-

The generating function is given by:

+

The generating function is given by:

\begin{eqnarray*} x &=& R\left[ (1-k) \cos (t) + l\cdot k\cdot\cos \left(\frac{1-k}{k}t\right) \right]\\ y &=& R\left[ (1-k) \sin (t) - l\cdot k\cdot\sin \left(\frac{1-k}{k}t\right) \right] \end{eqnarray*}

where

- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -89,15 +89,14 @@ $(document).ready(function(){initNavTree('d7/db5/md_exercism__r_e_a_d_m_e.html',
-
- +
+
Sample solutions for exercism.io
-

This directory contains some sample solutions for exercism.io

-

+

This directory contains some sample solutions for exercism.io

+

Overview

-

In this directory you will find (in the right order):

    +

    In this directory you will find (in the right order):

    • hello-world
    • isogram
    • acronym
    • @@ -110,7 +109,7 @@ Overview

diff --git a/d7/dd3/problem__3_2sol1_8c.html b/d7/dd3/problem__3_2sol1_8c.html index c86814d37..2c3a217be 100644 --- a/d7/dd3/problem__3_2sol1_8c.html +++ b/d7/dd3/problem__3_2sol1_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_3/sol1.c 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,44 +92,150 @@ $(document).ready(function(){initNavTree('d7/dd3/problem__3_2sol1_8c.html','../.
-
-
sol1.c File Reference
+
sol1.c File Reference
-

Problem 3 solution +

Problem 3 solution More...

#include <math.h>
#include <stdio.h>
Include dependency graph for sol1.c:
-
+
- - - + + - - + +

+

Functions

-char isprime (int no)
 Check if the given number is prime.
char isprime (int no)
 Check if the given number is prime. More...
 
-int main ()
 Main function.
int main ()
 Main function. More...
 

Detailed Description

-

Problem 3 solution

-

Problem:

-

The prime factors of 13195 are 5,7,13 and 29. What is the largest prime factor of a given number N? e.g. for 10, largest prime factor = 5. For 17, largest prime factor = 17.

-
+

Problem 3 solution

+

Problem:

+

The prime factors of 13195 are 5,7,13 and 29. What is the largest prime factor of a given number N? e.g. for 10, largest prime factor = 5. For 17, largest prime factor = 17.

+

Function Documentation

+ +

◆ isprime()

+ +
+
+ + + + + + + + +
char isprime (int no)
+
+ +

Check if the given number is prime.

+
16{
+
17 int sq;
+
18
+
19 if (no == 2)
+
20 {
+
21 return 1;
+
22 }
+
23 else if (no % 2 == 0)
+
24 {
+
25 return 0;
+
26 }
+
27 sq = ((int)(sqrt(no))) + 1;
+
28 for (int i = 3; i < sq; i += 2)
+
29 {
+
30 if (no % i == 0)
+
31 {
+
32 return 0;
+
33 }
+
34 }
+
35 return 1;
+
36}
+
+
+
+ +

◆ main()

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

Main function.

+
40{
+
41 int maxNumber = 0;
+
42 int n = 0;
+
43 int n1;
+
44 scanf("%d", &n);
+
45 if (isprime(n) == 1)
+
46 printf("%d", n);
+
47 else
+
48 {
+
49 while (n % 2 == 0)
+
50 {
+
51 n = n / 2;
+
52 }
+
53 if (isprime(n) == 1)
+
54 {
+
55 printf("%d\n", n);
+
56 }
+
57 else
+
58 {
+
59 n1 = ((int)(sqrt(n))) + 1;
+
60 for (int i = 3; i < n1; i += 2)
+
61 {
+
62 if (n % i == 0)
+
63 {
+
64 if (isprime((int)(n / i)) == 1)
+
65 {
+
66 maxNumber = n / i;
+
67 break;
+
68 }
+
69 else if (isprime(i) == 1)
+
70 {
+
71 maxNumber = i;
+
72 }
+
73 }
+
74 }
+
75 printf("%d\n", maxNumber);
+
76 }
+
77 }
+
78 return 0;
+
79}
+
char isprime(int no)
Check if the given number is prime.
Definition: sol1.c:15
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+
diff --git a/d7/dd3/problem__3_2sol1_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d7/dd3/problem__3_2sol1_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..ddb38f0d8 --- /dev/null +++ b/d7/dd3/problem__3_2sol1_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/d7/dd3/problem__3_2sol1_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d7/dd3/problem__3_2sol1_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..11eb14720 --- /dev/null +++ b/d7/dd3/problem__3_2sol1_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +bac632cba5465a3d80a3c0018a2f94ed \ No newline at end of file diff --git a/d7/dd3/problem__3_2sol1_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d7/dd3/problem__3_2sol1_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..0c8d6fd0e --- /dev/null +++ b/d7/dd3/problem__3_2sol1_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,37 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +isprime + + + + + +Node1->Node2 + + + + + diff --git a/d7/dd8/c__atoi__str__to__integer_8c.html b/d7/dd8/c__atoi__str__to__integer_8c.html index 76cc627bc..1bdf834f1 100644 --- a/d7/dd8/c__atoi__str__to__integer_8c.html +++ b/d7/dd8/c__atoi__str__to__integer_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: conversions/c_atoi_str_to_integer.c 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('d7/dd8/c__atoi__str__to__integer_8c.ht
-
-
c_atoi_str_to_integer.c File Reference
+
c_atoi_str_to_integer.c File Reference
@@ -110,24 +109,23 @@ Include dependency graph for c_atoi_str_to_integer.c:
- - - + +

+

Functions

int c_atoi (const char *str)
 the function take a string and return an integer More...
 
-void test_c_atoi ()
 test the function implementation
void test_c_atoi ()
 test the function implementation More...
 
int main (int argc, char **argv)
 the main function take one argument of type char* example : . More...
 

Detailed Description

-

Recoding the original atoi function in stdlib.h.

-
Author
Mohammed YMIKW The function convert a string passed to an integer
+

Recoding the original atoi function in stdlib.h.

+
Author
Mohammed YMIKW The function convert a string passed to an integer

Function Documentation

- +

◆ c_atoi()

@@ -150,51 +148,51 @@ void 
17 {
-
18  int i;
-
19  int sign;
-
20  long value;
-
21  long prev;
-
22 
-
23  i = 0;
-
24  sign = 1;
-
25  value = 0;
-
26 
-
27  /* skipping the spaces */
-
28  while (((str[i] <= 13 && str[i] >= 9) || str[i] == 32) && str[i] != '\0')
-
29  i++;
-
30 
-
31  /* store the sign if it is negative sign */
-
32  if (str[i] == '-')
-
33  {
-
34  sign = -1;
-
35  i++;
-
36  }
-
37  else if (str[i] == '+')
-
38  {
-
39  sign = 1;
-
40  i++;
-
41  }
-
42 
-
43  /* converting char by char to a numeric value */
-
44  while (str[i] >= 48 && str[i] <= 57 && str[i] != '\0')
-
45  {
-
46  prev = value;
-
47  value = value * 10 + sign * (str[i] - '0');
-
48 
-
49  /* managing the overflow */
-
50  if (sign == 1 && prev > value)
-
51  return (-1);
-
52  else if (sign == -1 && prev < value)
-
53  return (0);
-
54  i++;
-
55  }
-
56  return (value);
-
57 }
+
17{
+
18 int i;
+
19 int sign;
+
20 long value;
+
21 long prev;
+
22
+
23 i = 0;
+
24 sign = 1;
+
25 value = 0;
+
26
+
27 /* skipping the spaces */
+
28 while (((str[i] <= 13 && str[i] >= 9) || str[i] == 32) && str[i] != '\0')
+
29 i++;
+
30
+
31 /* store the sign if it is negative sign */
+
32 if (str[i] == '-')
+
33 {
+
34 sign = -1;
+
35 i++;
+
36 }
+
37 else if (str[i] == '+')
+
38 {
+
39 sign = 1;
+
40 i++;
+
41 }
+
42
+
43 /* converting char by char to a numeric value */
+
44 while (str[i] >= 48 && str[i] <= 57 && str[i] != '\0')
+
45 {
+
46 prev = value;
+
47 value = value * 10 + sign * (str[i] - '0');
+
48
+
49 /* managing the overflow */
+
50 if (sign == 1 && prev > value)
+
51 return (-1);
+
52 else if (sign == -1 && prev < value)
+
53 return (0);
+
54 i++;
+
55 }
+
56 return (value);
+
57}
- +

◆ main()

@@ -221,18 +219,18 @@ void 

the main function take one argument of type char* example : .

-

/program 123

-
79 {
-
80  test_c_atoi();
-
81 
-
82  if (argc == 2)
-
83  {
-
84  printf("Your number + 5 is %d\n", c_atoi(argv[1]) + 5);
-
85  return (0);
-
86  }
-
87  printf("wrong number of parmeters\n");
-
88  return (1);
-
89 }
+

/program 123

+
79{
+ +
81
+
82 if (argc == 2)
+
83 {
+
84 printf("Your number + 5 is %d\n", c_atoi(argv[1]) + 5);
+
85 return (0);
+
86 }
+
87 printf("wrong number of parmeters\n");
+
88 return (1);
+
89}
void test_c_atoi()
test the function implementation
Definition: c_atoi_str_to_integer.c:62
int c_atoi(const char *str)
the function take a string and return an integer
Definition: c_atoi_str_to_integer.c:16
@@ -242,6 +240,41 @@ Here is the call graph for this function:
+ + + +

◆ test_c_atoi()

+ +
+
+ + + + + + + +
void test_c_atoi ()
+
+ +

test the function implementation

+
63{
+
64 printf("<<<< TEST FUNCTION >>>>\n");
+
65 assert(c_atoi("123") == atoi("123"));
+
66 assert(c_atoi("-123") == atoi("-123"));
+
67 assert(c_atoi("") == atoi(""));
+
68 assert(c_atoi("-h23") == atoi("-h23"));
+
69 assert(c_atoi(" 23") == atoi(" 23"));
+
70 assert(c_atoi("999999999") == atoi("999999999"));
+
71 printf("<<<< TEST DONE >>>>\n");
+
72}
+
+Here is the call graph for this function:
+
+
+
+
+
@@ -250,7 +283,7 @@ Here is the call graph for this function: diff --git a/d7/dd8/c__atoi__str__to__integer_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg b/d7/dd8/c__atoi__str__to__integer_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg index d7b00b027..6dc1347e9 100644 --- a/d7/dd8/c__atoi__str__to__integer_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg +++ b/d7/dd8/c__atoi__str__to__integer_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg @@ -1,7 +1,7 @@ - + + +
diff --git a/d7/dd8/c__atoi__str__to__integer_8c_a8c66c03637e48e375b80b5d7791e57be_cgraph.md5 b/d7/dd8/c__atoi__str__to__integer_8c_a8c66c03637e48e375b80b5d7791e57be_cgraph.md5 new file mode 100644 index 000000000..6b2969da3 --- /dev/null +++ b/d7/dd8/c__atoi__str__to__integer_8c_a8c66c03637e48e375b80b5d7791e57be_cgraph.md5 @@ -0,0 +1 @@ +98eb83318e5f90f3aa37ade7bcb63282 \ No newline at end of file diff --git a/d7/dd8/c__atoi__str__to__integer_8c_a8c66c03637e48e375b80b5d7791e57be_cgraph.svg b/d7/dd8/c__atoi__str__to__integer_8c_a8c66c03637e48e375b80b5d7791e57be_cgraph.svg new file mode 100644 index 000000000..ed847d053 --- /dev/null +++ b/d7/dd8/c__atoi__str__to__integer_8c_a8c66c03637e48e375b80b5d7791e57be_cgraph.svg @@ -0,0 +1,37 @@ + + + + + + +test_c_atoi + + + +Node1 + + +test_c_atoi + + + + + +Node2 + + +c_atoi + + + + + +Node1->Node2 + + + + + diff --git a/d7/ddb/problem__23_2sol1_8c.html b/d7/ddb/problem__23_2sol1_8c.html index f320b88c0..32eae9055 100644 --- a/d7/ddb/problem__23_2sol1_8c.html +++ b/d7/ddb/problem__23_2sol1_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_23/sol1.c 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('d7/ddb/problem__23_2sol1_8c.html','../
Functions
-
-
sol1.c File Reference
+
sol1.c File Reference
-

Problem 23 solution +

Problem 23 solution More...

#include <stdio.h>
#include <stdlib.h>
@@ -109,33 +108,137 @@ Include dependency graph for sol1.c:
- - - + + - - + + - - + + - - + +

+

Functions

-char get_perfect_number (unsigned long N)
 Returns: -1 if N is deficient 1 if N is abundant 0 if N is perfect.
char get_perfect_number (unsigned long N)
 Returns: -1 if N is deficient 1 if N is abundant 0 if N is perfect. More...
 
-unsigned long is_abundant (unsigned long N)
 Is the given number an abundant number (1) or not (0)
unsigned long is_abundant (unsigned long N)
 Is the given number an abundant number (1) or not (0) More...
 
-unsigned long get_next_abundant (unsigned long N)
 Find the next abundant number after N and not including N.
unsigned long get_next_abundant (unsigned long N)
 Find the next abundant number after N and not including N. More...
 
char is_sum_of_abundant (unsigned long N)
 check if a given number can be represented as a sum of two abundant numbers. More...
 
-int main (int argc, char **argv)
 Main function.
int main (int argc, char **argv)
 Main function. More...
 

Detailed Description

-

Problem 23 solution

-
Author
Krishna Vedala
+

Problem 23 solution

+
Author
Krishna Vedala

Function Documentation

- + +

◆ get_next_abundant()

+ +
+
+ + + + + + + + +
unsigned long get_next_abundant (unsigned long N)
+
+ +

Find the next abundant number after N and not including N.

+
56{
+
57 unsigned long i;
+
58 for (i = N + 1; !is_abundant(i); i++)
+
59 {
+
60 ;
+
61 }
+
62 return i;
+
63}
+
unsigned long is_abundant(unsigned long N)
Is the given number an abundant number (1) or not (0)
Definition: sol1.c:47
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ get_perfect_number()

+ +
+
+ + + + + + + + +
char get_perfect_number (unsigned long N)
+
+ +

Returns: -1 if N is deficient 1 if N is abundant 0 if N is perfect.

+
20{
+
21 unsigned long sum = 1;
+
22 char ret = 0;
+
23
+
24 for (unsigned long i = 2; i * i <= N; i++)
+
25 {
+
26 if (N % i == 0)
+
27 {
+
28 sum += i;
+
29 unsigned long tmp = N / i;
+
30 if (tmp != i)
+
31 {
+
32 sum += tmp;
+
33 }
+
34 }
+
35 }
+
36
+
37 ret = sum == N ? 0 : (sum > N ? 1 : -1);
+
38 // #ifdef DEBUG
+
39 // printf("%5lu: %5lu : %d\n", N, sum, ret);
+
40 // #endif
+
41 return ret;
+
42}
+
+
+
+ +

◆ is_abundant()

+ +
+
+ + + + + + + + +
unsigned long is_abundant (unsigned long N)
+
+ +

Is the given number an abundant number (1) or not (0)

+
48{
+
49 return get_perfect_number(N) == 1 ? 1 : 0;
+
50}
+
char get_perfect_number(unsigned long N)
Returns: -1 if N is deficient 1 if N is abundant 0 if N is perfect.
Definition: sol1.c:19
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+

◆ is_sum_of_abundant()

@@ -155,30 +258,112 @@ int 
Returns
1 - if yes
0 - if not
-
72 {
-
73  /* optimized logic:
-
74  * i + j = N where both i and j should be abundant
-
75  * hence we can simply check for j = N - i as we loop through i
-
76  */
-
77  for (unsigned long i = get_next_abundant(1); i <= (N >> 1);
-
78  i = get_next_abundant(i))
-
79  {
-
80  if (is_abundant(N - i))
-
81  {
-
82 #ifdef DEBUG
-
83  printf("\t%4lu + %4lu = %4lu\n", i, N - i, N);
-
84 #endif
-
85  return 1;
-
86  }
-
87  }
-
88  return 0;
-
89 }
-
unsigned long is_abundant(unsigned long N)
Is the given number an abundant number (1) or not (0)
Definition: sol1.c:47
+
72{
+
73 /* optimized logic:
+
74 * i + j = N where both i and j should be abundant
+
75 * hence we can simply check for j = N - i as we loop through i
+
76 */
+
77 for (unsigned long i = get_next_abundant(1); i <= (N >> 1);
+
78 i = get_next_abundant(i))
+
79 {
+
80 if (is_abundant(N - i))
+
81 {
+
82#ifdef DEBUG
+
83 printf("\t%4lu + %4lu = %4lu\n", i, N - i, N);
+
84#endif
+
85 return 1;
+
86 }
+
87 }
+
88 return 0;
+
89}
unsigned long get_next_abundant(unsigned long N)
Find the next abundant number after N and not including N.
Definition: sol1.c:55
Here is the call graph for this function:
-
+
+
+
+ +
+
+ +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char ** argv 
)
+
+ +

Main function.

+
93{
+
94 unsigned long MAX_N = 28123; /* upper limit of numbers to check */
+
95
+
96 unsigned long sum = 0;
+
97 if (argc == 2)
+
98 {
+
99 MAX_N = strtoul(argv[1], NULL, 10);
+
100 }
+
101
+
102#ifdef _OPENMP
+
103 printf("Using OpenMP parallleization with %d threads\n",
+
104 omp_get_max_threads());
+
105#else
+
106 printf("Not using parallleization!\n");
+
107#endif
+
108
+
109 double total_duration = 0.f;
+
110 long i;
+
111#ifdef _OPENMP
+
112#pragma omp parallel for reduction(+ : sum) schedule(runtime)
+
113#endif
+
114 for (i = 1; i <= MAX_N; i++)
+
115 {
+
116 clock_t start_time = clock();
+
117 if (!is_sum_of_abundant(i))
+
118 {
+
119 sum += i;
+
120 }
+
121 clock_t end_time = clock();
+
122 total_duration += (double)(end_time - start_time) / CLOCKS_PER_SEC;
+
123
+
124 printf("... %5lu: %8lu\r", i, sum);
+
125 if (i % 100 == 0)
+
126 {
+
127 fflush(stdout);
+
128 }
+
129 }
+
130
+
131 printf("Time taken: %.4g s\n", total_duration);
+
132 printf(
+
133 "Sum of numbers that cannot be represented as sum of two abundant "
+
134 "numbers : %lu\n",
+
135 sum);
+
136
+
137 return 0;
+
138}
+
char is_sum_of_abundant(unsigned long N)
check if a given number can be represented as a sum of two abundant numbers.
Definition: sol1.c:71
+
+Here is the call graph for this function:
+
+
@@ -190,7 +375,7 @@ Here is the call graph for this function:
diff --git a/d7/ddb/problem__23_2sol1_8c_a3ab61b5a1c4f2288625d160aa0ea8478_cgraph.map b/d7/ddb/problem__23_2sol1_8c_a3ab61b5a1c4f2288625d160aa0ea8478_cgraph.map index 9fc3754f6..8b248ad88 100644 --- a/d7/ddb/problem__23_2sol1_8c_a3ab61b5a1c4f2288625d160aa0ea8478_cgraph.map +++ b/d7/ddb/problem__23_2sol1_8c_a3ab61b5a1c4f2288625d160aa0ea8478_cgraph.map @@ -1,6 +1,6 @@ - - - - + + + + diff --git a/d7/ddb/problem__23_2sol1_8c_a3ab61b5a1c4f2288625d160aa0ea8478_cgraph.svg b/d7/ddb/problem__23_2sol1_8c_a3ab61b5a1c4f2288625d160aa0ea8478_cgraph.svg index 734ce2d5c..cb30f18c2 100644 --- a/d7/ddb/problem__23_2sol1_8c_a3ab61b5a1c4f2288625d160aa0ea8478_cgraph.svg +++ b/d7/ddb/problem__23_2sol1_8c_a3ab61b5a1c4f2288625d160aa0ea8478_cgraph.svg @@ -1,20 +1,66 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + is_sum_of_abundant - + Node1 - -is_sum_of_abundant + +is_sum_of_abundant @@ -22,52 +68,94 @@ Node2 - -get_next_abundant + +get_next_abundant Node1->Node2 - - + + Node3 - -is_abundant + +is_abundant Node1->Node3 - - + + Node2->Node3 - - + + Node4 - -get_perfect_number + +get_perfect_number Node3->Node4 - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/d7/ddb/problem__23_2sol1_8c_a3ab61b5a1c4f2288625d160aa0ea8478_cgraph_org.svg b/d7/ddb/problem__23_2sol1_8c_a3ab61b5a1c4f2288625d160aa0ea8478_cgraph_org.svg new file mode 100644 index 000000000..8c6ead42e --- /dev/null +++ b/d7/ddb/problem__23_2sol1_8c_a3ab61b5a1c4f2288625d160aa0ea8478_cgraph_org.svg @@ -0,0 +1,73 @@ + + + + + + +is_sum_of_abundant + + + +Node1 + + +is_sum_of_abundant + + + + + +Node2 + + +get_next_abundant + + + + + +Node1->Node2 + + + + + +Node3 + + +is_abundant + + + + + +Node1->Node3 + + + + + +Node2->Node3 + + + + + +Node4 + + +get_perfect_number + + + + + +Node3->Node4 + + + + + diff --git a/d7/ddb/problem__23_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map b/d7/ddb/problem__23_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map new file mode 100644 index 000000000..2ed8b155d --- /dev/null +++ b/d7/ddb/problem__23_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/d7/ddb/problem__23_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 b/d7/ddb/problem__23_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 new file mode 100644 index 000000000..6af03c4c3 --- /dev/null +++ b/d7/ddb/problem__23_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 @@ -0,0 +1 @@ +a5ea4aaf85ace3673cd450de254eee8a \ No newline at end of file diff --git a/d7/ddb/problem__23_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg b/d7/ddb/problem__23_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg new file mode 100644 index 000000000..345af7cb3 --- /dev/null +++ b/d7/ddb/problem__23_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg @@ -0,0 +1,176 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +is_sum_of_abundant + + + + + +Node1->Node2 + + + + + +Node3 + + +get_next_abundant + + + + + +Node2->Node3 + + + + + +Node4 + + +is_abundant + + + + + +Node2->Node4 + + + + + +Node3->Node4 + + + + + +Node5 + + +get_perfect_number + + + + + +Node4->Node5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/d7/ddb/problem__23_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph_org.svg b/d7/ddb/problem__23_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph_org.svg new file mode 100644 index 000000000..a5152bce3 --- /dev/null +++ b/d7/ddb/problem__23_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph_org.svg @@ -0,0 +1,88 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +is_sum_of_abundant + + + + + +Node1->Node2 + + + + + +Node3 + + +get_next_abundant + + + + + +Node2->Node3 + + + + + +Node4 + + +is_abundant + + + + + +Node2->Node4 + + + + + +Node3->Node4 + + + + + +Node5 + + +get_perfect_number + + + + + +Node4->Node5 + + + + + diff --git a/d7/ddb/problem__23_2sol1_8c_a4f128410e6582fe26488e2316cc96e17_cgraph.map b/d7/ddb/problem__23_2sol1_8c_a4f128410e6582fe26488e2316cc96e17_cgraph.map new file mode 100644 index 000000000..8d56a7d95 --- /dev/null +++ b/d7/ddb/problem__23_2sol1_8c_a4f128410e6582fe26488e2316cc96e17_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/d7/ddb/problem__23_2sol1_8c_a4f128410e6582fe26488e2316cc96e17_cgraph.md5 b/d7/ddb/problem__23_2sol1_8c_a4f128410e6582fe26488e2316cc96e17_cgraph.md5 new file mode 100644 index 000000000..aeda24515 --- /dev/null +++ b/d7/ddb/problem__23_2sol1_8c_a4f128410e6582fe26488e2316cc96e17_cgraph.md5 @@ -0,0 +1 @@ +b0294df4bef2bd022e60ced02f630b02 \ No newline at end of file diff --git a/d7/ddb/problem__23_2sol1_8c_a4f128410e6582fe26488e2316cc96e17_cgraph.svg b/d7/ddb/problem__23_2sol1_8c_a4f128410e6582fe26488e2316cc96e17_cgraph.svg new file mode 100644 index 000000000..520b65794 --- /dev/null +++ b/d7/ddb/problem__23_2sol1_8c_a4f128410e6582fe26488e2316cc96e17_cgraph.svg @@ -0,0 +1,37 @@ + + + + + + +is_abundant + + + +Node1 + + +is_abundant + + + + + +Node2 + + +get_perfect_number + + + + + +Node1->Node2 + + + + + diff --git a/d7/ddb/problem__23_2sol1_8c_ac5d600bf3077f4188afc4c5cd2c40eaf_cgraph.map b/d7/ddb/problem__23_2sol1_8c_ac5d600bf3077f4188afc4c5cd2c40eaf_cgraph.map new file mode 100644 index 000000000..7c9ff1c30 --- /dev/null +++ b/d7/ddb/problem__23_2sol1_8c_ac5d600bf3077f4188afc4c5cd2c40eaf_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/d7/ddb/problem__23_2sol1_8c_ac5d600bf3077f4188afc4c5cd2c40eaf_cgraph.md5 b/d7/ddb/problem__23_2sol1_8c_ac5d600bf3077f4188afc4c5cd2c40eaf_cgraph.md5 new file mode 100644 index 000000000..7a911d8b5 --- /dev/null +++ b/d7/ddb/problem__23_2sol1_8c_ac5d600bf3077f4188afc4c5cd2c40eaf_cgraph.md5 @@ -0,0 +1 @@ +2a68db880b8b6e1790c421f88b1071a4 \ No newline at end of file diff --git a/d7/ddb/problem__23_2sol1_8c_ac5d600bf3077f4188afc4c5cd2c40eaf_cgraph.svg b/d7/ddb/problem__23_2sol1_8c_ac5d600bf3077f4188afc4c5cd2c40eaf_cgraph.svg new file mode 100644 index 000000000..083f171e7 --- /dev/null +++ b/d7/ddb/problem__23_2sol1_8c_ac5d600bf3077f4188afc4c5cd2c40eaf_cgraph.svg @@ -0,0 +1,52 @@ + + + + + + +get_next_abundant + + + +Node1 + + +get_next_abundant + + + + + +Node2 + + +is_abundant + + + + + +Node1->Node2 + + + + + +Node3 + + +get_perfect_number + + + + + +Node2->Node3 + + + + + diff --git a/d7/de0/stack_8h_source.html b/d7/de0/stack_8h_source.html index 410fa9098..0f0d75196 100644 --- a/d7/de0/stack_8h_source.html +++ b/d7/de0/stack_8h_source.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: data_structures/stack/stack.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,52 +90,51 @@ $(document).ready(function(){initNavTree('d7/de0/stack_8h_source.html','../../')
-
-
stack.h
+
stack.h
-
1 /*
-
2  author: Christian Bender
-
3 
-
4  This header represents the public stack-interface.
-
5  The stack is generic and self growing.
-
6 */
-
7 
-
8 #ifndef __STACK__
-
9 #define __STACK__
-
10 
-
11 /*
-
12  initStack: initializes the stack with a capacity of 10 elements.
-
13 */
-
14 void initStack();
-
15 
-
16 /*
-
17  push: pushs the argument onto the stack
-
18 */
-
19 void push(void *object);
-
20 
-
21 /*
-
22  pop: pops the top element of the stack from the stack.
-
23  assumes: stack not empty.
-
24 */
-
25 void *pop();
-
26 
-
27 /*
-
28  size: gets the number of elements of the stack.
-
29 */
-
30 int size();
-
31 
-
32 /*
-
33  isEmpty(): returns 1 if stack is empty otherwise 0.
-
34 */
-
35 int isEmpty();
-
36 
-
37 /*
-
38  top: returns the top element from the stack without removing it.
-
39 */
-
40 void *top();
-
41 
-
42 #endif
+
1/*
+
2 author: Christian Bender
+
3
+
4 This header represents the public stack-interface.
+
5 The stack is generic and self growing.
+
6*/
+
7
+
8#ifndef __STACK__
+
9#define __STACK__
+
10
+
11/*
+
12 initStack: initializes the stack with a capacity of 10 elements.
+
13*/
+
14void initStack();
+
15
+
16/*
+
17 push: pushs the argument onto the stack
+
18*/
+
19void push(void *object);
+
20
+
21/*
+
22 pop: pops the top element of the stack from the stack.
+
23 assumes: stack not empty.
+
24*/
+
25void *pop();
+
26
+
27/*
+
28 size: gets the number of elements of the stack.
+
29*/
+
30int size();
+
31
+
32/*
+
33 isEmpty(): returns 1 if stack is empty otherwise 0.
+
34*/
+
35int isEmpty();
+
36
+
37/*
+
38 top: returns the top element from the stack without removing it.
+
39*/
+
40void *top();
+
41
+
42#endif
void push(struct Stack *p, char ch)
push function
Definition: infix_to_postfix.c:55
char pop(struct Stack *p)
pop function
Definition: infix_to_postfix.c:72
int isEmpty(struct Stack s)
isEmpty function
Definition: infix_to_postfix.c:112
@@ -145,7 +144,7 @@ $(document).ready(function(){initNavTree('d7/de0/stack_8h_source.html','../../') diff --git a/d7/ded/problem__10_2sol2_8c__incl.map b/d7/ded/problem__10_2sol2_8c__incl.map index 8c9538b08..884dbdf90 100644 --- a/d7/ded/problem__10_2sol2_8c__incl.map +++ b/d7/ded/problem__10_2sol2_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/d7/ded/problem__10_2sol2_8c__incl.svg b/d7/ded/problem__10_2sol2_8c__incl.svg index 27e9aa36a..441b138cd 100644 --- a/d7/ded/problem__10_2sol2_8c__incl.svg +++ b/d7/ded/problem__10_2sol2_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - -project_euler/problem + +project_euler/problem _10/sol2.c diff --git a/d7/dfc/struct_m_e_m_o_r_y___i_n_f_o_r_m_a_t_i_o_n__coll__graph.map b/d7/dfc/struct_m_e_m_o_r_y___i_n_f_o_r_m_a_t_i_o_n__coll__graph.map index 56caf37dd..090b011d0 100644 --- a/d7/dfc/struct_m_e_m_o_r_y___i_n_f_o_r_m_a_t_i_o_n__coll__graph.map +++ b/d7/dfc/struct_m_e_m_o_r_y___i_n_f_o_r_m_a_t_i_o_n__coll__graph.map @@ -1,3 +1,3 @@ - + diff --git a/d7/dfc/struct_m_e_m_o_r_y___i_n_f_o_r_m_a_t_i_o_n__coll__graph.svg b/d7/dfc/struct_m_e_m_o_r_y___i_n_f_o_r_m_a_t_i_o_n__coll__graph.svg index 0ae2d5cda..a4029f676 100644 --- a/d7/dfc/struct_m_e_m_o_r_y___i_n_f_o_r_m_a_t_i_o_n__coll__graph.svg +++ b/d7/dfc/struct_m_e_m_o_r_y___i_n_f_o_r_m_a_t_i_o_n__coll__graph.svg @@ -1,7 +1,7 @@ - Node1 - -MEMORY_INFORMATION + +MEMORY_INFORMATION Node1->Node1 - - - next -previous + + + next +previous diff --git a/d7/dfd/structdual__quat__.html b/d7/dfd/structdual__quat__.html index 8c27649a7..50f5af6db 100644 --- a/d7/dfd/structdual__quat__.html +++ b/d7/dfd/structdual__quat__.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: dual_quat_ 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() {
@@ -92,8 +92,7 @@ $(document).ready(function(){initNavTree('d7/dfd/structdual__quat__.html','../..
- +
@@ -104,23 +103,23 @@ $(document).ready(function(){initNavTree('d7/dfd/structdual__quat__.html','../..
Collaboration diagram for dual_quat_:
-
+
[legend]
- - + - +

+

Data Fields

-quaternion real
+quaternion real
 real part of dual quaternion
 
-quaternion dual
+quaternion dual
 dual part of dual quaternion
 

Detailed Description

-

a dual quaternion type

+

a dual quaternion type


The documentation for this struct was generated from the following file: @@ -130,7 +129,7 @@ Data Fields diff --git a/d8/d10/structlist.html b/d8/d10/structlist.html index b1e5e2fa5..3c11ccea1 100644 --- a/d8/d10/structlist.html +++ b/d8/d10/structlist.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: list 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() {
@@ -92,8 +92,7 @@ $(document).ready(function(){initNavTree('d8/d10/structlist.html','../../'); ini
-
-
list Struct Reference
+
list Struct Reference
@@ -106,22 +105,22 @@ Collaboration diagram for list:
[legend]
- - + - - +

+

Data Fields

-double value
+double value
 value saved on each node
 
+
struct list * next
 
-struct list * prev
+struct list * prev
 directing to other nodes or NULL
 

Detailed Description

-

Doubly linked list struct.

+

Doubly linked list struct.


The documentation for this struct was generated from the following file: @@ -131,7 +130,7 @@ struct list * 
diff --git a/d8/d10/structlist.js b/d8/d10/structlist.js index 04e27a997..8c0a81818 100644 --- a/d8/d10/structlist.js +++ b/d8/d10/structlist.js @@ -1,6 +1,5 @@ var structlist = [ - [ "next", "d8/d10/structlist.html#a1900fe79e875e2838625b2eb60837f8f", null ], [ "prev", "d8/d10/structlist.html#a2054c799f7580787a500df82d14ace25", null ], [ "value", "d8/d10/structlist.html#a5363bdc0495ab9ef0ed587c99b9a2b41", null ] ]; \ No newline at end of file diff --git a/d8/d11/newton__raphson__root_8c__incl.map b/d8/d11/newton__raphson__root_8c__incl.map index 1c20b81c7..0516ff5a0 100644 --- a/d8/d11/newton__raphson__root_8c__incl.map +++ b/d8/d11/newton__raphson__root_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/d8/d11/newton__raphson__root_8c__incl.svg b/d8/d11/newton__raphson__root_8c__incl.svg index bff2a989c..b69420467 100644 --- a/d8/d11/newton__raphson__root_8c__incl.svg +++ b/d8/d11/newton__raphson__root_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - -numerical_methods/newton + +numerical_methods/newton _raphson_root.c diff --git a/d8/d18/problem__1_2sol3_8c__incl.map b/d8/d18/problem__1_2sol3_8c__incl.map index dbff26f57..ba4473558 100644 --- a/d8/d18/problem__1_2sol3_8c__incl.map +++ b/d8/d18/problem__1_2sol3_8c__incl.map @@ -1,4 +1,4 @@ - - + + diff --git a/d8/d18/problem__1_2sol3_8c__incl.svg b/d8/d18/problem__1_2sol3_8c__incl.svg index 66d1ac89a..4d8634c1a 100644 --- a/d8/d18/problem__1_2sol3_8c__incl.svg +++ b/d8/d18/problem__1_2sol3_8c__incl.svg @@ -1,21 +1,21 @@ - - + project_euler/problem_1/sol3.c - + Node1 - + project_euler/problem -_1/sol3.c +_1/sol3.c @@ -23,16 +23,16 @@ Node2 - -stdio.h + +stdio.h Node1->Node2 - - + + diff --git a/d8/d1c/binary__search__tree_8c__incl.map b/d8/d1c/binary__search__tree_8c__incl.map index d88dda750..5fc167bd0 100644 --- a/d8/d1c/binary__search__tree_8c__incl.map +++ b/d8/d1c/binary__search__tree_8c__incl.map @@ -1,5 +1,5 @@ - - - + + + diff --git a/d8/d1c/binary__search__tree_8c__incl.svg b/d8/d1c/binary__search__tree_8c__incl.svg index d4e1d7fc5..c555aff96 100644 --- a/d8/d1c/binary__search__tree_8c__incl.svg +++ b/d8/d1c/binary__search__tree_8c__incl.svg @@ -1,21 +1,21 @@ - - + data_structures/binary_trees/binary_search_tree.c - + Node1 - + data_structures/binary -_trees/binary_search_tree.c +_trees/binary_search_tree.c @@ -23,31 +23,31 @@ Node2 - -stdio.h + +stdio.h Node1->Node2 - - + + Node3 - -stdlib.h + +stdlib.h Node1->Node3 - - + + diff --git a/d8/d26/decimal__to__any__base_8c__incl.map b/d8/d26/decimal__to__any__base_8c__incl.map new file mode 100644 index 000000000..760cdab65 --- /dev/null +++ b/d8/d26/decimal__to__any__base_8c__incl.map @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/d8/d26/decimal__to__any__base_8c__incl.md5 b/d8/d26/decimal__to__any__base_8c__incl.md5 new file mode 100644 index 000000000..e36029f32 --- /dev/null +++ b/d8/d26/decimal__to__any__base_8c__incl.md5 @@ -0,0 +1 @@ +7d5f9052ed6e68180e85f3d91b300bf0 \ No newline at end of file diff --git a/d8/d26/decimal__to__any__base_8c__incl.svg b/d8/d26/decimal__to__any__base_8c__incl.svg new file mode 100644 index 000000000..41e4d3599 --- /dev/null +++ b/d8/d26/decimal__to__any__base_8c__incl.svg @@ -0,0 +1,113 @@ + + + + + + +conversions/decimal_to_any_base.c + + + +Node1 + + +conversions/decimal +_to_any_base.c + + + + + +Node2 + + +stdio.h + + + + + +Node1->Node2 + + + + + +Node3 + + +string.h + + + + + +Node1->Node3 + + + + + +Node4 + + +stdint.h + + + + + +Node1->Node4 + + + + + +Node5 + + +stdbool.h + + + + + +Node1->Node5 + + + + + +Node6 + + +assert.h + + + + + +Node1->Node6 + + + + + +Node7 + + +stdlib.h + + + + + +Node1->Node7 + + + + + diff --git a/d8/d30/decimal__to__binary__recursion_8c.html b/d8/d30/decimal__to__binary__recursion_8c.html index 29d914956..05c4e7b63 100644 --- a/d8/d30/decimal__to__binary__recursion_8c.html +++ b/d8/d30/decimal__to__binary__recursion_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: conversions/decimal_to_binary_recursion.c 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/d30/decimal__to__binary__recursion_
-
-
decimal_to_binary_recursion.c File Reference
+
decimal_to_binary_recursion.c File Reference
@@ -103,28 +102,26 @@ $(document).ready(function(){initNavTree('d8/d30/decimal__to__binary__recursion_
Include dependency graph for decimal_to_binary_recursion.c:
-
+
- - - - - - + + + + +

+

Functions

int decimal_to_binary (unsigned int number)
 Decimal to binary using recursion algorithm. More...
 
-void test ()
 Test function.
 
-int main ()
 Driver Code.
void test ()
 Test function. More...
 
int main ()
 Driver Code. More...
 

Detailed Description

-

Convert decimal to binary using recursion algorithm.

+

Convert decimal to binary using recursion algorithm.

Function Documentation

- +

◆ decimal_to_binary()

@@ -141,18 +138,94 @@ int 

Decimal to binary using recursion algorithm.

-

For example, if number = 5, the function returns the decimal integer 101.

Parameters
+

For example, if number = 5, the function returns the decimal integer 101.

Parameters
numberpositive integer number to convert
Returns
integer with digits representing binary value representation of number.
-
15 {
-
16  return number == 0 ? 0 : number % 2 + 10 * decimal_to_binary(number / 2);
-
17 }
+
15{
+
16 return number == 0 ? 0 : number % 2 + 10 * decimal_to_binary(number / 2);
+
17}
int decimal_to_binary(unsigned int number)
Decimal to binary using recursion algorithm.
Definition: decimal_to_binary_recursion.c:14
-
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ main()

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

Driver Code.

+
35{
+
36 test();
+
37 return 0;
+
38}
+
void test()
Test function.
Definition: decimal_to_binary_recursion.c:20
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ test()

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

Test function.

+

Self-test implementations.

+
Returns
void
+
21{
+
22 const int sets[][2] = {
+
23 {0, 0}, {1, 1}, {2, 10}, {3, 11}, {4, 100}, {6, 110}, {7, 111},
+
24 /* add more data sets to test */
+
25 };
+
26
+
27 for (int i = 0, size = sizeof(sets) / sizeof(sets[0]); i < size; ++i)
+
28 {
+
29 assert(decimal_to_binary(sets[i][0]) == sets[i][1]);
+
30 }
+
31}
+
+Here is the call graph for this function:
+
+
+
+
+
@@ -161,7 +234,7 @@ int  diff --git a/d8/d30/decimal__to__binary__recursion_8c.js b/d8/d30/decimal__to__binary__recursion_8c.js index 789d9f78e..9c2586d5e 100644 --- a/d8/d30/decimal__to__binary__recursion_8c.js +++ b/d8/d30/decimal__to__binary__recursion_8c.js @@ -2,5 +2,5 @@ var decimal__to__binary__recursion_8c = [ [ "decimal_to_binary", "d8/d30/decimal__to__binary__recursion_8c.html#acbbe6358ec95b3201865a72b2ac522c8", null ], [ "main", "d8/d30/decimal__to__binary__recursion_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], - [ "test", "d8/d30/decimal__to__binary__recursion_8c.html#ae1a3968e7947464bee7714f6d43b7002", null ] + [ "test", "d8/d30/decimal__to__binary__recursion_8c.html#aa8dca7b867074164d5f45b0f3851269d", null ] ]; \ No newline at end of file diff --git a/d8/d30/decimal__to__binary__recursion_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map b/d8/d30/decimal__to__binary__recursion_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map new file mode 100644 index 000000000..1bf8e68be --- /dev/null +++ b/d8/d30/decimal__to__binary__recursion_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/d8/d30/decimal__to__binary__recursion_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 b/d8/d30/decimal__to__binary__recursion_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 new file mode 100644 index 000000000..ecb78d659 --- /dev/null +++ b/d8/d30/decimal__to__binary__recursion_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 @@ -0,0 +1 @@ +a244470d2d6c91694ffca6d876260881 \ No newline at end of file diff --git a/d8/d30/decimal__to__binary__recursion_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/d8/d30/decimal__to__binary__recursion_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg new file mode 100644 index 000000000..5b048f8a2 --- /dev/null +++ b/d8/d30/decimal__to__binary__recursion_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg @@ -0,0 +1,43 @@ + + + + + + +test + + + +Node1 + + +test + + + + + +Node2 + + +decimal_to_binary + + + + + +Node1->Node2 + + + + + +Node2->Node2 + + + + + diff --git a/d8/d30/decimal__to__binary__recursion_8c_acbbe6358ec95b3201865a72b2ac522c8_cgraph.map b/d8/d30/decimal__to__binary__recursion_8c_acbbe6358ec95b3201865a72b2ac522c8_cgraph.map new file mode 100644 index 000000000..010c8a780 --- /dev/null +++ b/d8/d30/decimal__to__binary__recursion_8c_acbbe6358ec95b3201865a72b2ac522c8_cgraph.map @@ -0,0 +1,3 @@ + + + diff --git a/d8/d30/decimal__to__binary__recursion_8c_acbbe6358ec95b3201865a72b2ac522c8_cgraph.md5 b/d8/d30/decimal__to__binary__recursion_8c_acbbe6358ec95b3201865a72b2ac522c8_cgraph.md5 new file mode 100644 index 000000000..f39ed585c --- /dev/null +++ b/d8/d30/decimal__to__binary__recursion_8c_acbbe6358ec95b3201865a72b2ac522c8_cgraph.md5 @@ -0,0 +1 @@ +c6cf2e67894556745ef8b9eb99c9e104 \ No newline at end of file diff --git a/d8/d30/decimal__to__binary__recursion_8c_acbbe6358ec95b3201865a72b2ac522c8_cgraph.svg b/d8/d30/decimal__to__binary__recursion_8c_acbbe6358ec95b3201865a72b2ac522c8_cgraph.svg new file mode 100644 index 000000000..f879789b0 --- /dev/null +++ b/d8/d30/decimal__to__binary__recursion_8c_acbbe6358ec95b3201865a72b2ac522c8_cgraph.svg @@ -0,0 +1,28 @@ + + + + + + +decimal_to_binary + + + +Node1 + + +decimal_to_binary + + + + + +Node1->Node1 + + + + + diff --git a/d8/d30/decimal__to__binary__recursion_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d8/d30/decimal__to__binary__recursion_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..15e949af3 --- /dev/null +++ b/d8/d30/decimal__to__binary__recursion_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/d8/d30/decimal__to__binary__recursion_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d8/d30/decimal__to__binary__recursion_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..8e31c7397 --- /dev/null +++ b/d8/d30/decimal__to__binary__recursion_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +b99516779f49517993297cd14cef8f4b \ No newline at end of file diff --git a/d8/d30/decimal__to__binary__recursion_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d8/d30/decimal__to__binary__recursion_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..9205b9f4e --- /dev/null +++ b/d8/d30/decimal__to__binary__recursion_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,58 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +test + + + + + +Node1->Node2 + + + + + +Node3 + + +decimal_to_binary + + + + + +Node2->Node3 + + + + + +Node3->Node3 + + + + + diff --git a/d8/d32/problem__25_2sol1_8c.html b/d8/d32/problem__25_2sol1_8c.html index 03709e664..854f66ff7 100644 --- a/d8/d32/problem__25_2sol1_8c.html +++ b/d8/d32/problem__25_2sol1_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_25/sol1.c 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/d32/problem__25_2sol1_8c.html','../
Macros | Functions
-
-
sol1.c File Reference
+
sol1.c File Reference
-

Problem 25 solution implemented using arbitrarily large numbers represented as arrays +

Problem 25 solution implemented using arbitrarily large numbers represented as arrays More...

#include <stdint.h>
#include <stdio.h>
@@ -112,36 +111,33 @@ Include dependency graph for sol1.c:
- - +

+

Macros

-#define MAX_DIGITS   1000
+#define MAX_DIGITS   1000
 maximum number of digits
 
- - - + + - - + + - - + +

+

Functions

unsigned int add_numbers (unsigned char *a, unsigned char *b, unsigned char *c, int N)
 Function to add arbitraty length decimal integers stored in an array. More...
 
-int print_number (unsigned char *number, int N)
 Print a large number.
int print_number (unsigned char *number, int N)
 Print a large number. More...
 
-unsigned int get_digits (unsigned char *number)
 Get number of digits in a large number.
unsigned int get_digits (unsigned char *number)
 Get number of digits in a large number. More...
 
-int main (int argc, char *argv[])
 Main function.
int main (int argc, char *argv[])
 Main function. More...
 

Detailed Description

-

Problem 25 solution implemented using arbitrarily large numbers represented as arrays

-
Author
Krishna Vedala
+

Problem 25 solution implemented using arbitrarily large numbers represented as arrays

+
Author
Krishna Vedala

Function Documentation

- +

◆ add_numbers()

@@ -180,47 +176,193 @@ int 

Function to add arbitraty length decimal integers stored in an array.

-


+


a + b = c = new b

-
21 {
-
22  unsigned char carry = 0;
-
23  unsigned int i;
-
24 
-
25  for (i = 0; i < N; i++)
-
26  {
-
27  // printf("\t%d + %d + %d ", a[i], b[i], carry);
-
28  c[i] = carry + a[i] + b[i];
-
29  if (c[i] > 9) /* check for carry */
-
30  {
-
31  carry = 1;
-
32  c[i] -= 10;
-
33  }
-
34  else
-
35  {
-
36  carry = 0;
-
37  }
-
38  // printf("= %d, %d\n", carry, c[i]);
-
39  }
-
40 
-
41  while (carry != 0)
-
42  {
-
43  // printf("\t\t...adding new digit\n");
-
44  // printf("\t0 + %d + %d ", b[i], carry);
-
45  c[i] = carry + c[i];
-
46  if (c[i] > 9)
-
47  {
-
48  carry = 1;
-
49  c[i] -= 10;
-
50  }
-
51  else
-
52  {
-
53  carry = 0;
-
54  }
-
55  // printf("= %d, %d\n", carry, c[i]);
-
56  i++;
-
57  }
-
58  return i;
-
59 }
+
21{
+
22 unsigned char carry = 0;
+
23 unsigned int i;
+
24
+
25 for (i = 0; i < N; i++)
+
26 {
+
27 // printf("\t%d + %d + %d ", a[i], b[i], carry);
+
28 c[i] = carry + a[i] + b[i];
+
29 if (c[i] > 9) /* check for carry */
+
30 {
+
31 carry = 1;
+
32 c[i] -= 10;
+
33 }
+
34 else
+
35 {
+
36 carry = 0;
+
37 }
+
38 // printf("= %d, %d\n", carry, c[i]);
+
39 }
+
40
+
41 while (carry != 0)
+
42 {
+
43 // printf("\t\t...adding new digit\n");
+
44 // printf("\t0 + %d + %d ", b[i], carry);
+
45 c[i] = carry + c[i];
+
46 if (c[i] > 9)
+
47 {
+
48 carry = 1;
+
49 c[i] -= 10;
+
50 }
+
51 else
+
52 {
+
53 carry = 0;
+
54 }
+
55 // printf("= %d, %d\n", carry, c[i]);
+
56 i++;
+
57 }
+
58 return i;
+
59}
+
+
+
+ +

◆ get_digits()

+ +
+
+ + + + + + + + +
unsigned int get_digits (unsigned char * number)
+
+ +

Get number of digits in a large number.

+
76{
+
77 unsigned int digits = MAX_DIGITS;
+
78 while (number[digits] == 0) digits--;
+
79 return digits;
+
80}
+
#define MAX_DIGITS
maximum number of digits
Definition: sol1.c:13
+
+
+
+ +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char * argv[] 
)
+
+ +

Main function.

+
84{
+
85 unsigned char
+
86 fn[MAX_DIGITS + 1]; /* array to store digits of a large number */
+
87 unsigned char fn1[MAX_DIGITS + 1];
+
88 unsigned char sum[MAX_DIGITS + 1];
+
89
+
90 memset(fn, 0, MAX_DIGITS);
+
91 memset(fn1, 0, MAX_DIGITS);
+
92 memset(sum, 0, MAX_DIGITS);
+
93
+
94 fn[0] = 1;
+
95 fn1[1] = 1;
+
96
+
97 unsigned int index = 1, digit_count = 1;
+
98
+
99 clock_t start_time = clock();
+
100 do
+
101 {
+
102 digit_count = add_numbers(fn, fn1, sum, digit_count);
+
103 // digit_count = get_digits(sum);
+
104
+
105 // printf("%5u (%u) (%u) ", index, digit_count, get_digits(sum));
+
106 // print_number(sum, digit_count);
+
107 // putchar('\n');
+
108
+
109 if (digit_count == MAX_DIGITS)
+
110 {
+
111 break;
+
112 }
+
113 memcpy(fn, fn1, MAX_DIGITS);
+
114 memcpy(fn1, sum, MAX_DIGITS);
+
115 index++;
+
116 } while (digit_count < MAX_DIGITS);
+
117 clock_t end_time = clock();
+
118
+
119 printf("Time taken: %.4g ms\n",
+
120 1e3 * (end_time - start_time) / CLOCKS_PER_SEC);
+
121 printf("The nth term for %d digits: %u \n", MAX_DIGITS, index--);
+
122 print_number(sum, digit_count);
+
123
+
124 return 0;
+
125}
+
int print_number(uint8_t *number, uint8_t N, int8_t num_digits_to_print)
Function to print a long number.
Definition: sol1.c:92
+
int add_numbers(uint8_t *a, uint8_t *b, uint8_t N)
Function to add arbitrary length decimal integers stored in an array.
Definition: sol1.c:48
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ print_number()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int print_number (unsigned char * number,
int N 
)
+
+ +

Print a large number.

+
63{
+
64 int start_pos = N - 1;
+
65
+
66 /* skip all initial zeros */
+
67 while (number[start_pos] == 0) start_pos--;
+
68
+
69 for (int i = start_pos; i >= 0; i--) putchar(number[i] + 0x30);
+
70
+
71 return 0;
+
72}
@@ -230,7 +372,7 @@ a + b = c = new b

diff --git a/d8/d32/problem__25_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map b/d8/d32/problem__25_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map new file mode 100644 index 000000000..014cf781f --- /dev/null +++ b/d8/d32/problem__25_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/d8/d32/problem__25_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 b/d8/d32/problem__25_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 new file mode 100644 index 000000000..7f8c1c205 --- /dev/null +++ b/d8/d32/problem__25_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 @@ -0,0 +1 @@ +50d5045b5ba19ab484cb135de70e851c \ No newline at end of file diff --git a/d8/d32/problem__25_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg b/d8/d32/problem__25_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg new file mode 100644 index 000000000..2f0d46084 --- /dev/null +++ b/d8/d32/problem__25_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg @@ -0,0 +1,52 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +add_numbers + + + + + +Node1->Node2 + + + + + +Node3 + + +print_number + + + + + +Node1->Node3 + + + + + diff --git a/d8/d38/queue_8h_source.html b/d8/d38/queue_8h_source.html index 41a6ae9d2..558f5291c 100644 --- a/d8/d38/queue_8h_source.html +++ b/d8/d38/queue_8h_source.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: data_structures/graphs/queue.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,43 +90,42 @@ $(document).ready(function(){initNavTree('d8/d38/queue_8h_source.html','../../')
-
-
queue.h
+
queue.h
-
1 // Queue ADT header file ... COMP2521
-
2 
-
3 typedef struct QueueRep *queue;
-
4 
-
5 queue newQueue(); // set up empty queue
-
6 void dropQueue(queue); // remove unwanted queue
-
7 int QueueIsEmpty(queue); // check whether queue is empty
-
8 void QueueEnqueue(queue, int); // insert an int at end of queue
-
9 int QueueDequeue(queue); // remove int from front of queue
-
10 
-
11 // By
-
12 // .----------------. .----------------. .----------------.
-
13 // .-----------------. .----------------. .----------------.
-
14 // | .--------------. || .--------------. || .--------------. ||
-
15 // .--------------. | | .--------------. || .--------------. | | | _________ |
-
16 // || | _____ _____ | || | __ | || | ____ _____ | | | | ____ ____
-
17 // | || | ____ | | | | | _ _ | | || ||_ _||_ _|| || | / \
-
18 // | || ||_ \|_ _| | | | | |_ || _| | || | .' `. | | | | |_/ | |
-
19 // \_| | || | | | | | | || | / /\ \ | || | | \ | | | | | | |
-
20 // |__| | | || | / .--. \ | | | | | | | || | | ' ' | | || |
-
21 // / ____ \ | || | | |\ \| | | | | | | __ | | || | | | | | | |
-
22 // | | _| |_ | || | \ `--' / | || | _/ / \ \_ | || | _| |_\ |_
-
23 // | | | | _| | | |_ | || | \ `--' / | | | | |_____| | || | `.__.'
-
24 // | || ||____| |____|| || ||_____|\____| | | | | |____||____| | || | `.____.'
-
25 // | | | | | || | | || | | || | | | | |
-
26 // | || | | | | '--------------' || '--------------' ||
-
27 // '--------------' || '--------------' | | '--------------' || '--------------'
-
28 // |
-
29 // '----------------' '----------------' '----------------'
-
30 // '----------------' '----------------' '----------------'
-
31 
-
32 // Email : z5261243@unsw.edu.au
-
33 // hhoanhtuann@gmail.com
+
1// Queue ADT header file ... COMP2521
+
2
+
3typedef struct QueueRep *queue;
+
4
+
5queue newQueue(); // set up empty queue
+
6void dropQueue(queue); // remove unwanted queue
+
7int QueueIsEmpty(queue); // check whether queue is empty
+
8void QueueEnqueue(queue, int); // insert an int at end of queue
+
9int QueueDequeue(queue); // remove int from front of queue
+
10
+
11// By
+
12// .----------------. .----------------. .----------------.
+
13// .-----------------. .----------------. .----------------.
+
14// | .--------------. || .--------------. || .--------------. ||
+
15// .--------------. | | .--------------. || .--------------. | | | _________ |
+
16// || | _____ _____ | || | __ | || | ____ _____ | | | | ____ ____
+
17// | || | ____ | | | | | _ _ | | || ||_ _||_ _|| || | / \
+
18// | || ||_ \|_ _| | | | | |_ || _| | || | .' `. | | | | |_/ | |
+
19// \_| | || | | | | | | || | / /\ \ | || | | \ | | | | | | |
+
20// |__| | | || | / .--. \ | | | | | | | || | | ' ' | | || |
+
21// / ____ \ | || | | |\ \| | | | | | | __ | | || | | | | | | |
+
22// | | _| |_ | || | \ `--' / | || | _/ / \ \_ | || | _| |_\ |_
+
23// | | | | _| | | |_ | || | \ `--' / | | | | |_____| | || | `.__.'
+
24// | || ||____| |____|| || ||_____|\____| | | | | |____||____| | || | `.____.'
+
25// | | | | | || | | || | | || | | | | |
+
26// | || | | | | '--------------' || '--------------' ||
+
27// '--------------' || '--------------' | | '--------------' || '--------------'
+
28// |
+
29// '----------------' '----------------' '----------------'
+
30// '----------------' '----------------' '----------------'
+
31
+
32// Email : z5261243@unsw.edu.au
+
33// hhoanhtuann@gmail.com
Definition: queue.c:14
Definition: bfs.c:6
@@ -135,7 +134,7 @@ $(document).ready(function(){initNavTree('d8/d38/queue_8h_source.html','../../') diff --git a/d8/d48/problem__10_2sol1_8c__incl.map b/d8/d48/problem__10_2sol1_8c__incl.map index e6de2a510..3ed261a4f 100644 --- a/d8/d48/problem__10_2sol1_8c__incl.map +++ b/d8/d48/problem__10_2sol1_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/d8/d48/problem__10_2sol1_8c__incl.svg b/d8/d48/problem__10_2sol1_8c__incl.svg index 582ba7d29..dd3c81f0d 100644 --- a/d8/d48/problem__10_2sol1_8c__incl.svg +++ b/d8/d48/problem__10_2sol1_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - -project_euler/problem + +project_euler/problem _10/sol1.c diff --git a/d8/d56/strong__number_8c__incl.map b/d8/d56/strong__number_8c__incl.map index 737a196c3..e516eea15 100644 --- a/d8/d56/strong__number_8c__incl.map +++ b/d8/d56/strong__number_8c__incl.map @@ -1,6 +1,6 @@ - + - - + + diff --git a/d8/d56/strong__number_8c__incl.svg b/d8/d56/strong__number_8c__incl.svg index dc501281b..9b362ae6e 100644 --- a/d8/d56/strong__number_8c__incl.svg +++ b/d8/d56/strong__number_8c__incl.svg @@ -1,20 +1,20 @@ - - + misc/strong_number.c - + Node1 - -misc/strong_number.c + +misc/strong_number.c @@ -30,38 +30,38 @@ Node1->Node2 - - + + Node3 - -stdbool.h + +stdbool.h Node1->Node3 - - + + Node4 - -stdio.h + +stdio.h Node1->Node4 - - + + diff --git a/d8/d68/problem__5_2sol2_8c__incl.map b/d8/d68/problem__5_2sol2_8c__incl.map index 4063dd959..9708e77f6 100644 --- a/d8/d68/problem__5_2sol2_8c__incl.map +++ b/d8/d68/problem__5_2sol2_8c__incl.map @@ -1,5 +1,5 @@ - - - + + + diff --git a/d8/d68/problem__5_2sol2_8c__incl.svg b/d8/d68/problem__5_2sol2_8c__incl.svg index 4d2256d6a..793246758 100644 --- a/d8/d68/problem__5_2sol2_8c__incl.svg +++ b/d8/d68/problem__5_2sol2_8c__incl.svg @@ -1,21 +1,21 @@ - - + project_euler/problem_5/sol2.c - + Node1 - + project_euler/problem -_5/sol2.c +_5/sol2.c @@ -23,31 +23,31 @@ Node2 - -stdio.h + +stdio.h Node1->Node2 - - + + Node3 - -stdlib.h + +stdlib.h Node1->Node3 - - + + diff --git a/d8/d6a/problem__8_2sol1_8c__incl.map b/d8/d6a/problem__8_2sol1_8c__incl.map index 5ce0fe4ea..96b80a889 100644 --- a/d8/d6a/problem__8_2sol1_8c__incl.map +++ b/d8/d6a/problem__8_2sol1_8c__incl.map @@ -1,5 +1,5 @@ - - - + + + diff --git a/d8/d6a/problem__8_2sol1_8c__incl.svg b/d8/d6a/problem__8_2sol1_8c__incl.svg index 400177930..5455efd8d 100644 --- a/d8/d6a/problem__8_2sol1_8c__incl.svg +++ b/d8/d6a/problem__8_2sol1_8c__incl.svg @@ -1,21 +1,21 @@ - - + project_euler/problem_8/sol1.c - + Node1 - + project_euler/problem -_8/sol1.c +_8/sol1.c @@ -23,31 +23,31 @@ Node2 - -stdio.h + +stdio.h Node1->Node2 - - + + Node3 - -stdlib.h + +stdlib.h Node1->Node3 - - + + diff --git a/d8/d71/group__k__means.html b/d8/d71/group__k__means.html index 423ef55ec..9afbad23b 100644 --- a/d8/d71/group__k__means.html +++ b/d8/d71/group__k__means.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: K-Means Clustering 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() {
@@ -94,45 +94,44 @@ $(document).ready(function(){initNavTree('d8/d71/group__k__means.html','../../') Data Structures | Typedefs | Functions -
-
K-Means Clustering Algorithm
+
K-Means Clustering Algorithm
Collaboration diagram for K-Means Clustering Algorithm:
-
+
-

+

Data Structures

struct  observation
 
struct  cluster
 
- - -

+

Typedefs

+
typedef struct observation observation
 
+
typedef struct cluster cluster
 
- - - + +

+

Functions

int calculateNearst (observation *o, cluster clusters[], int k)
 
void calculateCentroid (observation observations[], size_t size, cluster *centroid)
 
cluster * kMeans (observation observations[], size_t size, int k)
 
cluster * kMeans (observation observations[], size_t size, int k)
 

Detailed Description

Function Documentation

- +

◆ calculateCentroid()

@@ -163,7 +162,7 @@ Functions
-

Calculate centoid and assign it to the cluster variable

+

Calculate centoid and assign it to the cluster variable

Parameters
@@ -172,20 +171,20 @@ Functions
observationsan array of observations whose centroid is calculated
-
99 {
-
100  size_t i = 0;
-
101  centroid->x = 0;
-
102  centroid->y = 0;
-
103  centroid->count = size;
-
104  for (; i < size; i++)
-
105  {
-
106  centroid->x += observations[i].x;
-
107  centroid->y += observations[i].y;
-
108  observations[i].group = 0;
-
109  }
-
110  centroid->x /= centroid->count;
-
111  centroid->y /= centroid->count;
-
112 }
+
99{
+
100 size_t i = 0;
+
101 centroid->x = 0;
+
102 centroid->y = 0;
+
103 centroid->count = size;
+
104 for (; i < size; i++)
+
105 {
+
106 centroid->x += observations[i].x;
+
107 centroid->y += observations[i].y;
+
108 observations[i].group = 0;
+
109 }
+
110 centroid->x /= centroid->count;
+
111 centroid->y /= centroid->count;
+
112}
double y
ordinate of centroid of this cluster
Definition: k_means_clustering.c:55
double x
abscissa centroid of this cluster
Definition: k_means_clustering.c:54
size_t count
count of observations present in this cluster
Definition: k_means_clustering.c:56
@@ -195,7 +194,7 @@ Functions
- +

◆ calculateNearst()

@@ -226,7 +225,7 @@ Functions
-

Returns the index of centroid nearest to given observation

+

Returns the index of centroid nearest to given observation

Parameters
@@ -236,35 +235,35 @@ Functions
Returns
the index of nearest centroid for given observation
-
70 {
-
71  double minD = DBL_MAX;
-
72  double dist = 0;
-
73  int index = -1;
-
74  int i = 0;
-
75  for (; i < k; i++)
-
76  {
-
77  /* Calculate Squared Distance*/
-
78  dist = (clusters[i].x - o->x) * (clusters[i].x - o->x) +
-
79  (clusters[i].y - o->y) * (clusters[i].y - o->y);
-
80  if (dist < minD)
-
81  {
-
82  minD = dist;
-
83  index = i;
-
84  }
-
85  }
-
86  return index;
-
87 }
+
70{
+
71 double minD = DBL_MAX;
+
72 double dist = 0;
+
73 int index = -1;
+
74 int i = 0;
+
75 for (; i < k; i++)
+
76 {
+
77 /* Calculate Squared Distance*/
+
78 dist = (clusters[i].x - o->x) * (clusters[i].x - o->x) +
+
79 (clusters[i].y - o->y) * (clusters[i].y - o->y);
+
80 if (dist < minD)
+
81 {
+
82 minD = dist;
+
83 index = i;
+
84 }
+
85 }
+
86 return index;
+
87}
- -

◆ kMeans()

+ +

◆ kMeans()

oobservation
- + @@ -288,7 +287,7 @@ Functions
cluster* kMeans cluster * kMeans ( observation  observations[],
-

–K Means Algorithm–

    +

    –K Means Algorithm–

    1. Assign each observation to one of k groups creating a random initial clustering
    2. Find the centroid of observations for each cluster to form new centroids
    3. Find the centroid which is nearest for each observation among the calculated centroids
    4. @@ -304,86 +303,86 @@ Functions
      Returns
      pointer to cluster object
      -
      135 {
      -
      136  cluster* clusters = NULL;
      -
      137  if (k <= 1)
      -
      138  {
      -
      139  /*
      -
      140  If we have to cluster them only in one group
      -
      141  then calculate centroid of observations and
      -
      142  that will be a ingle cluster
      -
      143  */
      -
      144  clusters = (cluster*)malloc(sizeof(cluster));
      -
      145  memset(clusters, 0, sizeof(cluster));
      -
      146  calculateCentroid(observations, size, clusters);
      -
      147  }
      -
      148  else if (k < size)
      -
      149  {
      -
      150  clusters = malloc(sizeof(cluster) * k);
      -
      151  memset(clusters, 0, k * sizeof(cluster));
      -
      152  /* STEP 1 */
      -
      153  for (size_t j = 0; j < size; j++)
      -
      154  {
      -
      155  observations[j].group = rand() % k;
      -
      156  }
      -
      157  size_t changed = 0;
      -
      158  size_t minAcceptedError =
      -
      159  size /
      -
      160  10000; // Do until 99.99 percent points are in correct cluster
      -
      161  int t = 0;
      -
      162  do
      -
      163  {
      -
      164  /* Initialize clusters */
      -
      165  for (int i = 0; i < k; i++)
      -
      166  {
      -
      167  clusters[i].x = 0;
      -
      168  clusters[i].y = 0;
      -
      169  clusters[i].count = 0;
      -
      170  }
      -
      171  /* STEP 2*/
      -
      172  for (size_t j = 0; j < size; j++)
      -
      173  {
      -
      174  t = observations[j].group;
      -
      175  clusters[t].x += observations[j].x;
      -
      176  clusters[t].y += observations[j].y;
      -
      177  clusters[t].count++;
      -
      178  }
      -
      179  for (int i = 0; i < k; i++)
      -
      180  {
      -
      181  clusters[i].x /= clusters[i].count;
      -
      182  clusters[i].y /= clusters[i].count;
      -
      183  }
      -
      184  /* STEP 3 and 4 */
      -
      185  changed = 0; // this variable stores change in clustering
      -
      186  for (size_t j = 0; j < size; j++)
      -
      187  {
      -
      188  t = calculateNearst(observations + j, clusters, k);
      -
      189  if (t != observations[j].group)
      -
      190  {
      -
      191  changed++;
      -
      192  observations[j].group = t;
      -
      193  }
      -
      194  }
      -
      195  } while (changed > minAcceptedError); // Keep on grouping until we have
      -
      196  // got almost best clustering
      -
      197  }
      -
      198  else
      -
      199  {
      -
      200  /* If no of clusters is more than observations
      -
      201  each observation can be its own cluster
      -
      202  */
      -
      203  clusters = (cluster*)malloc(sizeof(cluster) * k);
      -
      204  memset(clusters, 0, k * sizeof(cluster));
      -
      205  for (int j = 0; j < size; j++)
      -
      206  {
      -
      207  clusters[j].x = observations[j].x;
      -
      208  clusters[j].y = observations[j].y;
      -
      209  clusters[j].count = 1;
      -
      210  observations[j].group = j;
      -
      211  }
      -
      212  }
      -
      213  return clusters;
      -
      214 }
      +
      135{
      +
      136 cluster* clusters = NULL;
      +
      137 if (k <= 1)
      +
      138 {
      +
      139 /*
      +
      140 If we have to cluster them only in one group
      +
      141 then calculate centroid of observations and
      +
      142 that will be a ingle cluster
      +
      143 */
      +
      144 clusters = (cluster*)malloc(sizeof(cluster));
      +
      145 memset(clusters, 0, sizeof(cluster));
      +
      146 calculateCentroid(observations, size, clusters);
      +
      147 }
      +
      148 else if (k < size)
      +
      149 {
      +
      150 clusters = malloc(sizeof(cluster) * k);
      +
      151 memset(clusters, 0, k * sizeof(cluster));
      +
      152 /* STEP 1 */
      +
      153 for (size_t j = 0; j < size; j++)
      +
      154 {
      +
      155 observations[j].group = rand() % k;
      +
      156 }
      +
      157 size_t changed = 0;
      +
      158 size_t minAcceptedError =
      +
      159 size /
      +
      160 10000; // Do until 99.99 percent points are in correct cluster
      +
      161 int t = 0;
      +
      162 do
      +
      163 {
      +
      164 /* Initialize clusters */
      +
      165 for (int i = 0; i < k; i++)
      +
      166 {
      +
      167 clusters[i].x = 0;
      +
      168 clusters[i].y = 0;
      +
      169 clusters[i].count = 0;
      +
      170 }
      +
      171 /* STEP 2*/
      +
      172 for (size_t j = 0; j < size; j++)
      +
      173 {
      +
      174 t = observations[j].group;
      +
      175 clusters[t].x += observations[j].x;
      +
      176 clusters[t].y += observations[j].y;
      +
      177 clusters[t].count++;
      +
      178 }
      +
      179 for (int i = 0; i < k; i++)
      +
      180 {
      +
      181 clusters[i].x /= clusters[i].count;
      +
      182 clusters[i].y /= clusters[i].count;
      +
      183 }
      +
      184 /* STEP 3 and 4 */
      +
      185 changed = 0; // this variable stores change in clustering
      +
      186 for (size_t j = 0; j < size; j++)
      +
      187 {
      +
      188 t = calculateNearst(observations + j, clusters, k);
      +
      189 if (t != observations[j].group)
      +
      190 {
      +
      191 changed++;
      +
      192 observations[j].group = t;
      +
      193 }
      +
      194 }
      +
      195 } while (changed > minAcceptedError); // Keep on grouping until we have
      +
      196 // got almost best clustering
      +
      197 }
      +
      198 else
      +
      199 {
      +
      200 /* If no of clusters is more than observations
      +
      201 each observation can be its own cluster
      +
      202 */
      +
      203 clusters = (cluster*)malloc(sizeof(cluster) * k);
      +
      204 memset(clusters, 0, k * sizeof(cluster));
      +
      205 for (int j = 0; j < size; j++)
      +
      206 {
      +
      207 clusters[j].x = observations[j].x;
      +
      208 clusters[j].y = observations[j].y;
      +
      209 clusters[j].count = 1;
      +
      210 observations[j].group = j;
      +
      211 }
      +
      212 }
      +
      213 return clusters;
      +
      214}
      int calculateNearst(observation *o, cluster clusters[], int k)
      Definition: k_means_clustering.c:69
      void calculateCentroid(observation observations[], size_t size, cluster *centroid)
      Definition: k_means_clustering.c:97
      #define malloc(bytes)
      This macro replace the standard malloc function with malloc_dbg.
      Definition: malloc_dbg.h:18
      @@ -391,7 +390,7 @@ Functions
      Here is the call graph for this function:
      -
      +
      @@ -402,7 +401,7 @@ Here is the call graph for this function:
      diff --git a/d8/d71/group__k__means.js b/d8/d71/group__k__means.js index 1e124a22b..6fd9cf86b 100644 --- a/d8/d71/group__k__means.js +++ b/d8/d71/group__k__means.js @@ -12,5 +12,5 @@ var group__k__means = ] ], [ "calculateCentroid", "d8/d71/group__k__means.html#gadee39a3f17bf5144df5592e48dbfc9f7", null ], [ "calculateNearst", "d8/d71/group__k__means.html#gad339c41d3ee9e6729aca9e9ab3f7d2d9", null ], - [ "kMeans", "d8/d71/group__k__means.html#gad229b1dc406cb5ea510f26a373ed8bfd", null ] + [ "kMeans", "d8/d71/group__k__means.html#gaf6259432561e794dea0e060f482d15e2", null ] ]; \ No newline at end of file diff --git a/d8/d71/group__k__means.map b/d8/d71/group__k__means.map index 6b9018c1c..41d75700f 100644 --- a/d8/d71/group__k__means.map +++ b/d8/d71/group__k__means.map @@ -1,4 +1,4 @@ - - + + diff --git a/d8/d71/group__k__means.svg b/d8/d71/group__k__means.svg index 96ed18be8..32d1a44fd 100644 --- a/d8/d71/group__k__means.svg +++ b/d8/d71/group__k__means.svg @@ -1,21 +1,21 @@ - - + K-Means Clustering Algorithm - + Node1 - -K-Means Clustering - Algorithm + +K-Means Clustering + Algorithm @@ -23,16 +23,16 @@ Node2 - -Machine learning algorithms + +Machine learning algorithms Node2->Node1 - - + + diff --git a/d8/d71/group__k__means_gad229b1dc406cb5ea510f26a373ed8bfd_cgraph.map b/d8/d71/group__k__means_gaf6259432561e794dea0e060f482d15e2_cgraph.map similarity index 76% rename from d8/d71/group__k__means_gad229b1dc406cb5ea510f26a373ed8bfd_cgraph.map rename to d8/d71/group__k__means_gaf6259432561e794dea0e060f482d15e2_cgraph.map index 2140efc27..a8cfa6efd 100644 --- a/d8/d71/group__k__means_gad229b1dc406cb5ea510f26a373ed8bfd_cgraph.map +++ b/d8/d71/group__k__means_gaf6259432561e794dea0e060f482d15e2_cgraph.map @@ -1,5 +1,5 @@ - - - + + + diff --git a/d8/d71/group__k__means_gad229b1dc406cb5ea510f26a373ed8bfd_cgraph.md5 b/d8/d71/group__k__means_gaf6259432561e794dea0e060f482d15e2_cgraph.md5 similarity index 100% rename from d8/d71/group__k__means_gad229b1dc406cb5ea510f26a373ed8bfd_cgraph.md5 rename to d8/d71/group__k__means_gaf6259432561e794dea0e060f482d15e2_cgraph.md5 diff --git a/d8/d71/group__k__means_gad229b1dc406cb5ea510f26a373ed8bfd_cgraph.svg b/d8/d71/group__k__means_gaf6259432561e794dea0e060f482d15e2_cgraph.svg similarity index 55% rename from d8/d71/group__k__means_gad229b1dc406cb5ea510f26a373ed8bfd_cgraph.svg rename to d8/d71/group__k__means_gaf6259432561e794dea0e060f482d15e2_cgraph.svg index e8e3398c8..b9b2f27c6 100644 --- a/d8/d71/group__k__means_gad229b1dc406cb5ea510f26a373ed8bfd_cgraph.svg +++ b/d8/d71/group__k__means_gaf6259432561e794dea0e060f482d15e2_cgraph.svg @@ -1,20 +1,20 @@ - - + kMeans - + Node1 - -kMeans + +kMeans @@ -22,31 +22,31 @@ Node2 - -calculateCentroid + +calculateCentroid Node1->Node2 - - + + Node3 - -calculateNearst + +calculateNearst Node1->Node3 - - + + diff --git a/d8/d7a/structtnode.html b/d8/d7a/structtnode.html index a99552858..3a114335e 100644 --- a/d8/d7a/structtnode.html +++ b/d8/d7a/structtnode.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: tnode 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() {
@@ -92,29 +92,28 @@ $(document).ready(function(){initNavTree('d8/d7a/structtnode.html','../../'); in
-
-
tnode Struct Reference
+
tnode Struct Reference
Collaboration diagram for tnode:
-
+
[legend]
- - - - -

+

Data Fields

+
char splitchar
 
+
Tptr lokid
 
+
Tptr eqkid
 
+
Tptr hikid
 
@@ -127,7 +126,7 @@ char splitchar
    - +
diff --git a/d8/d7a/structtnode.js b/d8/d7a/structtnode.js deleted file mode 100644 index 4d3e6ed5f..000000000 --- a/d8/d7a/structtnode.js +++ /dev/null @@ -1,7 +0,0 @@ -var structtnode = -[ - [ "eqkid", "d8/d7a/structtnode.html#ad302cb43ee1cab8a29581e8aaf76bbd4", null ], - [ "hikid", "d8/d7a/structtnode.html#ae1f202bf98d22f8316eeb71b68a59951", null ], - [ "lokid", "d8/d7a/structtnode.html#af7ce6341b8536c58a5a9ebdb4862a32a", null ], - [ "splitchar", "d8/d7a/structtnode.html#a44127c1d017332403d91a96a1633a76a", null ] -]; \ No newline at end of file diff --git a/d8/d7c/cartesian__to__polar_8c__incl.map b/d8/d7c/cartesian__to__polar_8c__incl.map index 91cd24f7a..e709a2ef0 100644 --- a/d8/d7c/cartesian__to__polar_8c__incl.map +++ b/d8/d7c/cartesian__to__polar_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/d8/d7c/cartesian__to__polar_8c__incl.svg b/d8/d7c/cartesian__to__polar_8c__incl.svg index daa768362..272bad6af 100644 --- a/d8/d7c/cartesian__to__polar_8c__incl.svg +++ b/d8/d7c/cartesian__to__polar_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - + misc/cartesian_to_polar.c diff --git a/d8/d7c/dict_8h_source.html b/d8/d7c/dict_8h_source.html index f7215de5d..1717c36d6 100644 --- a/d8/d7c/dict_8h_source.html +++ b/d8/d7c/dict_8h_source.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: data_structures/dictionary/dict.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,75 +90,74 @@ $(document).ready(function(){initNavTree('d8/d7c/dict_8h_source.html','../../');
-
-
dict.h
+
dict.h
-
1 /*
-
2  author: Christian Bender
-
3  public interface for the dictionary.
-
4 
-
5  The dictionary prepares space for 1000 elements.
-
6 */
-
7 
-
8 #ifndef __DICT__H
-
9 #define __DICT__H
-
10 
-
11 #define MAXELEMENTS 1000
-
12 
-
13 /*
-
14  special data type called 'Dictionary'
-
15  for generic use
-
16 */
-
17 typedef struct Dict
-
18 {
-
19  /*
-
20  void* array for generic use of the dictionary.
-
21  there actual saves the entries.
-
22  */
-
23  void *elements[MAXELEMENTS];
-
24 
-
25  /* contains the number of elements in this dictionary */
-
26  int number_of_elements;
-
27 
-
28 } Dictionary;
-
29 
-
30 /*
-
31  create_dict: is a simple constructor for creating
-
32  a dictionary and setting up the
-
33  member field 'number_of_elements'
-
34  and prepares the inner array 'elements'
-
35 */
-
36 Dictionary *create_dict(void);
-
37 
-
38 /*
-
39  add_item_label: adds item (void*) to the dictionary at given label
-
40  returns 0 if adding was sucessful otherwise -1
-
41 */
-
42 int add_item_label(Dictionary *, char label[], void *);
-
43 
-
44 /*
-
45  add_item_index: adds item (void*) to the dictionary at given index (int)
-
46  returns 0 if adding was sucessful otherwise -1
-
47 */
-
48 int add_item_index(Dictionary *, int index, void *);
-
49 
-
50 /*
-
51  get_element: returns the element at given label
-
52 */
-
53 void *get_element_label(Dictionary *, char[]);
-
54 
-
55 /*
-
56  get_element: returns the element at given index
-
57 */
-
58 void *get_element_index(Dictionary *, int);
-
59 
-
60 /*
-
61  simple destrcutor function
-
62 */
-
63 void destroy(Dictionary *);
-
64 
-
65 #endif
+
1/*
+
2 author: Christian Bender
+
3 public interface for the dictionary.
+
4
+
5 The dictionary prepares space for 1000 elements.
+
6*/
+
7
+
8#ifndef __DICT__H
+
9#define __DICT__H
+
10
+
11#define MAXELEMENTS 1000
+
12
+
13/*
+
14 special data type called 'Dictionary'
+
15 for generic use
+
16*/
+
17typedef struct Dict
+
18{
+
19 /*
+
20 void* array for generic use of the dictionary.
+
21 there actual saves the entries.
+
22 */
+
23 void *elements[MAXELEMENTS];
+
24
+
25 /* contains the number of elements in this dictionary */
+
26 int number_of_elements;
+
27
+ +
29
+
30/*
+
31 create_dict: is a simple constructor for creating
+
32 a dictionary and setting up the
+
33 member field 'number_of_elements'
+
34 and prepares the inner array 'elements'
+
35*/
+
36Dictionary *create_dict(void);
+
37
+
38/*
+
39 add_item_label: adds item (void*) to the dictionary at given label
+
40 returns 0 if adding was sucessful otherwise -1
+
41*/
+
42int add_item_label(Dictionary *, char label[], void *);
+
43
+
44/*
+
45 add_item_index: adds item (void*) to the dictionary at given index (int)
+
46 returns 0 if adding was sucessful otherwise -1
+
47*/
+
48int add_item_index(Dictionary *, int index, void *);
+
49
+
50/*
+
51 get_element: returns the element at given label
+
52*/
+
53void *get_element_label(Dictionary *, char[]);
+
54
+
55/*
+
56 get_element: returns the element at given index
+
57*/
+
58void *get_element_index(Dictionary *, int);
+
59
+
60/*
+
61 simple destrcutor function
+
62*/
+
63void destroy(Dictionary *);
+
64
+
65#endif
Definition: dict.h:18
@@ -166,7 +165,7 @@ $(document).ready(function(){initNavTree('d8/d7c/dict_8h_source.html','../../'); diff --git a/d8/d81/md_project_euler__r_e_a_d_m_e.html b/d8/d81/md_project_euler__r_e_a_d_m_e.html index 43d78865f..d0d89ef11 100644 --- a/d8/d81/md_project_euler__r_e_a_d_m_e.html +++ b/d8/d81/md_project_euler__r_e_a_d_m_e.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: ProjectEuler @@ -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,15 +89,14 @@ $(document).ready(function(){initNavTree('d8/d81/md_project_euler__r_e_a_d_m_e.h -
-
-
ProjectEuler
+
+
ProjectEuler
-

Problems are taken from https://projecteuler.net/.

-

Project Euler is a series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve. Project Euler is ideal for mathematicians who are learning to code.

-

Here the efficiency of your code is also checked. I've tried to provide all the best possible solutions.

-

PROBLEMS:

+

Problems are taken from https://projecteuler.net/.

+

Project Euler is a series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve. Project Euler is ideal for mathematicians who are learning to code.

+

Here the efficiency of your code is also checked. I've tried to provide all the best possible solutions.

+

PROBLEMS:

  1. If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3,5,6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below N.
  2. Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1,2,3,5,8,13,21,34,55,89,.. By considering the terms in the Fibonacci sequence whose values do not exceed n, find the sum of the even-valued terms.
    @@ -114,7 +113,7 @@ $(document).ready(function(){initNavTree('d8/d81/md_project_euler__r_e_a_d_m_e.h diff --git a/d8/d9e/problem__5_2sol3_8c__incl.map b/d8/d9e/problem__5_2sol3_8c__incl.map index 6820f39bc..897612270 100644 --- a/d8/d9e/problem__5_2sol3_8c__incl.map +++ b/d8/d9e/problem__5_2sol3_8c__incl.map @@ -1,4 +1,4 @@ - - + + diff --git a/d8/d9e/problem__5_2sol3_8c__incl.svg b/d8/d9e/problem__5_2sol3_8c__incl.svg index 54381de99..5e4acde44 100644 --- a/d8/d9e/problem__5_2sol3_8c__incl.svg +++ b/d8/d9e/problem__5_2sol3_8c__incl.svg @@ -1,21 +1,21 @@ - - + project_euler/problem_5/sol3.c - + Node1 - + project_euler/problem -_5/sol3.c +_5/sol3.c @@ -23,16 +23,16 @@ Node2 - -stdio.h + +stdio.h Node1->Node2 - - + + diff --git a/d8/da2/dynamic__array_8h_source.html b/d8/da2/dynamic__array_8h_source.html index 2cc7c774d..c1b36cfee 100644 --- a/d8/da2/dynamic__array_8h_source.html +++ b/d8/da2/dynamic__array_8h_source.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: data_structures/dynamic_array/dynamic_array.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,37 +90,36 @@ $(document).ready(function(){initNavTree('d8/da2/dynamic__array_8h_source.html',
-
-
dynamic_array.h
+
dynamic_array.h
-
1 #ifndef __DYNAMIC_ARRAY__
-
2 #define __DYNAMIC_ARRAY__
-
3 #define DEFAULT_CAPACITY 1 << 4
-
4 #define INDEX_OUT_OF_BOUNDS NULL
-
5 
-
6 typedef struct dynamic_array
-
7 {
-
8  void **items;
-
9  unsigned size;
-
10  unsigned capacity;
- -
12 
-
13 extern dynamic_array_t *init_dynamic_array();
-
14 
-
15 extern void *add(dynamic_array_t *da, const void *value);
-
16 
-
17 extern void *put(dynamic_array_t *da, const void *value, unsigned index);
-
18 
-
19 extern void *get(dynamic_array_t *da, const unsigned index);
-
20 
-
21 extern void delete (dynamic_array_t *da, const unsigned index);
-
22 
-
23 unsigned contains(const unsigned size, const unsigned index);
-
24 
-
25 extern void *retrive_copy_of_value(const void *value);
-
26 
-
27 #endif
+
1#ifndef __DYNAMIC_ARRAY__
+
2#define __DYNAMIC_ARRAY__
+
3#define DEFAULT_CAPACITY 1 << 4
+
4#define INDEX_OUT_OF_BOUNDS NULL
+
5
+
6typedef struct dynamic_array
+
7{
+
8 void **items;
+
9 unsigned size;
+
10 unsigned capacity;
+ +
12
+
13extern dynamic_array_t *init_dynamic_array();
+
14
+
15extern void *add(dynamic_array_t *da, const void *value);
+
16
+
17extern void *put(dynamic_array_t *da, const void *value, unsigned index);
+
18
+
19extern void *get(dynamic_array_t *da, const unsigned index);
+
20
+
21extern void delete (dynamic_array_t *da, const unsigned index);
+
22
+
23unsigned contains(const unsigned size, const unsigned index);
+
24
+
25extern void *retrive_copy_of_value(const void *value);
+
26
+
27#endif
Definition: dynamic_array.h:7
@@ -128,7 +127,7 @@ $(document).ready(function(){initNavTree('d8/da2/dynamic__array_8h_source.html', diff --git a/d8/db5/sudoku__solver_8c__incl.map b/d8/db5/sudoku__solver_8c__incl.map index 66df4bde7..5494c399c 100644 --- a/d8/db5/sudoku__solver_8c__incl.map +++ b/d8/db5/sudoku__solver_8c__incl.map @@ -1,10 +1,10 @@ - + - - - - + + + + diff --git a/d8/db5/sudoku__solver_8c__incl.svg b/d8/db5/sudoku__solver_8c__incl.svg index b468fee23..26ffbf71f 100644 --- a/d8/db5/sudoku__solver_8c__incl.svg +++ b/d8/db5/sudoku__solver_8c__incl.svg @@ -1,19 +1,19 @@ - - + misc/sudoku_solver.c - + Node1 - + misc/sudoku_solver.c @@ -67,7 +67,7 @@ Node5 - + stdbool.h @@ -82,46 +82,46 @@ Node6 - -stdio.h + +stdio.h Node1->Node6 - - + + Node7 - -stdlib.h + +stdlib.h Node1->Node7 - - + + Node8 - -string.h + +string.h Node1->Node8 - - + + diff --git a/d8/db8/structkohonen__array__3d.html b/d8/db8/structkohonen__array__3d.html index 401bfb80f..7c64e23a5 100644 --- a/d8/db8/structkohonen__array__3d.html +++ b/d8/db8/structkohonen__array__3d.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: kohonen_array_3d 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() {
@@ -92,35 +92,34 @@ $(document).ready(function(){initNavTree('d8/db8/structkohonen__array__3d.html',

to store info regarding 3D arrays More...

- - + - + - + - +

+

Data Fields

-int dim1
+int dim1
 lengths of first dimension
 
-int dim2
+int dim2
 lengths of second dimension
 
-int dim3
+int dim3
 lengths of thirddimension
 
-double * data
+double * data
 pointer to data
 

Detailed Description

-

to store info regarding 3D arrays

+

to store info regarding 3D arrays


The documentation for this struct was generated from the following file: @@ -130,7 +129,7 @@ double * 
diff --git a/d8/dc1/udp__client_8c__incl.map b/d8/dc1/udp__client_8c__incl.map index 45ce4e17c..94da0dcc0 100644 --- a/d8/dc1/udp__client_8c__incl.map +++ b/d8/dc1/udp__client_8c__incl.map @@ -1,12 +1,12 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/d8/dc1/udp__client_8c__incl.svg b/d8/dc1/udp__client_8c__incl.svg index 0e9634a5f..965dc9989 100644 --- a/d8/dc1/udp__client_8c__incl.svg +++ b/d8/dc1/udp__client_8c__incl.svg @@ -1,7 +1,7 @@ - @@ -46,7 +46,7 @@ if (edges && edges.length) { @@ -54,13 +54,13 @@ var sectionId = 'dynsection-0'; client_server/udp_client.c - + Node1 - -client_server/udp_client.c + +client_server/udp_client.c @@ -68,136 +68,136 @@ var sectionId = 'dynsection-0'; Node2 - -arpa/inet.h + +arpa/inet.h Node1->Node2 - - + + Node3 - -netdb.h + +netdb.h Node1->Node3 - - + + Node4 - -netinet/in.h + +netinet/in.h Node1->Node4 - - + + Node5 - -sys/socket.h + +sys/socket.h Node1->Node5 - - + + Node6 - -sys/types.h + +sys/types.h Node1->Node6 - - + + Node7 - -unistd.h + +unistd.h Node1->Node7 - - + + Node8 - -stdio.h + +stdio.h Node1->Node8 - - + + Node9 - -stdlib.h + +stdlib.h Node1->Node9 - - + + Node10 - -string.h + +string.h Node1->Node10 - - + + diff --git a/d8/dc1/udp__client_8c__incl_org.svg b/d8/dc1/udp__client_8c__incl_org.svg index c695a91e3..fe9216483 100644 --- a/d8/dc1/udp__client_8c__incl_org.svg +++ b/d8/dc1/udp__client_8c__incl_org.svg @@ -1,20 +1,20 @@ - - + client_server/udp_client.c - + Node1 - -client_server/udp_client.c + +client_server/udp_client.c @@ -22,136 +22,136 @@ Node2 - -arpa/inet.h + +arpa/inet.h Node1->Node2 - - + + Node3 - -netdb.h + +netdb.h Node1->Node3 - - + + Node4 - -netinet/in.h + +netinet/in.h Node1->Node4 - - + + Node5 - -sys/socket.h + +sys/socket.h Node1->Node5 - - + + Node6 - -sys/types.h + +sys/types.h Node1->Node6 - - + + Node7 - -unistd.h + +unistd.h Node1->Node7 - - + + Node8 - -stdio.h + +stdio.h Node1->Node8 - - + + Node9 - -stdlib.h + +stdlib.h Node1->Node9 - - + + Node10 - -string.h + +string.h Node1->Node10 - - + + diff --git a/d8/dca/udp__server_8c.html b/d8/dca/udp__server_8c.html index 2638cfc10..4dd05ecc9 100644 --- a/d8/dca/udp__server_8c.html +++ b/d8/dca/udp__server_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: client_server/udp_server.c 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('d8/dca/udp__server_8c.html','../../');
Macros | Functions
-
-
udp_server.c File Reference
+
udp_server.c File Reference
@@ -116,37 +115,114 @@ Include dependency graph for udp_server.c:
- - + - +

+

Macros

-#define PORT   8080
+#define PORT   8080
 port number to connect to
 
-#define MAXLINE   1024
+#define MAXLINE   1024
 maximum characters per line
 
- - - + +

+

Functions

-int main ()
 Driver code.
int main ()
 Driver code. More...
 

Detailed Description

-

Server side implementation of UDP client-server model.

-
Author
TheShubham99
+

Server side implementation of UDP client-server model.

+
Author
TheShubham99
-Krishna Vedala
+Krishna Vedala
See also
client_server/udp_client.c
-
+

Function Documentation

+ +

◆ main()

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

Driver code.

+
36{
+
37#ifdef _WIN32
+
38 // when using winsock2.h, startup required
+
39 WSADATA wsData;
+
40 if (WSAStartup(MAKEWORD(2, 2), &wsData) != 0)
+
41 {
+
42 perror("WSA Startup error: \n");
+
43 return 0;
+
44 }
+
45
+
46 atexit(cleanup); // register at-exit function
+
47#endif
+
48
+
49 int sockfd;
+
50 char buffer[MAXLINE];
+
51 char *hello = "Hello from server";
+
52 struct sockaddr_in servaddr, cliaddr;
+
53
+
54 // Creating socket file descriptor
+
55 if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
+
56 {
+
57 perror("socket creation failed");
+
58 exit(EXIT_FAILURE);
+
59 }
+
60
+
61 memset(&servaddr, 0, sizeof(servaddr));
+
62 memset(&cliaddr, 0, sizeof(cliaddr));
+
63
+
64 // Filling server information
+
65 servaddr.sin_family = AF_INET; // IPv4
+
66 servaddr.sin_addr.s_addr = INADDR_ANY;
+
67 servaddr.sin_port = htons(PORT);
+
68
+
69 // Bind the socket with the server address
+
70 if (bind(sockfd, (const struct sockaddr *)&servaddr, sizeof(servaddr)) < 0)
+
71 {
+
72 perror("bind failed");
+
73 exit(EXIT_FAILURE);
+
74 }
+
75
+
76 unsigned int len;
+
77 int n;
+
78 n = recvfrom(sockfd, (char *)buffer, MAXLINE, MSG_WAITALL,
+
79 (struct sockaddr *)&cliaddr, &len);
+
80 buffer[n] = '\0';
+
81 printf("Client : %s\n", buffer);
+
82 sendto(sockfd, (const char *)hello, strlen(hello), 0,
+
83 (const struct sockaddr *)&cliaddr, len);
+
84 printf("Hello message sent.\n");
+
85
+
86 close(sockfd);
+
87
+
88 return 0;
+
89}
+
struct used to store character in certain times
Definition: min_printf.h:31
+
#define MAXLINE
maximum characters per line
Definition: udp_server.c:27
+
#define PORT
port number to connect to
Definition: udp_server.c:26
+
+
+
+ diff --git a/d8/dcc/min__printf_8h__incl.map b/d8/dcc/min__printf_8h__incl.map new file mode 100644 index 000000000..a671603a3 --- /dev/null +++ b/d8/dcc/min__printf_8h__incl.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/d8/dcc/min__printf_8h__incl.md5 b/d8/dcc/min__printf_8h__incl.md5 new file mode 100644 index 000000000..dd9faa4b6 --- /dev/null +++ b/d8/dcc/min__printf_8h__incl.md5 @@ -0,0 +1 @@ +483423f8412c91165d497a1ff0406bac \ No newline at end of file diff --git a/d8/dcc/min__printf_8h__incl.svg b/d8/dcc/min__printf_8h__incl.svg new file mode 100644 index 000000000..892504089 --- /dev/null +++ b/d8/dcc/min__printf_8h__incl.svg @@ -0,0 +1,68 @@ + + + + + + +developer_tools/min_printf.h + + + +Node1 + + +developer_tools/min +_printf.h + + + + + +Node2 + + +stdlib.h + + + + + +Node1->Node2 + + + + + +Node3 + + +unistd.h + + + + + +Node1->Node3 + + + + + +Node4 + + +stdarg.h + + + + + +Node1->Node4 + + + + + diff --git a/d8/de0/problem__9_2sol2_8c.html b/d8/de0/problem__9_2sol2_8c.html index 349f5fd75..673635b01 100644 --- a/d8/de0/problem__9_2sol2_8c.html +++ b/d8/de0/problem__9_2sol2_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_9/sol2.c 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,43 +92,82 @@ $(document).ready(function(){initNavTree('d8/de0/problem__9_2sol2_8c.html','../.
-
-
sol2.c File Reference
+
sol2.c File Reference
-

Problem 9 solution +

Problem 9 solution More...

#include <stdio.h>
#include <stdlib.h>
Include dependency graph for sol2.c:
-
+
- - - + +

+

Functions

-int main (void)
 Main function.
int main (void)
 Main function. More...
 

Detailed Description

-

Problem 9 solution

-
Author
Krishna Vedala
+

Problem 9 solution

+
Author
Krishna Vedala

Problem Statement: A Pythagorean triplet is a set of three natural numbers, \(a < b < c\), for which, \(a^2 + b^2 = c^2\). For example, \(3^2 + 4^2 = 9 + 16 = 25 = 5^2\). There exists exactly one Pythagorean triplet for which \(a + b + c = 1000\). Find the product abc.

-

Given \(a^2 + b^2 = c^2\) and \(a+b+c = n\), we can write:

+

Given \(a^2 + b^2 = c^2\) and \(a+b+c = n\), we can write:

\begin{eqnarray*} b &=& \frac{n^2 - 2an}{2n - 2a}\\ c &=& n - a - b \end{eqnarray*}

-
+

Function Documentation

+ +

◆ main()

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

Main function.

+
24{
+
25 int N = 1000;
+
26
+
27 for (int a = 1; a < 300; a++)
+
28 {
+
29 long tmp1 = N * N - 2 * a * N;
+
30 long tmp2 = 2 * (N - a);
+
31 div_t tmp3 = div(tmp1, tmp2);
+
32 int b = tmp3.quot;
+
33 int c = N - a - b;
+
34
+
35 if (a * a + b * b == c * c)
+
36 {
+
37 printf("%d x %d x %d = %ld\n", a, b, c, (long int)a * b * c);
+
38 return 0;
+
39 }
+
40 }
+
41
+
42 return 0;
+
43}
+
+
+
+
diff --git a/d8/dfc/hexadecimal__to__octal2_8c__incl.map b/d8/dfc/hexadecimal__to__octal2_8c__incl.map index 26bdf2c4b..95f4823f3 100644 --- a/d8/dfc/hexadecimal__to__octal2_8c__incl.map +++ b/d8/dfc/hexadecimal__to__octal2_8c__incl.map @@ -1,5 +1,5 @@ - - - + + + diff --git a/d8/dfc/hexadecimal__to__octal2_8c__incl.svg b/d8/dfc/hexadecimal__to__octal2_8c__incl.svg index 21073e76c..916cdfdd5 100644 --- a/d8/dfc/hexadecimal__to__octal2_8c__incl.svg +++ b/d8/dfc/hexadecimal__to__octal2_8c__incl.svg @@ -1,21 +1,21 @@ - - + conversions/hexadecimal_to_octal2.c - + Node1 - + conversions/hexadecimal -_to_octal2.c +_to_octal2.c @@ -23,31 +23,31 @@ Node2 - -stdio.h + +stdio.h Node1->Node2 - - + + Node3 - -string.h + +string.h Node1->Node3 - - + + diff --git a/d9/d41/md_data_structures_array__r_e_a_d_m_e.html b/d9/d41/md_data_structures_array__r_e_a_d_m_e.html index c9ffe4037..976646b05 100644 --- a/d9/d41/md_data_structures_array__r_e_a_d_m_e.html +++ b/d9/d41/md_data_structures_array__r_e_a_d_m_e.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Array @@ -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,21 +89,20 @@ $(document).ready(function(){initNavTree('d9/d41/md_data_structures_array__r_e_a -
-
-
Array
+
+
Array
-

Simple array of integers. With I/O functions, Sort Functions and Search Functions.

+

Simple array of integers. With I/O functions, Sort Functions and Search Functions.

Sort Function

-

The Sort function sorts the elements in the range in a particular order. The different types of sorting methods are Bubble Sort, Selection Sort, Merge Sort and Quick Sort. Bubble Sort repeatedly sorts the adjacent elements if they are in wrong order.

+

The Sort function sorts the elements in the range in a particular order. The different types of sorting methods are Bubble Sort, Selection Sort, Merge Sort and Quick Sort. Bubble Sort repeatedly sorts the adjacent elements if they are in wrong order.

Structure

-
typedef struct CArray {
+
typedef struct CArray {
int *array;
int size;
-
} CArray;
+
} CArray;
Definition: carray.h:32

Files

@@ -118,7 +117,7 @@ Files diff --git a/d9/d5c/struct_queue_rep__coll__graph.map b/d9/d5c/struct_queue_rep__coll__graph.map index 28a6fd6dd..07faa4220 100644 --- a/d9/d5c/struct_queue_rep__coll__graph.map +++ b/d9/d5c/struct_queue_rep__coll__graph.map @@ -1,4 +1,4 @@ - - + + diff --git a/d9/d5c/struct_queue_rep__coll__graph.svg b/d9/d5c/struct_queue_rep__coll__graph.svg index 56b564375..af6a4d512 100644 --- a/d9/d5c/struct_queue_rep__coll__graph.svg +++ b/d9/d5c/struct_queue_rep__coll__graph.svg @@ -1,20 +1,20 @@ - - + QueueRep - + Node1 - -QueueRep + +QueueRep @@ -22,32 +22,32 @@ Node2 - -node + +node Node2->Node1 - - - head -tail + + + head +tail Node2->Node2 - - - left -leftNode -link -next -par -pre -right -rightNode + + + left +leftNode +link +next +par +pre +right +rightNode diff --git a/d9/d66/group__machine__learning.html b/d9/d66/group__machine__learning.html index c434cae42..9ac162d11 100644 --- a/d9/d66/group__machine__learning.html +++ b/d9/d66/group__machine__learning.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Machine learning algorithms @@ -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,18 +92,17 @@ $(document).ready(function(){initNavTree('d9/d66/group__machine__learning.html',
-
-
Machine learning algorithms
+
Machine learning algorithms
Collaboration diagram for Machine learning algorithms:
-
+
- @@ -120,7 +119,7 @@ Modules diff --git a/d9/d66/group__machine__learning.map b/d9/d66/group__machine__learning.map index 886de7fad..4f9e5b028 100644 --- a/d9/d66/group__machine__learning.map +++ b/d9/d66/group__machine__learning.map @@ -1,7 +1,7 @@ - - - - - + + + + + diff --git a/d9/d66/group__machine__learning.md5 b/d9/d66/group__machine__learning.md5 index bee95aea5..00875894a 100644 --- a/d9/d66/group__machine__learning.md5 +++ b/d9/d66/group__machine__learning.md5 @@ -1 +1 @@ -1b1067ef0dd6b97e058272966493ff11 \ No newline at end of file +7586e7c205bfad71bee891b6f4741082 \ No newline at end of file diff --git a/d9/d66/group__machine__learning.svg b/d9/d66/group__machine__learning.svg index 289ab81e2..7c3d5ab18 100644 --- a/d9/d66/group__machine__learning.svg +++ b/d9/d66/group__machine__learning.svg @@ -1,20 +1,20 @@ - - + Machine learning algorithms - + Node2 - -Adaline learning algorithm + +Adaline learning algorithm @@ -22,29 +22,29 @@ Node3 - -K-Means Clustering - Algorithm - - - - - -Node4 - - -Kohonen SOM topology - algorithm + +K-Means Clustering + Algorithm - + Node5 - - -Kohonen SOM trace/chain - algorithm + + +Kohonen SOM trace/chain + algorithm + + + + + +Node4 + + +Kohonen SOM topology + algorithm @@ -52,34 +52,34 @@ Node1 - -Machine learning algorithms + +Machine learning algorithms Node1->Node2 - - + + Node1->Node3 - - - - - -Node1->Node4 - - + + Node1->Node5 - - + + + + + +Node1->Node4 + + diff --git a/d9/d75/problem__15_2sol1_8c__incl.map b/d9/d75/problem__15_2sol1_8c__incl.map index ea371f23f..3c4598512 100644 --- a/d9/d75/problem__15_2sol1_8c__incl.map +++ b/d9/d75/problem__15_2sol1_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/d9/d75/problem__15_2sol1_8c__incl.svg b/d9/d75/problem__15_2sol1_8c__incl.svg index 85eed4248..674128af9 100644 --- a/d9/d75/problem__15_2sol1_8c__incl.svg +++ b/d9/d75/problem__15_2sol1_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - -project_euler/problem + +project_euler/problem _15/sol1.c diff --git a/d9/d7e/problem__20_2sol1_8c__incl.map b/d9/d7e/problem__20_2sol1_8c__incl.map index 6f3ef2292..474e212c2 100644 --- a/d9/d7e/problem__20_2sol1_8c__incl.map +++ b/d9/d7e/problem__20_2sol1_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/d9/d7e/problem__20_2sol1_8c__incl.svg b/d9/d7e/problem__20_2sol1_8c__incl.svg index 2174eabca..85fc33294 100644 --- a/d9/d7e/problem__20_2sol1_8c__incl.svg +++ b/d9/d7e/problem__20_2sol1_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - -project_euler/problem + +project_euler/problem _20/sol1.c diff --git a/d9/d85/ode__semi__implicit__euler_8c__incl.map b/d9/d85/ode__semi__implicit__euler_8c__incl.map index 6716c7426..0d27145c9 100644 --- a/d9/d85/ode__semi__implicit__euler_8c__incl.map +++ b/d9/d85/ode__semi__implicit__euler_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/d9/d85/ode__semi__implicit__euler_8c__incl.svg b/d9/d85/ode__semi__implicit__euler_8c__incl.svg index dba5edb35..ae5bbf0a9 100644 --- a/d9/d85/ode__semi__implicit__euler_8c__incl.svg +++ b/d9/d85/ode__semi__implicit__euler_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - -numerical_methods/ode + +numerical_methods/ode _semi_implicit_euler.c diff --git a/d9/d8b/structmat__3x3__.html b/d9/d8b/structmat__3x3__.html index bf82b3de0..716794f68 100644 --- a/d9/d8b/structmat__3x3__.html +++ b/d9/d8b/structmat__3x3__.html @@ -2,8 +2,8 @@ - - + +Algorithms_in_C: mat_3x3_ Struct Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ @@ -42,21 +41,22 @@

+

Modules

 Adaline learning algorithm
 
-
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('d9/d8b/structmat__3x3__.html','../../'
@@ -104,16 +103,16 @@ $(document).ready(function(){initNavTree('d9/d8b/structmat__3x3__.html','../../'
Collaboration diagram for mat_3x3_:
-
+
[legend]
- - +   float   row1 [3] - +   float   row2 [3] - +   float   row3 [3]

+

Data Fields

+
union {
-   float   row1 [3]
 < 3 element row 1
 
@@ -121,10 +120,10 @@ union {
 
}; 
 
+
union {
-   float   row2 [3]
 < 3 element row 2
 
@@ -132,10 +131,10 @@ union {
 
}; 
 
+
union {
-   float   row3 [3]
 < 3 element row 3
 
@@ -145,7 +144,7 @@ union {
 

Detailed Description

-

A 3x3 Matrix type definition.

+

A 3x3 Matrix type definition.


The documentation for this struct was generated from the following file: @@ -155,7 +154,7 @@ union { diff --git a/d9/d8b/structmat__3x3__.js b/d9/d8b/structmat__3x3__.js index df1b0f6cd..7b0aa7781 100644 --- a/d9/d8b/structmat__3x3__.js +++ b/d9/d8b/structmat__3x3__.js @@ -2,8 +2,5 @@ var structmat__3x3__ = [ [ "row1", "d9/d8b/structmat__3x3__.html#ac74f33a2e1ad1f6db74d94807cf1f64e", null ], [ "row2", "d9/d8b/structmat__3x3__.html#a8d7ae8fbcc408e3c30e9d64bbd28feaf", null ], - [ "row3", "d9/d8b/structmat__3x3__.html#a490bb6be52ea95b333b55b236af41563", null ], - [ "vec1", "d9/d8b/structmat__3x3__.html#a083420b13a87ebece08b6c7d49081e8a", null ], - [ "vec2", "d9/d8b/structmat__3x3__.html#a79b11a5d4e23d7965cbb151fdc5bda32", null ], - [ "vec3", "d9/d8b/structmat__3x3__.html#ad2f6310ba8af97d333888128ca7a6f7d", null ] + [ "row3", "d9/d8b/structmat__3x3__.html#a490bb6be52ea95b333b55b236af41563", null ] ]; \ No newline at end of file diff --git a/d9/da7/problem__10_2sol2_8c.html b/d9/da7/problem__10_2sol2_8c.html index 02311615c..aeca234bb 100644 --- a/d9/da7/problem__10_2sol2_8c.html +++ b/d9/da7/problem__10_2sol2_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_10/sol2.c 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/da7/problem__10_2sol2_8c.html','../
-
-
sol2.c File Reference
+
sol2.c File Reference
-

Problem 10 solution +

Problem 10 solution More...

#include <math.h>
#include <stdio.h>
@@ -109,23 +108,100 @@ Include dependency graph for sol2.c:
- - - + +

+

Functions

-int main (int argc, char *argv[])
 Main function.
int main (int argc, char *argv[])
 Main function. More...
 

Detailed Description

-

Problem 10 solution

-
Author
Krishna Vedala
-
+

Problem 10 solution

+
Author
Krishna Vedala
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char * argv[] 
)
+
+ +

Main function.

+
12{
+
13 long n = 100;
+
14 long long sum = 0;
+
15 char *sieve = NULL;
+
16
+
17 if (argc == 2) /* if command line argument is provided */
+
18 n = atol(argv[1]); /* use that as the upper limit */
+
19
+
20 /* allocate memory for the sieve */
+
21 sieve = calloc(n, sizeof(*sieve));
+
22 if (!sieve)
+
23 {
+
24 perror("Unable to allocate memory!");
+
25 return -1;
+
26 }
+
27
+
28 /* build sieve of Eratosthenes
+
29 In the array,
+
30 * if i^th cell is '1', then 'i' is composite
+
31 * if i^th cell is '0', then 'i' is prime
+
32 */
+
33 for (long i = 2; i < sqrtl(n); i++)
+
34 {
+
35 /* if i^th element is prime, mark all its multiples
+
36 as composites */
+
37 if (!sieve[i])
+
38 {
+
39 for (long j = i * i; j < n + 1; j += i)
+
40 {
+
41 sieve[j] = 1;
+
42 }
+
43 sum += i;
+
44 }
+
45 }
+
46
+
47 for (long i = sqrtl(n) + 1; i < n; i++)
+
48 if (!sieve[i])
+
49 sum += i;
+
50
+
51 free(sieve);
+
52
+
53 printf("%ld: %lld\n", n, sum);
+
54
+
55 return 0;
+
56}
+
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
+
#define calloc(elemCount, elemSize)
This macro replace the standard calloc function with calloc_dbg.
Definition: malloc_dbg.h:22
+
+
+
+
diff --git a/d9/dc9/hash__crc32_8c.html b/d9/dc9/hash__crc32_8c.html index 05e8283d2..c8820b86e 100644 --- a/d9/dc9/hash__crc32_8c.html +++ b/d9/dc9/hash__crc32_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: hash/hash_crc32.c 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/dc9/hash__crc32_8c.html','../../');
-
-
hash_crc32.c File Reference
+
hash_crc32.c File Reference
-

32-bit CRC hash algorithm +

32-bit CRC hash algorithm More...

#include <assert.h>
#include <inttypes.h>
@@ -109,7 +108,7 @@ Include dependency graph for hash_crc32.c:
- @@ -117,21 +116,52 @@ Functions - - + +

+

Functions

uint32_t crc32 (const char *s)
 32-bit CRC algorithm implementation More...
void test_crc32 ()
 Test function for crc32. More...
 
-int main ()
 Main function.
int main ()
 Main function. More...
 

Detailed Description

-

32-bit CRC hash algorithm

-
Author
Christian Bender
-
+

32-bit CRC hash algorithm

+
Author
Christian Bender
+

Function Documentation

+ +

◆ main()

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

Main function.

+
55{
+
56 test_crc32();
+
57 return 0;
+
58}
+
void test_crc32()
Test function for crc32.
Definition: hash_crc32.c:42
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ diff --git a/d9/dc9/hash__crc32_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d9/dc9/hash__crc32_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..2e59d699c --- /dev/null +++ b/d9/dc9/hash__crc32_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/d9/dc9/hash__crc32_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d9/dc9/hash__crc32_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..638d171a7 --- /dev/null +++ b/d9/dc9/hash__crc32_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +e19ffe1727b0188c90a1036774c7cef9 \ No newline at end of file diff --git a/d9/dc9/hash__crc32_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d9/dc9/hash__crc32_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..63ac2362d --- /dev/null +++ b/d9/dc9/hash__crc32_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,52 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +test_crc32 + + + + + +Node1->Node2 + + + + + +Node3 + + +crc32 + + + + + +Node2->Node3 + + + + + diff --git a/d9/dcc/adaline__learning_8c__incl.map b/d9/dcc/adaline__learning_8c__incl.map index d3d8b7c01..335baccb3 100644 --- a/d9/dcc/adaline__learning_8c__incl.map +++ b/d9/dcc/adaline__learning_8c__incl.map @@ -1,10 +1,10 @@ - + - - - - + + + + diff --git a/d9/dcc/adaline__learning_8c__incl.svg b/d9/dcc/adaline__learning_8c__incl.svg index ce08ac837..e51721f75 100644 --- a/d9/dcc/adaline__learning_8c__incl.svg +++ b/d9/dcc/adaline__learning_8c__incl.svg @@ -1,20 +1,20 @@ - - + machine_learning/adaline_learning.c - + Node1 - -machine_learning/adaline + +machine_learning/adaline _learning.c @@ -68,7 +68,7 @@ Node5 - + stdbool.h @@ -83,46 +83,46 @@ Node6 - -stdio.h + +stdio.h Node1->Node6 - - + + Node7 - -stdlib.h + +stdlib.h Node1->Node7 - - + + Node8 - -time.h + +time.h Node1->Node8 - - + + diff --git a/d9/dcc/prim_8c.html b/d9/dcc/prim_8c.html new file mode 100644 index 000000000..1d33bf97b --- /dev/null +++ b/d9/dcc/prim_8c.html @@ -0,0 +1,530 @@ + + + + + + + +Algorithms_in_C: greedy_approach/prim.c File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Algorithms_in_C 1.0.0 +
+
Set of algorithms implemented in C.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
prim.c File Reference
+
+
+ +

Prim's algorithm implementation in C to find the MST of a weighted, connected graph. +More...

+
#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include <inttypes.h>
+
+Include dependency graph for prim.c:
+
+
+
+
+
+ + + + + + +

+Macros

#define MAX   20
 for IO operations More...
 
+#define INF   999
 
+ + + + + + + + + + + + + + + + +

+Functions

uint16_t minimum (uint16_t arr[], uint16_t N)
 Finds index of minimum element in edge list for an arbitrary vertex. More...
 
void prim (uint16_t G[][MAX], uint16_t MST[][MAX], uint16_t V)
 Used to find MST of user-generated adj matrix G. More...
 
static void test (uint16_t G[][MAX], uint16_t MST[][MAX], uint16_t V)
 Self-test implementations. More...
 
void user_graph (uint16_t G[][MAX], uint16_t MST[][MAX], uint16_t V)
 Function user_graph(); gets user input adj. More...
 
int main (int argc, char const *argv[])
 Main function. More...
 
+

Detailed Description

+

Prim's algorithm implementation in C to find the MST of a weighted, connected graph.

+
Author
Timothy Maloney
+

Prim's algorithm uses a greedy approach to generate the MST of a weighted connected graph. The algorithm begins at an arbitrary vertex v, and selects a next vertex u, where v and u are connected by a weighted edge whose weight is the minimum of all edges connected to v. @references Page 319 "Introduction to the Design and Analysis of Algorithms" - Anany Levitin

+

To test - run './prim -test' prim() will find the MST of the following adj. matrix:

+

0 1 2 3 1 0 4 6 2 4 0 5 3 6 5 0

+

The minimum spanning tree for the above weighted connected graph is given by the following adj matrix:

+

0 1 2 3 1 0 0 0 2 0 0 0 3 0 0 0

+

The following link provides a visual representation of graphs that can be used to test/verify the algorithm for different adj matrices and their weighted, connected graphs.

+

Macro Definition Documentation

+ +

◆ MAX

+ +
+
+ + + + +
#define MAX   20
+
+ +

for IO operations

+

for string comparison for assert() for uint16_t

+ +
+
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char const * argv[] 
)
+
+ +

Main function.

+
Parameters
+ + + +
argccommandline argument count (ignored)
argvcommandline array of arguments (ignored)
+
+
+
Returns
0 on exit
+

< weighted, connected graph G

+

< adj matrix to hold minimum spanning tree of G

+

< number of vertices in V in G

+
186{
+
187
+
188 uint16_t G[MAX][MAX]; ///< weighted, connected graph G
+
189 uint16_t MST[MAX][MAX]; ///< adj matrix to hold minimum spanning tree of G
+
190 uint16_t V; ///< number of vertices in V in G
+
191
+
192
+
193 if(argc == 2 && strcmp(argv[1],"-test") == 0)
+
194 {
+
195 test(&(*G),&(*MST),V);
+
196 }
+
197 else
+
198 {
+
199 user_graph(&(*G),&(*MST),V);
+
200 }
+
201
+
202 return 0;
+
203}
+
#define MAX
for IO operations
Definition: prim.c:36
+
void user_graph(uint16_t G[][MAX], uint16_t MST[][MAX], uint16_t V)
Function user_graph(); gets user input adj.
Definition: prim.c:145
+
static void test(uint16_t G[][MAX], uint16_t MST[][MAX], uint16_t V)
Self-test implementations.
Definition: prim.c:113
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ minimum()

+ +
+
+ + + + + + + + + + + + + + + + + + +
uint16_t minimum (uint16_t arr[],
uint16_t N 
)
+
+ +

Finds index of minimum element in edge list for an arbitrary vertex.

+
Parameters
+ + + +
arrgraph row
Nnumber of elements in arr
+
+
+
Returns
index of minimum element in arr
+
46{
+
47 uint16_t index = 0;
+
48 uint16_t min = INF;
+
49
+
50 for (uint16_t i = 0; i < N; i++)
+
51 {
+
52 if (arr[i] < min)
+
53 {
+
54 min = arr[i];
+
55 index = i;
+
56 }
+
57 }
+
58 return index;
+
59}
+
#define min(a, b)
shorthand for minimum value
Definition: kohonen_som_topology.c:43
+
+
+
+ +

◆ prim()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void prim (uint16_t G[][MAX],
uint16_t MST[][MAX],
uint16_t V 
)
+
+ +

Used to find MST of user-generated adj matrix G.

+
Returns
void
+
66{
+
67 uint16_t u, v;
+
68 uint16_t E_t[MAX], path[MAX];
+
69 uint16_t V_t[MAX], no_of_edges;
+
70
+
71 E_t[0] = 0; // edges for current vertex
+
72 V_t[0] = 1; // list of visited vertices
+
73
+
74 for (uint16_t i = 1; i < V; i++)
+
75 {
+
76 E_t[i] = G[i][0];
+
77 path[i] = 0;
+
78 V_t[i] = 0;
+
79 }
+
80
+
81 no_of_edges = V - 1;
+
82
+
83 while (no_of_edges > 0)
+
84 {
+
85 u = minimum(E_t, V);
+
86 while (V_t[u] == 1)
+
87 {
+
88 E_t[u] = INF;
+
89 u = minimum(E_t, V);
+
90 }
+
91
+
92 v = path[u];
+
93 MST[v][u] = E_t[u];
+
94 MST[u][v] = E_t[u];
+
95 no_of_edges--;
+
96 V_t[u] = 1;
+
97
+
98 for (uint16_t i = 1; i < V; i++)
+
99 {
+
100 if (V_t[i] == 0 && G[u][i] < E_t[i])
+
101 {
+
102 E_t[i] = G[u][i];
+
103 path[i] = v;
+
104 }
+
105 }
+
106 }
+
107}
+
uint16_t minimum(uint16_t arr[], uint16_t N)
Finds index of minimum element in edge list for an arbitrary vertex.
Definition: prim.c:45
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ test()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static void test (uint16_t G[][MAX],
uint16_t MST[][MAX],
uint16_t V 
)
+
+static
+
+ +

Self-test implementations.

+
Returns
void
+
114{
+
115
+
116 uint16_t test[4][4] = {{0,1,2,3},{1,0,4,6},{2,4,0,5},{3,6,5,0}};
+
117 uint16_t solution[4][4] = {{0,1,2,3},{1,0,0,0},{2,0,0,0},{3,0,0,0}};
+
118
+
119 V = 4;
+
120
+
121 for(uint16_t i = 0; i < V; ++i)
+
122 {
+
123 for(uint16_t j = 0; j < V; ++j)
+
124 {
+
125 G[i][j] = test[i][j];
+
126 }
+
127 }
+
128
+
129 prim(&(*G),&(*MST),V);
+
130
+
131 for(uint16_t i = 0; i < V; ++i)
+
132 {
+
133 for(uint16_t j = 0; j < V; ++j)
+
134 {
+
135 assert(MST[i][j] == solution[i][j]);
+
136 }
+
137 }
+
138}
+
void prim(uint16_t G[][MAX], uint16_t MST[][MAX], uint16_t V)
Used to find MST of user-generated adj matrix G.
Definition: prim.c:65
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ user_graph()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void user_graph (uint16_t G[][MAX],
uint16_t MST[][MAX],
uint16_t V 
)
+
+ +

Function user_graph(); gets user input adj.

+

matrix and finds MST of that graph

Returns
void
+
146{
+
147 printf("Enter the number of vertices: ");
+
148 scanf(" %hd", &V);
+
149
+
150 assert(V <= MAX);
+
151
+
152 printf("Enter the adj matrix\n");
+
153 uint16_t i, j;
+
154 for (i = 0; i < V; ++i)
+
155 {
+
156 for (j = 0; j < V; ++j)
+
157 {
+
158 printf("G[%d][%d]: ", i, j);
+
159 scanf(" %hd", &G[i][j]);
+
160 if (G[i][j] == 0)
+
161 G[i][j] = INF;
+
162 }
+
163 }
+
164
+
165 prim(&(*G),&(*MST),V);
+
166
+
167 printf("minimum spanning tree:\n");
+
168 for (i = 0; i < V; ++i)
+
169 {
+
170 printf("\n");
+
171 for (j = 0; j < V; ++j)
+
172 {
+
173 printf("%d\t", MST[i][j]);
+
174 }
+
175 }
+
176}
+
+
+
+
+
+ + + + diff --git a/d9/dcc/prim_8c.js b/d9/dcc/prim_8c.js new file mode 100644 index 000000000..d08a2928b --- /dev/null +++ b/d9/dcc/prim_8c.js @@ -0,0 +1,9 @@ +var prim_8c = +[ + [ "MAX", "d9/dcc/prim_8c.html#a392fb874e547e582e9c66a08a1f23326", null ], + [ "main", "d9/dcc/prim_8c.html#abf9e6b7e6f15df4b525a2e7705ba3089", null ], + [ "minimum", "d9/dcc/prim_8c.html#a72ec66b10f86d67064d34f2b2717fdfc", null ], + [ "prim", "d9/dcc/prim_8c.html#a0bea087eb586c437cf0a667f794c8853", null ], + [ "test", "d9/dcc/prim_8c.html#aff3f4c22009b2aa4e385a76a8a1cdc1c", null ], + [ "user_graph", "d9/dcc/prim_8c.html#addac7a8c7bfd3e5573dad1f6aeff7768", null ] +]; \ No newline at end of file diff --git a/d9/dcc/prim_8c_a0bea087eb586c437cf0a667f794c8853_cgraph.map b/d9/dcc/prim_8c_a0bea087eb586c437cf0a667f794c8853_cgraph.map new file mode 100644 index 000000000..7242ef4cf --- /dev/null +++ b/d9/dcc/prim_8c_a0bea087eb586c437cf0a667f794c8853_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/d9/dcc/prim_8c_a0bea087eb586c437cf0a667f794c8853_cgraph.md5 b/d9/dcc/prim_8c_a0bea087eb586c437cf0a667f794c8853_cgraph.md5 new file mode 100644 index 000000000..a3694affb --- /dev/null +++ b/d9/dcc/prim_8c_a0bea087eb586c437cf0a667f794c8853_cgraph.md5 @@ -0,0 +1 @@ +4673c7b594dbc48c3ff24b2d21264622 \ No newline at end of file diff --git a/d9/dcc/prim_8c_a0bea087eb586c437cf0a667f794c8853_cgraph.svg b/d9/dcc/prim_8c_a0bea087eb586c437cf0a667f794c8853_cgraph.svg new file mode 100644 index 000000000..122ac9c7e --- /dev/null +++ b/d9/dcc/prim_8c_a0bea087eb586c437cf0a667f794c8853_cgraph.svg @@ -0,0 +1,37 @@ + + + + + + +prim + + + +Node1 + + +prim + + + + + +Node2 + + +minimum + + + + + +Node1->Node2 + + + + + diff --git a/d9/dcc/prim_8c_abf9e6b7e6f15df4b525a2e7705ba3089_cgraph.map b/d9/dcc/prim_8c_abf9e6b7e6f15df4b525a2e7705ba3089_cgraph.map new file mode 100644 index 000000000..a28b9014d --- /dev/null +++ b/d9/dcc/prim_8c_abf9e6b7e6f15df4b525a2e7705ba3089_cgraph.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/d9/dcc/prim_8c_abf9e6b7e6f15df4b525a2e7705ba3089_cgraph.md5 b/d9/dcc/prim_8c_abf9e6b7e6f15df4b525a2e7705ba3089_cgraph.md5 new file mode 100644 index 000000000..9436f4a25 --- /dev/null +++ b/d9/dcc/prim_8c_abf9e6b7e6f15df4b525a2e7705ba3089_cgraph.md5 @@ -0,0 +1 @@ +4649d56acad3fe15d35d06b9c074dfba \ No newline at end of file diff --git a/d9/dcc/prim_8c_abf9e6b7e6f15df4b525a2e7705ba3089_cgraph.svg b/d9/dcc/prim_8c_abf9e6b7e6f15df4b525a2e7705ba3089_cgraph.svg new file mode 100644 index 000000000..b28d6d4f9 --- /dev/null +++ b/d9/dcc/prim_8c_abf9e6b7e6f15df4b525a2e7705ba3089_cgraph.svg @@ -0,0 +1,88 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +test + + + + + +Node1->Node2 + + + + + +Node5 + + +user_graph + + + + + +Node1->Node5 + + + + + +Node2->Node2 + + + + + +Node3 + + +prim + + + + + +Node2->Node3 + + + + + +Node4 + + +minimum + + + + + +Node3->Node4 + + + + + diff --git a/d9/dcc/prim_8c_aff3f4c22009b2aa4e385a76a8a1cdc1c_cgraph.map b/d9/dcc/prim_8c_aff3f4c22009b2aa4e385a76a8a1cdc1c_cgraph.map new file mode 100644 index 000000000..d2752ebc9 --- /dev/null +++ b/d9/dcc/prim_8c_aff3f4c22009b2aa4e385a76a8a1cdc1c_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/d9/dcc/prim_8c_aff3f4c22009b2aa4e385a76a8a1cdc1c_cgraph.md5 b/d9/dcc/prim_8c_aff3f4c22009b2aa4e385a76a8a1cdc1c_cgraph.md5 new file mode 100644 index 000000000..6e2dfdca0 --- /dev/null +++ b/d9/dcc/prim_8c_aff3f4c22009b2aa4e385a76a8a1cdc1c_cgraph.md5 @@ -0,0 +1 @@ +01cb5f4a306561087cb316f2d6dedae8 \ No newline at end of file diff --git a/d9/dcc/prim_8c_aff3f4c22009b2aa4e385a76a8a1cdc1c_cgraph.svg b/d9/dcc/prim_8c_aff3f4c22009b2aa4e385a76a8a1cdc1c_cgraph.svg new file mode 100644 index 000000000..fd02c92a3 --- /dev/null +++ b/d9/dcc/prim_8c_aff3f4c22009b2aa4e385a76a8a1cdc1c_cgraph.svg @@ -0,0 +1,58 @@ + + + + + + +test + + + +Node1 + + +test + + + + + +Node1->Node1 + + + + + +Node2 + + +prim + + + + + +Node1->Node2 + + + + + +Node3 + + +minimum + + + + + +Node2->Node3 + + + + + diff --git a/d9/dd7/struct__cantor__set.html b/d9/dd7/struct__cantor__set.html index 3b53ffa79..b22af7e45 100644 --- a/d9/dd7/struct__cantor__set.html +++ b/d9/dd7/struct__cantor__set.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: _cantor_set 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() {
@@ -92,8 +92,7 @@ $(document).ready(function(){initNavTree('d9/dd7/struct__cantor__set.html','../.
-
-
_cantor_set Struct Reference
+
_cantor_set Struct Reference
@@ -102,27 +101,27 @@ $(document).ready(function(){initNavTree('d9/dd7/struct__cantor__set.html','../.
Collaboration diagram for _cantor_set:
-
+
[legend]
- - + - + - +

+

Data Fields

-double start
+double start
 start of interval
 
-double end
+double end
 end of interval
 
-struct _cantor_set * next
+struct _cantor_set * next
 pointer to next set
 

Detailed Description

-

structure to define Cantor set

+

structure to define Cantor set


The documentation for this struct was generated from the following file: @@ -132,7 +131,7 @@ struct _cantor_set
    - +
diff --git a/d9/deb/min__printf_8h.html b/d9/deb/min__printf_8h.html new file mode 100644 index 000000000..7fc3c8309 --- /dev/null +++ b/d9/deb/min__printf_8h.html @@ -0,0 +1,881 @@ + + + + + + + +Algorithms_in_C: developer_tools/min_printf.h File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Algorithms_in_C 1.0.0 +
+
Set of algorithms implemented in C.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
min_printf.h File Reference
+
+
+ +

Implementation of a function similar to printf +More...

+
#include <stdlib.h>
+#include <unistd.h>
+#include <stdarg.h>
+
+Include dependency graph for min_printf.h:
+
+
+
+
+
+This graph shows which files directly or indirectly include this file:
+
+
+
+
+
+

Go to the source code of this file.

+ + + + + +

+Data Structures

struct  buffer
 struct used to store character in certain times More...
 
+ + + + + + +

+Macros

+#define INT_MAX_LENGTH   10
 for malloc and free functions for write function for va_start and va_arg functions
 
+#define PRECISION_FOR_FLOAT   8
 
+ + + + +

+Typedefs

+typedef struct buffer Buffer
 struct used to store character in certain times
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

int power_of_ten (int a)
 
int is_number (char *c)
 Checks if a character is a number. More...
 
char get_ch (char *p, Buffer *buffer)
 Returns specific required next character. More...
 
void unget_ch (char *c, Buffer *buffer)
 Stores character to the buffer->buffr_char More...
 
int get_number_of_digits (int n)
 Calculates the number of digits in a number. More...
 
void put_char (char s)
 Prints one character on screen. More...
 
void reverse_str (char *p)
 Reverses a string using two pointer algorithm More...
 
void print_int_value (int n, int width, int precision)
 
void print_double_value (double dval, int width, int precision)
 The algorithm here is also the same as the print_int_value function. More...
 
void print_string (char *p, int width, int precision)
 
char * get_width_and_precision (char *p, Buffer *buffer, int *width, int *precision)
 Takes width and precision specified from the format of the string. More...
 
void min_printf (char *fmt,...)
 min_printf is the function same as printf More...
 
+

Detailed Description

+

Implementation of a function similar to printf

+

printf statement rewritten (as min_printf) in C without using the stdio.h library Syntax of min_printf is same as printf Currently min_printf handles: Integers, Doubles, floats, characters and strings The format specifiers and escape sequence is the same as for printf User can also specify the width and precision if required, just like in the case of printf How to use it:

+

Function Documentation

+ +

◆ get_ch()

+ +
+
+ + + + + + + + + + + + + + + + + + +
char get_ch (char * p,
Buffer * buffer 
)
+
+ +

Returns specific required next character.

+
Parameters
+ + + +
ppointer to a format string of min_printf()
bufferstruct for checking if buffr_char character is present or not
+
+
+
Returns
character inside buffer->buffr_char, if buffer->buf_size is one
+
+character at which p is pointing, if buffer->buf_size is zero
+

< Since character is used, this sets buffer->buf_size to zero

+
71{
+
72 if (buffer->buf_size) {
+
73 buffer->buf_size = 0; ///< Since character is used, this sets `buffer->buf_size` to zero
+
74 return buffer->buffr_char; // Returns character inside buffer->buffr_char
+
75 }
+
76 return *p++;
+
77}
+
struct used to store character in certain times
Definition: min_printf.h:31
+
+
+
+ +

◆ get_number_of_digits()

+ +
+
+ + + + + + + + +
int get_number_of_digits (int n)
+
+ +

Calculates the number of digits in a number.

+
Parameters
+ + +
nnumber whose digits are to be counted
+
+
+
Returns
number of digits in n
+
97{
+
98 int digits = 0; // Stores encountered number of digits
+
99 while (n > 0) {
+
100 ++digits; // Since number still contains a digit, so increment digit variable
+
101 n /= 10; // Removes last digit from number
+
102 }
+
103 return digits;
+
104}
+
+
+
+ +

◆ get_width_and_precision()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
char * get_width_and_precision (char * p,
Buffer * buffer,
int * width,
int * precision 
)
+
+ +

Takes width and precision specified from the format of the string.

+
Parameters
+ + + + +
ppointer of the format string
widthvariable in which width will be stored
precisionvariable in which precision will be stored
+
+
+
Returns
character pointer to the current pointer of string p (used to update value of p)
+
272{
+
273 /* Skip % if p is pointing to it.*/
+
274 if (*p == '%')
+
275 ++p;
+
276
+
277 /* Calculates the width specified. */
+
278 while (*p != '.' && is_number(p))
+
279 *width = *width * 10 + (*p++ - '0');
+
280
+
281 /* Calculates the precision specified.*/
+
282 if (*p == '.' /* Since a precision is always specified after a '.'. */) {
+
283 while (is_number(++p))
+
284 *precision = *precision * 10 + (*p - '0');
+
285 unget_ch(p, buffer); // The non number will be stored in `buffer->buffr`
+
286 }
+
287 return p;
+
288}
+
void unget_ch(char *c, Buffer *buffer)
Stores character to the buffer->buffr_char
Definition: min_printf.h:84
+
int is_number(char *c)
Checks if a character is a number.
Definition: min_printf.h:58
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ is_number()

+ +
+
+ + + + + + + + +
int is_number (char * c)
+
+ +

Checks if a character is a number.

+
Parameters
+ + +
ccharacter to be checked if it's a number or not
+
+
+
Returns
true(1) if the character is a number
+
+false(0) if the character is NOT a number
+
59{
+
60 return (*c >= '0' && *c <= '9') ? 1 : 0;
+
61}
+
+
+
+ +

◆ min_printf()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void min_printf (char * fmt,
 ... 
)
+
+ +

min_printf is the function same as printf

+
Parameters
+ + + +
fmtformat of string
...arguments passed according to the format
+
+
+
296{
+
297 va_list ap; // Points to each unnamed arg in turn
+
298 char *p, *sval; // p will be used to point to fmt and sval will store string value
+
299 char cval; // Stores character value
+
300 int ival; // For integer values
+
301 double dval; // For double or float values
+
302 va_start(ap, fmt); // Makes ap points to first unnames argument
+
303
+
304 /* Initializing the buffer for storing character. */
+
305 Buffer *buffer = (Buffer *) malloc(sizeof(Buffer));
+
306 buffer->buf_size = 0; // Initially set buffer size to zero as no character is inserted
+
307
+
308 for (p = fmt; *p != '\0'; ++p) {
+
309
+
310 /* If p != '%' then the character is printed to screen. */
+
311 if (*p != '%') {
+
312 put_char(*p);
+
313 continue;
+
314 }
+
315
+
316 int width = 0; // Stores width specified
+
317 int precision = 0; // Stores precision specified
+
318
+
319 /* Updates values of width, precision and p. */
+
320 p = get_width_and_precision(p, buffer, &width, &precision);
+
321
+
322 /* Checks format of next argument.*/
+
323 switch (get_ch(p, buffer)) {
+
324 case 'd': // Integer
+
325 ival = va_arg(ap, int);
+
326 print_int_value(ival, width, precision);
+
327 break;
+
328 case 'c': // Character
+
329 cval = va_arg(ap, int);
+
330 put_char(cval);
+
331 break;
+
332 case 'f': // Float or Double
+
333 dval = va_arg(ap, double);
+
334
+
335 // If precision is not specified then default value is applied
+
336 if (precision == 0)
+
337 precision = PRECISION_FOR_FLOAT;
+
338 print_double_value(dval, width, precision);
+
339 break;
+
340 case 's': // String pointer
+
341 sval = va_arg(ap, char *);
+
342 print_string(sval, width, precision);
+
343 break;
+
344 default:
+
345 put_char(*p);
+
346 break;
+
347 }
+
348 }
+
349 va_end(ap);
+
350}
+
#define malloc(bytes)
This macro replace the standard malloc function with malloc_dbg.
Definition: malloc_dbg.h:18
+
void print_int_value(int n, int width, int precision)
Definition: min_printf.h:154
+
char get_ch(char *p, Buffer *buffer)
Returns specific required next character.
Definition: min_printf.h:70
+
void print_double_value(double dval, int width, int precision)
The algorithm here is also the same as the print_int_value function.
Definition: min_printf.h:206
+
char * get_width_and_precision(char *p, Buffer *buffer, int *width, int *precision)
Takes width and precision specified from the format of the string.
Definition: min_printf.h:271
+
void put_char(char s)
Prints one character on screen.
Definition: min_printf.h:110
+
void print_string(char *p, int width, int precision)
Definition: min_printf.h:234
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ power_of_ten()

+ +
+
+ + + + + + + + +
int power_of_ten (int a)
+
+

This function return ten to the power a(The parameter specified to it) like: if the parameter specified is 4 i.e. -> power_of_ten(4) is called then this function will return ten to the power four (10000);

Parameters
+ + +
aThe power of ten which is to be returned
+
+
+
Returns
Ten to the power a
+

< This number will be returned as ten to power of a

+
45{
+
46 int n = 1; ///< This number will be returned as ten to power of a
+
47 for (int i = 1; i <= a; ++i)
+
48 n *= 10 ;
+
49 return n;
+
50}
+
+
+
+ +

◆ print_double_value()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void print_double_value (double dval,
int width,
int precision 
)
+
+ +

The algorithm here is also the same as the print_int_value function.

+

First, the digits before decimal is printed by converting the double to int. Then after printed a ., the double number is subtracted with the integer value of the number, leaving us with 0 before the decimal. Then, we multiply the number with 10 raised to the power precision ( precision means how many digits to be printed after the decimal.) By default, the precision is 8 if it is not specified. Then, the remaining number is printed on the screen.

Parameters
+ + + + +
dvaldouble number to be printed
widthsimilar to width parameter of print_int_value()
precisiontells the number of digits to be printed after the decimal (By default it is 8)
+
+
+
207{
+
208 int ndigits = get_number_of_digits((int) dval); // Store number of digits before decimal in dval
+
209 int reqd_blanks = width - (precision + 1) - ndigits; // Blanks to be printed before printing dval, just to cover the width
+
210
+
211 print_int_value((int) dval, reqd_blanks, 0); // Prints the part before decimal
+
212
+
213 put_char('.'); // Print decimal
+
214
+
215 /*Deletes digits before decimal and makes them zero. For example:
+
216 if dval = 1923.79022, them this will make dval = 0.79022
+
217 */
+
218 dval = dval - (int) dval;
+
219
+
220 dval *= power_of_ten(precision); // Brings precision number of digits after decimal to before decimal
+
221
+
222 print_int_value((int) dval, 0, precision); // Prints the remaining number
+
223}
+
int power_of_ten(int a)
Definition: min_printf.h:44
+
int get_number_of_digits(int n)
Calculates the number of digits in a number.
Definition: min_printf.h:96
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ print_int_value()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void print_int_value (int n,
int width,
int precision 
)
+
+

The algorithm here is to first convert the number into string and then reverse it be passing it to reverse_str function and then printing on the screen

Parameters
+ + + + +
nNumber to be printed
widthTotal characters to be printed (Prints ' ' if (size < width)
precisionTotal character of number to be printed (prints 0 before number if size of number < precision)
+
+
+

< Used to store number of digits in number

+

The next two conditions check weather it is required to add blanks before printing the number (ie: width)and is it specified how many zeros to be printed before the number is printed (ie: precision)

+
155{
+
156 char *p = (char *) malloc(INT_MAX_LENGTH * sizeof(char) + 1); /* +1 for '\0' */
+
157 char *s = p; // Temporary pointer
+
158 int size = 0; //!< Used to store number of digits in number
+
159
+
160 while (n > 0) {
+
161 *s++ = n % 10 + '0'; // Converts last digit of number to character and store it in p
+
162 ++size; // Increment size variable as one more digit is occured
+
163 n /= 10; // Removes the last digit from the number n as we have successfully stored it in p
+
164 }
+
165 *s = '\0';
+
166
+
167 s = p; // Again point back s to starting of p
+
168
+
169 reverse_str(p);
+
170
+
171 /*!
+
172 * The next two conditions check weather it is required to
+
173 * add blanks before printing the number (ie: width)and is it specified how many
+
174 * zeros to be printed before the number is printed (ie: precision)
+
175 */
+
176 if (width > 0 && size < width)
+
177 for (int i = 0; i < (width - precision); ++i)
+
178 put_char(' ');
+
179
+
180 if (precision > 0 && precision > size)
+
181 for (int i = 0; i < (precision - size); ++i)
+
182 put_char('0');
+
183
+
184 /* Prints the number.*/
+
185 while (*s != '\0')
+
186 put_char(*s++);
+
187
+
188 free(p);
+
189}
+
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
+
void reverse_str(char *p)
Reverses a string using two pointer algorithm
Definition: min_printf.h:124
+
#define INT_MAX_LENGTH
for malloc and free functions for write function for va_start and va_arg functions
Definition: min_printf.h:25
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ print_string()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void print_string (char * p,
int width,
int precision 
)
+
+

First size of the string is calculated to check whether width and precision are to be taken into account or not. Then, the string is printed in accordingly.

Parameters
+ + + + +
ppointer to string to be printed
widthif (width > sizeof string) then, blanks will be printed before sting to cover up the width
precisiontotal characters of the string to be printed (prints the whole string if 0 or greater than size of string)
+
+
+
235{
+
236 int size = 0; // Stores number of character in string
+
237 char *s = p; // Temporary pointer
+
238
+
239 /* Calculates size of string p*/
+
240 while (*s != '\0') {
+
241 ++size;
+
242 ++s;
+
243 }
+
244
+
245 s = p; // Point s to starting of p
+
246
+
247 /* Checks how many characters to be printed.
+
248 if precision is defined then size variable is changed to precision so that only precision
+
249 number of characters were printed.
+
250 */
+
251 if (precision != 0 && precision < size)
+
252 size = precision;
+
253
+
254 /* Prints blanks to cover the width if required*/
+
255 for (int i = 0; i < (width - size); ++i)
+
256 put_char(' ');
+
257
+
258 /* Print the string.*/
+
259 for (int i = 0; i < size; ++i)
+
260 put_char(*s++);
+
261
+
262}
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ put_char()

+ +
+
+ + + + + + + + +
void put_char (char s)
+
+ +

Prints one character on screen.

+
Parameters
+ + +
scharacter to be printed on the screen
+
+
+
111{
+
112 /* buf used for storing character to be printed in an array (+1 for '\0')*/
+
113 char *buf = (char *) malloc(sizeof(char) + 1);
+
114 *buf = s;
+
115 *(buf + 1) = '\0';
+
116 write(1, buf, 1);
+
117 free(buf);
+
118}
+
+
+
+ +

◆ reverse_str()

+ +
+
+ + + + + + + + +
void reverse_str (char * p)
+
+ +

Reverses a string using two pointer algorithm

+
Parameters
+ + +
ppointer to the string which is to be reversed
+
+
+
125{
+
126 char *l = p; // Points to first character of p
+
127 char *h = p; // Will be used to point to last character of p
+
128 char temp; // Temporarily stores a character, Used in swapping
+
129
+
130 while (*h != '\0')
+
131 ++h;
+
132 --h; // Now h point to last valid character of string
+
133
+
134 /* Swap character which lower and higher are pointing until lower < higher. At that point string will be reversed.*/
+
135 while (l < h) {
+
136 temp = *l;
+
137 *l = *h;
+
138 *h = temp;
+
139 ++l; // Increment lower to next character
+
140 --h; // Decrement higher to previous character from current character
+
141 }
+
142}
+
+
+
+ +

◆ unget_ch()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void unget_ch (char * c,
Buffer * buffer 
)
+
+ +

Stores character to the buffer->buffr_char

+
Parameters
+ + + +
ccharacter to be stored in the buffer->buffr_char
bufferstruct where character will be stored
+
+
+
85{
+
86 buffer->buffr_char = *c; // Character initializes inside buffer->buffr_char
+
87 buffer->buf_size = 1; // Sets bufsize to one as new character is stored in buffr_char
+
88}
+
+
+
+
+
+ + + + diff --git a/d9/deb/min__printf_8h.js b/d9/deb/min__printf_8h.js new file mode 100644 index 000000000..8c8c8c9de --- /dev/null +++ b/d9/deb/min__printf_8h.js @@ -0,0 +1,18 @@ +var min__printf_8h = +[ + [ "buffer", "dd/da2/structbuffer.html", null ], + [ "INT_MAX_LENGTH", "d9/deb/min__printf_8h.html#ab47a4bec9213d96e1dba5171e5db0e25", null ], + [ "Buffer", "d9/deb/min__printf_8h.html#abf0876f583782407c9e15c60158eec52", null ], + [ "get_ch", "d9/deb/min__printf_8h.html#a409d428c337bf5476567a228274f49f1", null ], + [ "get_number_of_digits", "d9/deb/min__printf_8h.html#aefb40d94d5d9fa2a28bc64755dde096f", null ], + [ "get_width_and_precision", "d9/deb/min__printf_8h.html#aa61e2407aab2c75e9837c77cab937d03", null ], + [ "is_number", "d9/deb/min__printf_8h.html#ad4908ab912d8dc481225e33ca3285c21", null ], + [ "min_printf", "d9/deb/min__printf_8h.html#a33e08c05f8c656a0fee465c2e8d2ecf9", null ], + [ "power_of_ten", "d9/deb/min__printf_8h.html#a8421f89b76edcf21292c5100bfca586b", null ], + [ "print_double_value", "d9/deb/min__printf_8h.html#a4d63203d920bebd6a96f5f4aeccb21e5", null ], + [ "print_int_value", "d9/deb/min__printf_8h.html#a0a848efdf2ee124bba62e056eb9ab824", null ], + [ "print_string", "d9/deb/min__printf_8h.html#af569209570eca8bc6770fb7d9dc873e6", null ], + [ "put_char", "d9/deb/min__printf_8h.html#ad2f9a02e1d69f58e2fb1248f49d09f4b", null ], + [ "reverse_str", "d9/deb/min__printf_8h.html#a8d68ec60643cacdb402176549565754e", null ], + [ "unget_ch", "d9/deb/min__printf_8h.html#aa8a17b7d234a2fb2174da02074a14055", null ] +]; \ No newline at end of file diff --git a/d9/deb/min__printf_8h_a0a848efdf2ee124bba62e056eb9ab824_cgraph.map b/d9/deb/min__printf_8h_a0a848efdf2ee124bba62e056eb9ab824_cgraph.map new file mode 100644 index 000000000..792169f9a --- /dev/null +++ b/d9/deb/min__printf_8h_a0a848efdf2ee124bba62e056eb9ab824_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/d9/deb/min__printf_8h_a0a848efdf2ee124bba62e056eb9ab824_cgraph.md5 b/d9/deb/min__printf_8h_a0a848efdf2ee124bba62e056eb9ab824_cgraph.md5 new file mode 100644 index 000000000..c324f70f0 --- /dev/null +++ b/d9/deb/min__printf_8h_a0a848efdf2ee124bba62e056eb9ab824_cgraph.md5 @@ -0,0 +1 @@ +4a423c2c84282a5a63bba12d4d27f49e \ No newline at end of file diff --git a/d9/deb/min__printf_8h_a0a848efdf2ee124bba62e056eb9ab824_cgraph.svg b/d9/deb/min__printf_8h_a0a848efdf2ee124bba62e056eb9ab824_cgraph.svg new file mode 100644 index 000000000..851efd8ea --- /dev/null +++ b/d9/deb/min__printf_8h_a0a848efdf2ee124bba62e056eb9ab824_cgraph.svg @@ -0,0 +1,52 @@ + + + + + + +print_int_value + + + +Node1 + + +print_int_value + + + + + +Node2 + + +put_char + + + + + +Node1->Node2 + + + + + +Node3 + + +reverse_str + + + + + +Node1->Node3 + + + + + diff --git a/d9/deb/min__printf_8h_a33e08c05f8c656a0fee465c2e8d2ecf9_cgraph.map b/d9/deb/min__printf_8h_a33e08c05f8c656a0fee465c2e8d2ecf9_cgraph.map new file mode 100644 index 000000000..9471cf83c --- /dev/null +++ b/d9/deb/min__printf_8h_a33e08c05f8c656a0fee465c2e8d2ecf9_cgraph.map @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/d9/deb/min__printf_8h_a33e08c05f8c656a0fee465c2e8d2ecf9_cgraph.md5 b/d9/deb/min__printf_8h_a33e08c05f8c656a0fee465c2e8d2ecf9_cgraph.md5 new file mode 100644 index 000000000..e101dccb4 --- /dev/null +++ b/d9/deb/min__printf_8h_a33e08c05f8c656a0fee465c2e8d2ecf9_cgraph.md5 @@ -0,0 +1 @@ +517e6fab916e2870ea4cb938cd6a4e38 \ No newline at end of file diff --git a/d9/deb/min__printf_8h_a33e08c05f8c656a0fee465c2e8d2ecf9_cgraph.svg b/d9/deb/min__printf_8h_a33e08c05f8c656a0fee465c2e8d2ecf9_cgraph.svg new file mode 100644 index 000000000..bfd3b7d8f --- /dev/null +++ b/d9/deb/min__printf_8h_a33e08c05f8c656a0fee465c2e8d2ecf9_cgraph.svg @@ -0,0 +1,133 @@ + + + + + + +min_printf + + + +Node1 + + +min_printf + + + + + +Node2 + + +get_ch + + + + + +Node1->Node2 + + + + + +Node3 + + +get_width_and_precision + + + + + +Node1->Node3 + + + + + +Node6 + + +print_int_value + + + + + +Node1->Node6 + + + + + +Node7 + + +put_char + + + + + +Node1->Node7 + + + + + +Node4 + + +is_number + + + + + +Node3->Node4 + + + + + +Node5 + + +unget_ch + + + + + +Node3->Node5 + + + + + +Node6->Node7 + + + + + +Node8 + + +reverse_str + + + + + +Node6->Node8 + + + + + diff --git a/d9/deb/min__printf_8h_a4d63203d920bebd6a96f5f4aeccb21e5_cgraph.map b/d9/deb/min__printf_8h_a4d63203d920bebd6a96f5f4aeccb21e5_cgraph.map new file mode 100644 index 000000000..36cd8dd94 --- /dev/null +++ b/d9/deb/min__printf_8h_a4d63203d920bebd6a96f5f4aeccb21e5_cgraph.map @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/d9/deb/min__printf_8h_a4d63203d920bebd6a96f5f4aeccb21e5_cgraph.md5 b/d9/deb/min__printf_8h_a4d63203d920bebd6a96f5f4aeccb21e5_cgraph.md5 new file mode 100644 index 000000000..7845919e2 --- /dev/null +++ b/d9/deb/min__printf_8h_a4d63203d920bebd6a96f5f4aeccb21e5_cgraph.md5 @@ -0,0 +1 @@ +8a0cc87bbe678f3a89ca696862c9fa41 \ No newline at end of file diff --git a/d9/deb/min__printf_8h_a4d63203d920bebd6a96f5f4aeccb21e5_cgraph.svg b/d9/deb/min__printf_8h_a4d63203d920bebd6a96f5f4aeccb21e5_cgraph.svg new file mode 100644 index 000000000..7c935a269 --- /dev/null +++ b/d9/deb/min__printf_8h_a4d63203d920bebd6a96f5f4aeccb21e5_cgraph.svg @@ -0,0 +1,103 @@ + + + + + + +print_double_value + + + +Node1 + + +print_double_value + + + + + +Node2 + + +get_number_of_digits + + + + + +Node1->Node2 + + + + + +Node3 + + +power_of_ten + + + + + +Node1->Node3 + + + + + +Node4 + + +print_int_value + + + + + +Node1->Node4 + + + + + +Node5 + + +put_char + + + + + +Node1->Node5 + + + + + +Node4->Node5 + + + + + +Node6 + + +reverse_str + + + + + +Node4->Node6 + + + + + diff --git a/d9/deb/min__printf_8h_aa61e2407aab2c75e9837c77cab937d03_cgraph.map b/d9/deb/min__printf_8h_aa61e2407aab2c75e9837c77cab937d03_cgraph.map new file mode 100644 index 000000000..eeeaf5610 --- /dev/null +++ b/d9/deb/min__printf_8h_aa61e2407aab2c75e9837c77cab937d03_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/d9/deb/min__printf_8h_aa61e2407aab2c75e9837c77cab937d03_cgraph.md5 b/d9/deb/min__printf_8h_aa61e2407aab2c75e9837c77cab937d03_cgraph.md5 new file mode 100644 index 000000000..3f9d68d92 --- /dev/null +++ b/d9/deb/min__printf_8h_aa61e2407aab2c75e9837c77cab937d03_cgraph.md5 @@ -0,0 +1 @@ +d01c01f0da9567b59e6ac25cff941f6a \ No newline at end of file diff --git a/d9/deb/min__printf_8h_aa61e2407aab2c75e9837c77cab937d03_cgraph.svg b/d9/deb/min__printf_8h_aa61e2407aab2c75e9837c77cab937d03_cgraph.svg new file mode 100644 index 000000000..1b8aea6bc --- /dev/null +++ b/d9/deb/min__printf_8h_aa61e2407aab2c75e9837c77cab937d03_cgraph.svg @@ -0,0 +1,52 @@ + + + + + + +get_width_and_precision + + + +Node1 + + +get_width_and_precision + + + + + +Node2 + + +is_number + + + + + +Node1->Node2 + + + + + +Node3 + + +unget_ch + + + + + +Node1->Node3 + + + + + diff --git a/d9/deb/min__printf_8h_af569209570eca8bc6770fb7d9dc873e6_cgraph.map b/d9/deb/min__printf_8h_af569209570eca8bc6770fb7d9dc873e6_cgraph.map new file mode 100644 index 000000000..3aefd4b7d --- /dev/null +++ b/d9/deb/min__printf_8h_af569209570eca8bc6770fb7d9dc873e6_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/d9/deb/min__printf_8h_af569209570eca8bc6770fb7d9dc873e6_cgraph.md5 b/d9/deb/min__printf_8h_af569209570eca8bc6770fb7d9dc873e6_cgraph.md5 new file mode 100644 index 000000000..2815f99fe --- /dev/null +++ b/d9/deb/min__printf_8h_af569209570eca8bc6770fb7d9dc873e6_cgraph.md5 @@ -0,0 +1 @@ +b313b05b80044bb88e1d4a52871f5de1 \ No newline at end of file diff --git a/d9/deb/min__printf_8h_af569209570eca8bc6770fb7d9dc873e6_cgraph.svg b/d9/deb/min__printf_8h_af569209570eca8bc6770fb7d9dc873e6_cgraph.svg new file mode 100644 index 000000000..6b3923b40 --- /dev/null +++ b/d9/deb/min__printf_8h_af569209570eca8bc6770fb7d9dc873e6_cgraph.svg @@ -0,0 +1,37 @@ + + + + + + +print_string + + + +Node1 + + +print_string + + + + + +Node2 + + +put_char + + + + + +Node1->Node2 + + + + + diff --git a/d9/deb/min__printf_8h_source.html b/d9/deb/min__printf_8h_source.html new file mode 100644 index 000000000..c9ea6c57d --- /dev/null +++ b/d9/deb/min__printf_8h_source.html @@ -0,0 +1,475 @@ + + + + + + + +Algorithms_in_C: developer_tools/min_printf.h Source File + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Algorithms_in_C 1.0.0 +
+
Set of algorithms implemented in C.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
min_printf.h
+
+
+Go to the documentation of this file.
1/**
+
2 * @file
+
3 * @brief Implementation of a [function](https://www.geeksforgeeks.org/variable-length-argument-c) similar to `printf`
+
4 * @details
+
5 * `printf` statement rewritten (as `min_printf`) in C without using the `stdio.h` library
+
6 * Syntax of `min_printf` is same as `printf`
+
7 * Currently min_printf handles:
+
8 * Integers, Doubles, floats, characters and strings
+
9 * The format specifiers and escape sequence is the same as for `printf`
+
10 * User can also specify the width and precision if required, just like in the case of `printf`
+
11 * How to use it:
+
12 * - First include min_printf.h in your code
+
13 * - Then type `min_printf()`, and pass required parameters to it
+
14 * - As already specified, it's syntax is same as printf
+
15 * @author [Jaskarn Singh](https://github.com/Jaskarn7)
+
16*/
+
17
+
18#ifndef MIN_PRINTF_H
+
19#define MIN_PRINTF_H
+
20
+
21#include <stdlib.h> /// for `malloc` and `free` functions
+
22#include <unistd.h> /// for `write` function
+
23#include <stdarg.h> /// for `va_start` and `va_arg` functions
+
24
+
25#define INT_MAX_LENGTH 10 /// used as standard length of string to store integers
+
26#define PRECISION_FOR_FLOAT 8 /// default precision for float or double if not specified
+
27
+
28/**
+
29 * @brief struct used to store character in certain times
+
30*/
+
31typedef struct buffer {
+
32 char buffr_char; // Character will be stored in this variable
+
33 int buf_size; // Checks if character is present in buffr_char or not, 0 if no and 1 if yes
+ +
35
+
36/**
+
37 * @details
+
38 * This function return ten to the power a(The parameter specified to it) like:
+
39 * if the parameter specified is 4 i.e. -> power_of_ten(4) is called then
+
40 * this function will return ten to the power four (10000);
+
41 * @param a The power of ten which is to be returned
+
42 * @return Ten to the power a
+
43 */
+
44int power_of_ten(int a)
+
45{
+
46 int n = 1; ///< This number will be returned as ten to power of a
+
47 for (int i = 1; i <= a; ++i)
+
48 n *= 10 ;
+
49 return n;
+
50}
+
51
+
52/**
+
53 * @brief Checks if a character is a number
+
54 * @param c character to be checked if it's a number or not
+
55 * @return `true`(1) if the character is a number
+
56 * @return `false`(0) if the character is NOT a number
+
57*/
+
58int is_number(char *c)
+
59{
+
60 return (*c >= '0' && *c <= '9') ? 1 : 0;
+
61}
+
62
+
63/**
+
64 * @brief Returns specific required next character
+
65 * @param p pointer to a format string of `min_printf()`
+
66 * @param buffer struct for checking if buffr_char character is present or not
+
67 * @return character inside `buffer->buffr_char`, if `buffer->buf_size` is one
+
68 * @return character at which p is pointing, if `buffer->buf_size` is zero
+
69 */
+
70char get_ch(char *p, Buffer *buffer)
+
71{
+
72 if (buffer->buf_size) {
+
73 buffer->buf_size = 0; ///< Since character is used, this sets `buffer->buf_size` to zero
+
74 return buffer->buffr_char; // Returns character inside buffer->buffr_char
+
75 }
+
76 return *p++;
+
77}
+
78
+
79/**
+
80 * @brief Stores character to the `buffer->buffr_char`
+
81 * @param c character to be stored in the `buffer->buffr_char`
+
82 * @param buffer struct where character will be stored
+
83*/
+
84void unget_ch(char *c, Buffer *buffer)
+
85{
+
86 buffer->buffr_char = *c; // Character initializes inside buffer->buffr_char
+
87 buffer->buf_size = 1; // Sets bufsize to one as new character is stored in buffr_char
+
88}
+
89
+
90
+
91/**
+
92 * @brief Calculates the number of digits in a number
+
93 * @param n number whose digits are to be counted
+
94 * @return number of digits in n
+
95*/
+ +
97{
+
98 int digits = 0; // Stores encountered number of digits
+
99 while (n > 0) {
+
100 ++digits; // Since number still contains a digit, so increment digit variable
+
101 n /= 10; // Removes last digit from number
+
102 }
+
103 return digits;
+
104}
+
105
+
106/**
+
107 * @brief Prints one character on screen
+
108 * @param s character to be printed on the screen
+
109*/
+
110void put_char(char s)
+
111{
+
112 /* buf used for storing character to be printed in an array (+1 for '\0')*/
+
113 char *buf = (char *) malloc(sizeof(char) + 1);
+
114 *buf = s;
+
115 *(buf + 1) = '\0';
+
116 write(1, buf, 1);
+
117 free(buf);
+
118}
+
119
+
120/**
+
121 * @brief Reverses a string using [two pointer algorithm](https://www.geeksforgeeks.org/program-reverse-array-using-pointers/?ref=rp)
+
122 * @param p pointer to the string which is to be reversed
+
123*/
+
124void reverse_str(char *p)
+
125{
+
126 char *l = p; // Points to first character of p
+
127 char *h = p; // Will be used to point to last character of p
+
128 char temp; // Temporarily stores a character, Used in swapping
+
129
+
130 while (*h != '\0')
+
131 ++h;
+
132 --h; // Now h point to last valid character of string
+
133
+
134 /* Swap character which lower and higher are pointing until lower < higher. At that point string will be reversed.*/
+
135 while (l < h) {
+
136 temp = *l;
+
137 *l = *h;
+
138 *h = temp;
+
139 ++l; // Increment lower to next character
+
140 --h; // Decrement higher to previous character from current character
+
141 }
+
142}
+
143
+
144/**
+
145 * @details
+
146 * The algorithm here is to first convert the number into
+
147 * string and then reverse it be passing it to reverse_str function
+
148 * and then printing on the screen
+
149 * @param n Number to be printed
+
150 * @param width Total characters to be printed (Prints ' ' if (size < width)
+
151 * @param precision Total character of number to be printed (prints 0 before number if size of number < precision)
+
152 *
+
153*/
+
154void print_int_value(int n, int width, int precision)
+
155{
+
156 char *p = (char *) malloc(INT_MAX_LENGTH * sizeof(char) + 1); /* +1 for '\0' */
+
157 char *s = p; // Temporary pointer
+
158 int size = 0; //!< Used to store number of digits in number
+
159
+
160 while (n > 0) {
+
161 *s++ = n % 10 + '0'; // Converts last digit of number to character and store it in p
+
162 ++size; // Increment size variable as one more digit is occured
+
163 n /= 10; // Removes the last digit from the number n as we have successfully stored it in p
+
164 }
+
165 *s = '\0';
+
166
+
167 s = p; // Again point back s to starting of p
+
168
+
169 reverse_str(p);
+
170
+
171 /*!
+
172 * The next two conditions check weather it is required to
+
173 * add blanks before printing the number (ie: width)and is it specified how many
+
174 * zeros to be printed before the number is printed (ie: precision)
+
175 */
+
176 if (width > 0 && size < width)
+
177 for (int i = 0; i < (width - precision); ++i)
+
178 put_char(' ');
+
179
+
180 if (precision > 0 && precision > size)
+
181 for (int i = 0; i < (precision - size); ++i)
+
182 put_char('0');
+
183
+
184 /* Prints the number.*/
+
185 while (*s != '\0')
+
186 put_char(*s++);
+
187
+
188 free(p);
+
189}
+
190
+
191/**
+
192* @brief The algorithm here is also the same as the `print_int_value` function
+
193 *
+
194 * @details
+
195 * First, the digits before decimal is printed by converting the double
+
196 * to int. Then after printed a `.`, the double number is subtracted with
+
197 * the integer value of the number, leaving us with 0 before the decimal.
+
198 * Then, we multiply the number with 10 raised to the power precision (
+
199 * precision means how many digits to be printed after the decimal.)
+
200 * By default, the precision is 8 if it is not specified.
+
201 * Then, the remaining number is printed on the screen.
+
202 * @param dval double number to be printed
+
203 * @param width similar to width parameter of print_int_value()
+
204 * @param precision tells the number of digits to be printed after the decimal (By default it is 8)
+
205 */
+
206void print_double_value(double dval, int width, int precision)
+
207{
+
208 int ndigits = get_number_of_digits((int) dval); // Store number of digits before decimal in dval
+
209 int reqd_blanks = width - (precision + 1) - ndigits; // Blanks to be printed before printing dval, just to cover the width
+
210
+
211 print_int_value((int) dval, reqd_blanks, 0); // Prints the part before decimal
+
212
+
213 put_char('.'); // Print decimal
+
214
+
215 /*Deletes digits before decimal and makes them zero. For example:
+
216 if dval = 1923.79022, them this will make dval = 0.79022
+
217 */
+
218 dval = dval - (int) dval;
+
219
+
220 dval *= power_of_ten(precision); // Brings precision number of digits after decimal to before decimal
+
221
+
222 print_int_value((int) dval, 0, precision); // Prints the remaining number
+
223}
+
224
+
225/**
+
226 * @details
+
227* First size of the string is calculated to check whether
+
228* width and precision are to be taken into account or not.
+
229* Then, the string is printed in accordingly.
+
230* @param p pointer to string to be printed
+
231* @param width if (width > sizeof string) then, blanks will be printed before sting to cover up the width
+
232* @param precision total characters of the string to be printed (prints the whole string if 0 or greater than size of string)
+
233*/
+
234void print_string(char *p, int width, int precision)
+
235{
+
236 int size = 0; // Stores number of character in string
+
237 char *s = p; // Temporary pointer
+
238
+
239 /* Calculates size of string p*/
+
240 while (*s != '\0') {
+
241 ++size;
+
242 ++s;
+
243 }
+
244
+
245 s = p; // Point s to starting of p
+
246
+
247 /* Checks how many characters to be printed.
+
248 if precision is defined then size variable is changed to precision so that only precision
+
249 number of characters were printed.
+
250 */
+
251 if (precision != 0 && precision < size)
+
252 size = precision;
+
253
+
254 /* Prints blanks to cover the width if required*/
+
255 for (int i = 0; i < (width - size); ++i)
+
256 put_char(' ');
+
257
+
258 /* Print the string.*/
+
259 for (int i = 0; i < size; ++i)
+
260 put_char(*s++);
+
261
+
262}
+
263
+
264/**
+
265* @brief Takes width and precision specified from the format of the string
+
266* @param p pointer of the format string
+
267* @param width variable in which width will be stored
+
268* @param precision variable in which precision will be stored
+
269* @return character pointer to the current pointer of string p (used to update value of p)
+
270*/
+
271char *get_width_and_precision(char *p, Buffer *buffer, int *width, int *precision)
+
272{
+
273 /* Skip % if p is pointing to it.*/
+
274 if (*p == '%')
+
275 ++p;
+
276
+
277 /* Calculates the width specified. */
+
278 while (*p != '.' && is_number(p))
+
279 *width = *width * 10 + (*p++ - '0');
+
280
+
281 /* Calculates the precision specified.*/
+
282 if (*p == '.' /* Since a precision is always specified after a '.'. */) {
+
283 while (is_number(++p))
+
284 *precision = *precision * 10 + (*p - '0');
+
285 unget_ch(p, buffer); // The non number will be stored in `buffer->buffr`
+
286 }
+
287 return p;
+
288}
+
289
+
290/**
+
291 * min_printf is the function same as printf
+
292 * @param fmt format of string
+
293 * @param ... arguments passed according to the format
+
294*/
+
295void min_printf(char *fmt, ...)
+
296{
+
297 va_list ap; // Points to each unnamed arg in turn
+
298 char *p, *sval; // p will be used to point to fmt and sval will store string value
+
299 char cval; // Stores character value
+
300 int ival; // For integer values
+
301 double dval; // For double or float values
+
302 va_start(ap, fmt); // Makes ap points to first unnames argument
+
303
+
304 /* Initializing the buffer for storing character. */
+
305 Buffer *buffer = (Buffer *) malloc(sizeof(Buffer));
+
306 buffer->buf_size = 0; // Initially set buffer size to zero as no character is inserted
+
307
+
308 for (p = fmt; *p != '\0'; ++p) {
+
309
+
310 /* If p != '%' then the character is printed to screen. */
+
311 if (*p != '%') {
+
312 put_char(*p);
+
313 continue;
+
314 }
+
315
+
316 int width = 0; // Stores width specified
+
317 int precision = 0; // Stores precision specified
+
318
+
319 /* Updates values of width, precision and p. */
+
320 p = get_width_and_precision(p, buffer, &width, &precision);
+
321
+
322 /* Checks format of next argument.*/
+
323 switch (get_ch(p, buffer)) {
+
324 case 'd': // Integer
+
325 ival = va_arg(ap, int);
+
326 print_int_value(ival, width, precision);
+
327 break;
+
328 case 'c': // Character
+
329 cval = va_arg(ap, int);
+
330 put_char(cval);
+
331 break;
+
332 case 'f': // Float or Double
+
333 dval = va_arg(ap, double);
+
334
+
335 // If precision is not specified then default value is applied
+
336 if (precision == 0)
+
337 precision = PRECISION_FOR_FLOAT;
+
338 print_double_value(dval, width, precision);
+
339 break;
+
340 case 's': // String pointer
+
341 sval = va_arg(ap, char *);
+
342 print_string(sval, width, precision);
+
343 break;
+
344 default:
+
345 put_char(*p);
+
346 break;
+
347 }
+
348 }
+
349 va_end(ap);
+
350}
+
351
+
352#endif /* MIN_PRINTF_H */
+
#define malloc(bytes)
This macro replace the standard malloc function with malloc_dbg.
Definition: malloc_dbg.h:18
+
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
+
void print_int_value(int n, int width, int precision)
Definition: min_printf.h:154
+
void min_printf(char *fmt,...)
min_printf is the function same as printf
Definition: min_printf.h:295
+
char get_ch(char *p, Buffer *buffer)
Returns specific required next character.
Definition: min_printf.h:70
+
void print_double_value(double dval, int width, int precision)
The algorithm here is also the same as the print_int_value function.
Definition: min_printf.h:206
+
int power_of_ten(int a)
Definition: min_printf.h:44
+
void reverse_str(char *p)
Reverses a string using two pointer algorithm
Definition: min_printf.h:124
+
char * get_width_and_precision(char *p, Buffer *buffer, int *width, int *precision)
Takes width and precision specified from the format of the string.
Definition: min_printf.h:271
+
void unget_ch(char *c, Buffer *buffer)
Stores character to the buffer->buffr_char
Definition: min_printf.h:84
+
#define INT_MAX_LENGTH
for malloc and free functions for write function for va_start and va_arg functions
Definition: min_printf.h:25
+
struct buffer Buffer
struct used to store character in certain times
+
void put_char(char s)
Prints one character on screen.
Definition: min_printf.h:110
+
int is_number(char *c)
Checks if a character is a number.
Definition: min_printf.h:58
+
int get_number_of_digits(int n)
Calculates the number of digits in a number.
Definition: min_printf.h:96
+
void print_string(char *p, int width, int precision)
Definition: min_printf.h:234
+
struct used to store character in certain times
Definition: min_printf.h:31
+
+
+ + + + diff --git a/da/d02/binary__search__tree_8c.html b/da/d02/binary__search__tree_8c.html index e9238fcb9..2fe46a851 100644 --- a/da/d02/binary__search__tree_8c.html +++ b/da/d02/binary__search__tree_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: data_structures/binary_trees/binary_search_tree.c 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('da/d02/binary__search__tree_8c.html',' Data Structures | Typedefs | Functions -
-
binary_search_tree.c File Reference
+
binary_search_tree.c File Reference
@@ -106,37 +105,37 @@ $(document).ready(function(){initNavTree('da/d02/binary__search__tree_8c.html','
Include dependency graph for binary_search_tree.c:
-
+
-

+

Data Structures

struct  node
 Node, the basic data structure in the tree. More...
 
- - +

+

Typedefs

-typedef struct node node
+typedef struct node node
 Node, the basic data structure in the tree.
 
- - - - - - - - - - - - - + + + + + + + + + + + + @@ -149,28 +148,27 @@ Functions - - + +

+

Functions

node * newNode (int data)
 The node constructor, which receives the key value input and returns a node pointer. More...
 
node * insert (node *root, int data)
 Insertion procedure, which inserts the input key in a new node in the tree. More...
 
node * getMax (node *root)
 Utilitary procedure to find the greatest key in the left subtree. More...
 
node * delete (node *root, int data)
 Deletion procedure, which searches for the input key in the tree and removes it if present. More...
 
node * newNode (int data)
 The node constructor, which receives the key value input and returns a node pointer. More...
 
node * insert (node *root, int data)
 Insertion procedure, which inserts the input key in a new node in the tree. More...
 
node * getMax (node *root)
 Utilitary procedure to find the greatest key in the left subtree. More...
 
node * delete (node *root, int data)
 Deletion procedure, which searches for the input key in the tree and removes it if present. More...
 
int find (node *root, int data)
 Search procedure, which looks for the input key in the tree and returns 1 if it's present or 0 if it's not in the tree. More...
 
void inOrder (node *root)
 Traversal procedure to list the current keys in the tree in order of value (from the left to the right) More...
 
-int main ()
 Main funcion.
int main ()
 Main funcion. More...
 

Detailed Description

-

A basic unbalanced binary search tree implementation in C.

-

The implementation has the following functionalities implemented:

    +

    A basic unbalanced binary search tree implementation in C.

    +

    The implementation has the following functionalities implemented:

    • Insertion
    • Deletion
    • Search by key value
    • Listing of node keys in order of value (from left to right)

    Function Documentation

    - -

    ◆ delete()

    + +

    ◆ delete()

    - + @@ -198,62 +196,62 @@ int  @@ -42,21 +41,22 @@
    node* delete node * delete ( node *  root,
    Returns
    pointer to parent node
    -
    89 {
    -
    90  // If the root is null, nothing to be done
    -
    91  if (root == NULL)
    -
    92  {
    -
    93  return root;
    -
    94  }
    -
    95  else if (data > root->data)
    -
    96  { // If the input key is greater than the root's, search in the right
    -
    97  // subtree
    -
    98  root->right = delete (root->right, data);
    -
    99  }
    -
    100  else if (data < root->data)
    -
    101  { // If the input key is lower than the root's, search in the left subtree
    -
    102  root->left = delete (root->left, data);
    -
    103  }
    -
    104  else if (data == root->data)
    -
    105  {
    -
    106  // If the input key matches the root's, check the following cases
    -
    107  // termination condition
    -
    108  if ((root->left == NULL) && (root->right == NULL))
    -
    109  { // Case 1: the root has no leaves, remove the node
    -
    110  free(root);
    -
    111  return NULL;
    -
    112  }
    -
    113  else if (root->left == NULL)
    -
    114  { // Case 2: the root has one leaf, make the leaf the new root and
    -
    115  // remove
    -
    116  // the old root
    -
    117  node *tmp = root;
    -
    118  root = root->right;
    -
    119  free(tmp);
    -
    120  return root;
    -
    121  }
    -
    122  else if (root->right == NULL)
    -
    123  {
    -
    124  node *tmp = root;
    -
    125  root = root->left;
    -
    126  free(tmp);
    -
    127  return root;
    -
    128  }
    -
    129  else
    -
    130  { // Case 3: the root has 2 leaves, find the greatest key in the left
    -
    131  // subtree and switch with the root's
    -
    132 
    -
    133  // finds the biggest node in the left branch.
    -
    134  node *tmp = getMax(root->left);
    -
    135 
    -
    136  // sets the data of this node equal to the data of the biggest node
    -
    137  // (lefts)
    -
    138  root->data = tmp->data;
    -
    139  root->left = delete (root->left, tmp->data);
    -
    140  }
    -
    141  }
    -
    142  return root;
    -
    143 }
    -
    node * getMax(node *root)
    Utilitary procedure to find the greatest key in the left subtree.
    Definition: binary_search_tree.c:72
    +
    89{
    +
    90 // If the root is null, nothing to be done
    +
    91 if (root == NULL)
    +
    92 {
    +
    93 return root;
    +
    94 }
    +
    95 else if (data > root->data)
    +
    96 { // If the input key is greater than the root's, search in the right
    +
    97 // subtree
    +
    98 root->right = delete (root->right, data);
    +
    99 }
    +
    100 else if (data < root->data)
    +
    101 { // If the input key is lower than the root's, search in the left subtree
    +
    102 root->left = delete (root->left, data);
    +
    103 }
    +
    104 else if (data == root->data)
    +
    105 {
    +
    106 // If the input key matches the root's, check the following cases
    +
    107 // termination condition
    +
    108 if ((root->left == NULL) && (root->right == NULL))
    +
    109 { // Case 1: the root has no leaves, remove the node
    +
    110 free(root);
    +
    111 return NULL;
    +
    112 }
    +
    113 else if (root->left == NULL)
    +
    114 { // Case 2: the root has one leaf, make the leaf the new root and
    +
    115 // remove
    +
    116 // the old root
    +
    117 node *tmp = root;
    +
    118 root = root->right;
    +
    119 free(tmp);
    +
    120 return root;
    +
    121 }
    +
    122 else if (root->right == NULL)
    +
    123 {
    +
    124 node *tmp = root;
    +
    125 root = root->left;
    +
    126 free(tmp);
    +
    127 return root;
    +
    128 }
    +
    129 else
    +
    130 { // Case 3: the root has 2 leaves, find the greatest key in the left
    +
    131 // subtree and switch with the root's
    +
    132
    +
    133 // finds the biggest node in the left branch.
    +
    134 node *tmp = getMax(root->left);
    +
    135
    +
    136 // sets the data of this node equal to the data of the biggest node
    +
    137 // (lefts)
    +
    138 root->data = tmp->data;
    +
    139 root->left = delete (root->left, tmp->data);
    +
    140 }
    +
    141 }
    +
    142 return root;
    +
    143}
    +
    node * getMax(node *root)
    Utilitary procedure to find the greatest key in the left subtree.
    Definition: binary_search_tree.c:72
    #define free(ptr)
    This macro replace the standard free function with free_dbg.
    Definition: malloc_dbg.h:26
    Definition: prime_factoriziation.c:25
    Node, the basic data structure in the tree.
    Definition: binary_search_tree.c:15
    @@ -261,13 +259,13 @@ int 
    Here is the call graph for this function:
    -
    +
    -
    +

    ◆ find()

    @@ -304,45 +302,51 @@ Here is the call graph for this function:
    Returns
    0 if value not found in the nodes
    1 if value was found
    -
    153 {
    -
    154  // If the root is null, the key's not present
    -
    155  if (root == NULL)
    -
    156  {
    -
    157  return 0;
    -
    158  }
    -
    159  else if (data > root->data)
    -
    160  {
    -
    161  // If the input key is greater than the root's, search in the right
    -
    162  // subtree
    -
    163  return find(root->right, data);
    -
    164  }
    -
    165  else if (data < root->data)
    -
    166  {
    -
    167  // If the input key is lower than the root's, search in the left subtree
    -
    168  return find(root->left, data);
    -
    169  }
    -
    170  else if (data == root->data)
    -
    171  {
    -
    172  // If the input and the root key match, return 1
    -
    173  return 1;
    -
    174  }
    -
    175  else
    -
    176  { // unknown result!!
    -
    177  return 0;
    -
    178  }
    -
    179 }
    +
    153{
    +
    154 // If the root is null, the key's not present
    +
    155 if (root == NULL)
    +
    156 {
    +
    157 return 0;
    +
    158 }
    +
    159 else if (data > root->data)
    +
    160 {
    +
    161 // If the input key is greater than the root's, search in the right
    +
    162 // subtree
    +
    163 return find(root->right, data);
    +
    164 }
    +
    165 else if (data < root->data)
    +
    166 {
    +
    167 // If the input key is lower than the root's, search in the left subtree
    +
    168 return find(root->left, data);
    +
    169 }
    +
    170 else if (data == root->data)
    +
    171 {
    +
    172 // If the input and the root key match, return 1
    +
    173 return 1;
    +
    174 }
    +
    175 else
    +
    176 { // unknown result!!
    +
    177 return 0;
    +
    178 }
    +
    179}
    int find(node *root, int data)
    Search procedure, which looks for the input key in the tree and returns 1 if it's present or 0 if it'...
    Definition: binary_search_tree.c:152
    -
    +
    +Here is the call graph for this function:
    +
    +
    - -

    ◆ getMax()

    + + + + +

    ◆ getMax()

    - + @@ -359,18 +363,24 @@ Here is the call graph for this function:
    Returns
    pointer to parent node
    -
    73 {
    -
    74  // If there's no leaf to the right, then this is the maximum key value
    -
    75  if (root->right != NULL)
    -
    76  {
    -
    77  return getMax(root->right);
    -
    78  }
    -
    79  return root;
    -
    80 }
    -
    +
    73{
    +
    74 // If there's no leaf to the right, then this is the maximum key value
    +
    75 if (root->right != NULL)
    +
    76 {
    +
    77 return getMax(root->right);
    +
    78 }
    +
    79 return root;
    +
    80}
    +
    +Here is the call graph for this function:
    +
    +
    - + + + +

    ◆ height()

    @@ -397,36 +407,42 @@ Here is the call graph for this function:
    Returns
    0 if value not found in the nodes
    height of nodes to get to data from parent node
    -
    188 {
    -
    189  // If the root is null, this is the bottom of the tree (height 0)
    -
    190  if (root == NULL)
    -
    191  {
    -
    192  return 0;
    -
    193  }
    -
    194  else
    -
    195  {
    -
    196  // Get the height from both left and right subtrees to check which is
    -
    197  // the greatest
    -
    198  int right_h = height(root->right);
    -
    199  int left_h = height(root->left);
    -
    200 
    -
    201  // The final height is the height of the greatest subtree(left or right)
    -
    202  // plus 1(which is the root's level)
    -
    203  if (right_h > left_h)
    -
    204  {
    -
    205  return (right_h + 1);
    -
    206  }
    -
    207  else
    -
    208  {
    -
    209  return (left_h + 1);
    -
    210  }
    -
    211  }
    -
    212 }
    +
    188{
    +
    189 // If the root is null, this is the bottom of the tree (height 0)
    +
    190 if (root == NULL)
    +
    191 {
    +
    192 return 0;
    +
    193 }
    +
    194 else
    +
    195 {
    +
    196 // Get the height from both left and right subtrees to check which is
    +
    197 // the greatest
    +
    198 int right_h = height(root->right);
    +
    199 int left_h = height(root->left);
    +
    200
    +
    201 // The final height is the height of the greatest subtree(left or right)
    +
    202 // plus 1(which is the root's level)
    +
    203 if (right_h > left_h)
    +
    204 {
    +
    205 return (right_h + 1);
    +
    206 }
    +
    207 else
    +
    208 {
    +
    209 return (left_h + 1);
    +
    210 }
    +
    211 }
    +
    212}
    int height(node *root)
    Utilitary procedure to measure the height of the binary tree.
    Definition: binary_search_tree.c:187
    -
    +
    +Here is the call graph for this function:
    +
    +
    - + + + +

    ◆ inOrder()

    @@ -449,26 +465,32 @@ height of nodes to get to data from parent node
    node* getMax node * getMax ( node *  root)
    -
    239 {
    -
    240  if (root != NULL)
    -
    241  {
    -
    242  inOrder(root->left);
    -
    243  printf("\t[ %d ]\t", root->data);
    -
    244  inOrder(root->right);
    -
    245  }
    -
    246 }
    +
    239{
    +
    240 if (root != NULL)
    +
    241 {
    +
    242 inOrder(root->left);
    +
    243 printf("\t[ %d ]\t", root->data);
    +
    244 inOrder(root->right);
    +
    245 }
    +
    246}
    void inOrder(node *root)
    Traversal procedure to list the current keys in the tree in order of value (from the left to the righ...
    Definition: binary_search_tree.c:238
    -
    +
    +Here is the call graph for this function:
    +
    +
    - -

    ◆ insert()

    + +
    +
    + +

    ◆ insert()

    - + @@ -496,45 +518,131 @@ height of nodes to get to data from parent node
    Returns
    pointer to parent node
    -
    47 {
    -
    48  // If the root of the subtree is null, insert key here
    -
    49  if (root == NULL)
    -
    50  {
    -
    51  root = newNode(data);
    -
    52  }
    -
    53  else if (data > root->data)
    -
    54  {
    -
    55  // If it isn't null and the input key is greater than the root key,
    -
    56  // insert in the right leaf
    -
    57  root->right = insert(root->right, data);
    -
    58  }
    -
    59  else if (data < root->data)
    -
    60  { // If it isn't null and the input key is lower than the root key, insert
    -
    61  // in the left leaf
    -
    62  root->left = insert(root->left, data);
    -
    63  }
    -
    64  // Returns the modified tree
    -
    65  return root;
    -
    66 }
    -
    node * insert(node *root, int data)
    Insertion procedure, which inserts the input key in a new node in the tree.
    Definition: binary_search_tree.c:46
    -
    node * newNode(int data)
    The node constructor, which receives the key value input and returns a node pointer.
    Definition: binary_search_tree.c:28
    +
    47{
    +
    48 // If the root of the subtree is null, insert key here
    +
    49 if (root == NULL)
    +
    50 {
    +
    51 root = newNode(data);
    +
    52 }
    +
    53 else if (data > root->data)
    +
    54 {
    +
    55 // If it isn't null and the input key is greater than the root key,
    +
    56 // insert in the right leaf
    +
    57 root->right = insert(root->right, data);
    +
    58 }
    +
    59 else if (data < root->data)
    +
    60 { // If it isn't null and the input key is lower than the root key, insert
    +
    61 // in the left leaf
    +
    62 root->left = insert(root->left, data);
    +
    63 }
    +
    64 // Returns the modified tree
    +
    65 return root;
    +
    66}
    +
    node * insert(node *root, int data)
    Insertion procedure, which inserts the input key in a new node in the tree.
    Definition: binary_search_tree.c:46
    +
    node * newNode(int data)
    The node constructor, which receives the key value input and returns a node pointer.
    Definition: binary_search_tree.c:28
    Here is the call graph for this function:
    -
    +
    - -

    ◆ newNode()

    + +

    ◆ main()

    node* insert node * insert ( node *  root,
    - + + + + + + +
    node* newNode int main (void )
    +
    + +

    Main funcion.

    +
    250{
    +
    251 // this reference don't change.
    +
    252 // only the tree changes.
    +
    253 node *root = NULL;
    +
    254 int opt = -1;
    +
    255 int data = 0;
    +
    256
    +
    257 // event-loop.
    +
    258 while (opt != 0)
    +
    259 {
    +
    260 printf(
    +
    261 "\n\n[1] Insert Node\n[2] Delete Node\n[3] Find a Node\n[4] Get "
    +
    262 "current Height\n[5] Print Tree in Crescent Order\n[0] Quit\n");
    +
    263 scanf("%d", &opt); // reads the choice of the user
    +
    264
    +
    265 // processes the choice
    +
    266 switch (opt)
    +
    267 {
    +
    268 case 1:
    +
    269 printf("Enter the new node's value:\n");
    +
    270 scanf("%d", &data);
    +
    271 root = insert(root, data);
    +
    272 break;
    +
    273
    +
    274 case 2:
    +
    275 printf("Enter the value to be removed:\n");
    +
    276 if (root != NULL)
    +
    277 {
    +
    278 scanf("%d", &data);
    +
    279 root = delete (root, data);
    +
    280 }
    +
    281 else
    +
    282 {
    +
    283 printf("Tree is already empty!\n");
    +
    284 }
    +
    285 break;
    +
    286
    +
    287 case 3:
    +
    288 printf("Enter the searched value:\n");
    +
    289 scanf("%d", &data);
    +
    290 find(root, data) ? printf("The value is in the tree.\n")
    +
    291 : printf("The value is not in the tree.\n");
    +
    292 break;
    +
    293
    +
    294 case 4:
    +
    295 printf("Current height of the tree is: %d\n", height(root));
    +
    296 break;
    +
    297
    +
    298 case 5:
    +
    299 inOrder(root);
    +
    300 break;
    +
    301 }
    +
    302 }
    +
    303
    +
    304 // deletes the tree from the heap.
    +
    305 purge(root);
    +
    306
    +
    307 return 0;
    +
    308}
    +
    void purge(node *root)
    Utilitary procedure to free all nodes in a tree.
    Definition: binary_search_tree.c:217
    +
    +Here is the call graph for this function:
    +
    +
    +
    +
    + +
    +
    + +

    ◆ newNode()

    + +
    +
    + + + @@ -552,24 +660,24 @@ Here is the call graph for this function:
    Returns
    new node with the provided data
    Note
    the node must be deleted before program terminates to avoid memory leaks
    -
    29 {
    -
    30  // creates a slug
    -
    31  node *tmp = (node *)malloc(sizeof(node));
    -
    32 
    -
    33  // initializes the slug
    -
    34  tmp->data = data;
    -
    35  tmp->left = NULL;
    -
    36  tmp->right = NULL;
    -
    37 
    -
    38  return tmp;
    -
    39 }
    +
    29{
    +
    30 // creates a slug
    +
    31 node *tmp = (node *)malloc(sizeof(node));
    +
    32
    +
    33 // initializes the slug
    +
    34 tmp->data = data;
    +
    35 tmp->left = NULL;
    +
    36 tmp->right = NULL;
    +
    37
    +
    38 return tmp;
    +
    39}
    #define malloc(bytes)
    This macro replace the standard malloc function with malloc_dbg.
    Definition: malloc_dbg.h:18
    struct node * right
    right child
    Definition: binary_search_tree.c:17
    struct node * left
    left child
    Definition: binary_search_tree.c:16
    - +

    ◆ purge()

    @@ -592,23 +700,28 @@ Here is the call graph for this function:
    node * newNode ( int  data)
    -
    218 {
    -
    219  if (root != NULL)
    -
    220  {
    -
    221  if (root->left != NULL)
    -
    222  {
    -
    223  purge(root->left);
    -
    224  }
    -
    225  if (root->right != NULL)
    -
    226  {
    -
    227  purge(root->right);
    -
    228  }
    -
    229  free(root);
    -
    230  root = NULL; // reset pointer
    -
    231  }
    -
    232 }
    -
    void purge(node *root)
    Utilitary procedure to free all nodes in a tree.
    Definition: binary_search_tree.c:217
    -
    +
    218{
    +
    219 if (root != NULL)
    +
    220 {
    +
    221 if (root->left != NULL)
    +
    222 {
    +
    223 purge(root->left);
    +
    224 }
    +
    225 if (root->right != NULL)
    +
    226 {
    +
    227 purge(root->right);
    +
    228 }
    +
    229 free(root);
    +
    230 root = NULL; // reset pointer
    +
    231 }
    +
    232}
    +
    +Here is the call graph for this function:
    +
    +
    +
    +
    +
    @@ -617,7 +730,7 @@ Here is the call graph for this function: diff --git a/da/d02/binary__search__tree_8c.js b/da/d02/binary__search__tree_8c.js index 6101f8798..96ba1dfc7 100644 --- a/da/d02/binary__search__tree_8c.js +++ b/da/d02/binary__search__tree_8c.js @@ -2,13 +2,13 @@ var binary__search__tree_8c = [ [ "node", "d5/da1/structnode.html", "d5/da1/structnode" ], [ "node", "da/d02/binary__search__tree_8c.html#af4aeda155dbe167f1c1cf38cb65bf324", null ], - [ "delete", "da/d02/binary__search__tree_8c.html#a748f3966920e2fd197906be1e151b127", null ], + [ "delete", "da/d02/binary__search__tree_8c.html#a6983e8a91a3d25d7d000807f18ba2748", null ], [ "find", "da/d02/binary__search__tree_8c.html#adff4c6248834a9944a1fb03a20230c9c", null ], - [ "getMax", "da/d02/binary__search__tree_8c.html#ad297e528a7bb8604ca93af149d609150", null ], + [ "getMax", "da/d02/binary__search__tree_8c.html#ad50f3debc5323bb7b71933effb64f30f", null ], [ "height", "da/d02/binary__search__tree_8c.html#ae4a66d8b0c2b0d626aea45977e358c83", null ], [ "inOrder", "da/d02/binary__search__tree_8c.html#a0f18adaaca5ecc410cfa16dd2a3684dc", null ], - [ "insert", "da/d02/binary__search__tree_8c.html#a73152b9ccb4aa5cd4c1bacd4188bb2de", null ], + [ "insert", "da/d02/binary__search__tree_8c.html#a031cc98830742bca57c0da81a0fb779f", null ], [ "main", "da/d02/binary__search__tree_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], - [ "newNode", "da/d02/binary__search__tree_8c.html#ac73c73be92dbbeeaad942c0103b9540d", null ], + [ "newNode", "da/d02/binary__search__tree_8c.html#adf2169c1008551b20c4a59fcf0c9ab3b", null ], [ "purge", "da/d02/binary__search__tree_8c.html#a01151353aa2d9688934ed39208133241", null ] ]; \ No newline at end of file diff --git a/da/d02/binary__search__tree_8c_a01151353aa2d9688934ed39208133241_cgraph.map b/da/d02/binary__search__tree_8c_a01151353aa2d9688934ed39208133241_cgraph.map new file mode 100644 index 000000000..ee485dce1 --- /dev/null +++ b/da/d02/binary__search__tree_8c_a01151353aa2d9688934ed39208133241_cgraph.map @@ -0,0 +1,3 @@ + + + diff --git a/da/d02/binary__search__tree_8c_a01151353aa2d9688934ed39208133241_cgraph.md5 b/da/d02/binary__search__tree_8c_a01151353aa2d9688934ed39208133241_cgraph.md5 new file mode 100644 index 000000000..ef5134780 --- /dev/null +++ b/da/d02/binary__search__tree_8c_a01151353aa2d9688934ed39208133241_cgraph.md5 @@ -0,0 +1 @@ +3585ef9402cbfe9a3e0b25cc46280003 \ No newline at end of file diff --git a/da/d02/binary__search__tree_8c_a01151353aa2d9688934ed39208133241_cgraph.svg b/da/d02/binary__search__tree_8c_a01151353aa2d9688934ed39208133241_cgraph.svg new file mode 100644 index 000000000..9d5c5f1c7 --- /dev/null +++ b/da/d02/binary__search__tree_8c_a01151353aa2d9688934ed39208133241_cgraph.svg @@ -0,0 +1,28 @@ + + + + + + +purge + + + +Node1 + + +purge + + + + + +Node1->Node1 + + + + + diff --git a/da/d02/binary__search__tree_8c_a73152b9ccb4aa5cd4c1bacd4188bb2de_cgraph.map b/da/d02/binary__search__tree_8c_a031cc98830742bca57c0da81a0fb779f_cgraph.map similarity index 71% rename from da/d02/binary__search__tree_8c_a73152b9ccb4aa5cd4c1bacd4188bb2de_cgraph.map rename to da/d02/binary__search__tree_8c_a031cc98830742bca57c0da81a0fb779f_cgraph.map index a3b9b5d76..674df993f 100644 --- a/da/d02/binary__search__tree_8c_a73152b9ccb4aa5cd4c1bacd4188bb2de_cgraph.map +++ b/da/d02/binary__search__tree_8c_a031cc98830742bca57c0da81a0fb779f_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/da/d02/binary__search__tree_8c_a031cc98830742bca57c0da81a0fb779f_cgraph.md5 b/da/d02/binary__search__tree_8c_a031cc98830742bca57c0da81a0fb779f_cgraph.md5 new file mode 100644 index 000000000..3fd662b11 --- /dev/null +++ b/da/d02/binary__search__tree_8c_a031cc98830742bca57c0da81a0fb779f_cgraph.md5 @@ -0,0 +1 @@ +b0f9264dd6c1f816843e6cf7f87be306 \ No newline at end of file diff --git a/da/d02/binary__search__tree_8c_a73152b9ccb4aa5cd4c1bacd4188bb2de_cgraph.svg b/da/d02/binary__search__tree_8c_a031cc98830742bca57c0da81a0fb779f_cgraph.svg similarity index 53% rename from da/d02/binary__search__tree_8c_a73152b9ccb4aa5cd4c1bacd4188bb2de_cgraph.svg rename to da/d02/binary__search__tree_8c_a031cc98830742bca57c0da81a0fb779f_cgraph.svg index 5fe362d1f..755fb22eb 100644 --- a/da/d02/binary__search__tree_8c_a73152b9ccb4aa5cd4c1bacd4188bb2de_cgraph.svg +++ b/da/d02/binary__search__tree_8c_a031cc98830742bca57c0da81a0fb779f_cgraph.svg @@ -1,14 +1,14 @@ - - - + + insert - + Node1 @@ -18,20 +18,26 @@ + + +Node1->Node1 + + + Node2 - - -newNode + + +newNode - + Node1->Node2 - - + + diff --git a/da/d02/binary__search__tree_8c_a0f18adaaca5ecc410cfa16dd2a3684dc_cgraph.map b/da/d02/binary__search__tree_8c_a0f18adaaca5ecc410cfa16dd2a3684dc_cgraph.map new file mode 100644 index 000000000..add9550a7 --- /dev/null +++ b/da/d02/binary__search__tree_8c_a0f18adaaca5ecc410cfa16dd2a3684dc_cgraph.map @@ -0,0 +1,3 @@ + + + diff --git a/da/d02/binary__search__tree_8c_a0f18adaaca5ecc410cfa16dd2a3684dc_cgraph.md5 b/da/d02/binary__search__tree_8c_a0f18adaaca5ecc410cfa16dd2a3684dc_cgraph.md5 new file mode 100644 index 000000000..52186524f --- /dev/null +++ b/da/d02/binary__search__tree_8c_a0f18adaaca5ecc410cfa16dd2a3684dc_cgraph.md5 @@ -0,0 +1 @@ +0a342790904975803aa9103849d5c12c \ No newline at end of file diff --git a/da/d02/binary__search__tree_8c_a0f18adaaca5ecc410cfa16dd2a3684dc_cgraph.svg b/da/d02/binary__search__tree_8c_a0f18adaaca5ecc410cfa16dd2a3684dc_cgraph.svg new file mode 100644 index 000000000..2d5ffd831 --- /dev/null +++ b/da/d02/binary__search__tree_8c_a0f18adaaca5ecc410cfa16dd2a3684dc_cgraph.svg @@ -0,0 +1,28 @@ + + + + + + +inOrder + + + +Node1 + + +inOrder + + + + + +Node1->Node1 + + + + + diff --git a/da/d02/binary__search__tree_8c_a748f3966920e2fd197906be1e151b127_cgraph.map b/da/d02/binary__search__tree_8c_a6983e8a91a3d25d7d000807f18ba2748_cgraph.map similarity index 71% rename from da/d02/binary__search__tree_8c_a748f3966920e2fd197906be1e151b127_cgraph.map rename to da/d02/binary__search__tree_8c_a6983e8a91a3d25d7d000807f18ba2748_cgraph.map index 66e67892a..a94666247 100644 --- a/da/d02/binary__search__tree_8c_a748f3966920e2fd197906be1e151b127_cgraph.map +++ b/da/d02/binary__search__tree_8c_a6983e8a91a3d25d7d000807f18ba2748_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/da/d02/binary__search__tree_8c_a6983e8a91a3d25d7d000807f18ba2748_cgraph.md5 b/da/d02/binary__search__tree_8c_a6983e8a91a3d25d7d000807f18ba2748_cgraph.md5 new file mode 100644 index 000000000..88ae44367 --- /dev/null +++ b/da/d02/binary__search__tree_8c_a6983e8a91a3d25d7d000807f18ba2748_cgraph.md5 @@ -0,0 +1 @@ +12245f026ad92f7e349dec188e9f8fe2 \ No newline at end of file diff --git a/da/d02/binary__search__tree_8c_a6983e8a91a3d25d7d000807f18ba2748_cgraph.svg b/da/d02/binary__search__tree_8c_a6983e8a91a3d25d7d000807f18ba2748_cgraph.svg new file mode 100644 index 000000000..af30822af --- /dev/null +++ b/da/d02/binary__search__tree_8c_a6983e8a91a3d25d7d000807f18ba2748_cgraph.svg @@ -0,0 +1,43 @@ + + + + + + +delete + + + +Node1 + + +delete + + + + + +Node2 + + +getMax + + + + + +Node1->Node2 + + + + + +Node2->Node2 + + + + + diff --git a/da/d02/binary__search__tree_8c_a73152b9ccb4aa5cd4c1bacd4188bb2de_cgraph.md5 b/da/d02/binary__search__tree_8c_a73152b9ccb4aa5cd4c1bacd4188bb2de_cgraph.md5 deleted file mode 100644 index e098dc39e..000000000 --- a/da/d02/binary__search__tree_8c_a73152b9ccb4aa5cd4c1bacd4188bb2de_cgraph.md5 +++ /dev/null @@ -1 +0,0 @@ -31263cab53e813dd0ca57962513e266f \ No newline at end of file diff --git a/da/d02/binary__search__tree_8c_a748f3966920e2fd197906be1e151b127_cgraph.md5 b/da/d02/binary__search__tree_8c_a748f3966920e2fd197906be1e151b127_cgraph.md5 deleted file mode 100644 index 1b7d0ef5e..000000000 --- a/da/d02/binary__search__tree_8c_a748f3966920e2fd197906be1e151b127_cgraph.md5 +++ /dev/null @@ -1 +0,0 @@ -234a158c09499efc9100054ce7c9c4e2 \ No newline at end of file diff --git a/da/d02/binary__search__tree_8c_a748f3966920e2fd197906be1e151b127_cgraph.svg b/da/d02/binary__search__tree_8c_a748f3966920e2fd197906be1e151b127_cgraph.svg deleted file mode 100644 index 3232546c1..000000000 --- a/da/d02/binary__search__tree_8c_a748f3966920e2fd197906be1e151b127_cgraph.svg +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - -delete - - - -Node1 - - -delete - - - - - -Node2 - - -getMax - - - - - -Node1->Node2 - - - - - diff --git a/da/d02/binary__search__tree_8c_ad50f3debc5323bb7b71933effb64f30f_cgraph.map b/da/d02/binary__search__tree_8c_ad50f3debc5323bb7b71933effb64f30f_cgraph.map new file mode 100644 index 000000000..5b814bc7c --- /dev/null +++ b/da/d02/binary__search__tree_8c_ad50f3debc5323bb7b71933effb64f30f_cgraph.map @@ -0,0 +1,3 @@ + + + diff --git a/da/d02/binary__search__tree_8c_ad50f3debc5323bb7b71933effb64f30f_cgraph.md5 b/da/d02/binary__search__tree_8c_ad50f3debc5323bb7b71933effb64f30f_cgraph.md5 new file mode 100644 index 000000000..c3aee7712 --- /dev/null +++ b/da/d02/binary__search__tree_8c_ad50f3debc5323bb7b71933effb64f30f_cgraph.md5 @@ -0,0 +1 @@ +8d9398c5a55167a0b63fb63eacc3c514 \ No newline at end of file diff --git a/da/d02/binary__search__tree_8c_ad50f3debc5323bb7b71933effb64f30f_cgraph.svg b/da/d02/binary__search__tree_8c_ad50f3debc5323bb7b71933effb64f30f_cgraph.svg new file mode 100644 index 000000000..75bf7977a --- /dev/null +++ b/da/d02/binary__search__tree_8c_ad50f3debc5323bb7b71933effb64f30f_cgraph.svg @@ -0,0 +1,28 @@ + + + + + + +getMax + + + +Node1 + + +getMax + + + + + +Node1->Node1 + + + + + diff --git a/da/d02/binary__search__tree_8c_adff4c6248834a9944a1fb03a20230c9c_cgraph.map b/da/d02/binary__search__tree_8c_adff4c6248834a9944a1fb03a20230c9c_cgraph.map new file mode 100644 index 000000000..621c52aaf --- /dev/null +++ b/da/d02/binary__search__tree_8c_adff4c6248834a9944a1fb03a20230c9c_cgraph.map @@ -0,0 +1,3 @@ + + + diff --git a/da/d02/binary__search__tree_8c_adff4c6248834a9944a1fb03a20230c9c_cgraph.md5 b/da/d02/binary__search__tree_8c_adff4c6248834a9944a1fb03a20230c9c_cgraph.md5 new file mode 100644 index 000000000..0719cd68c --- /dev/null +++ b/da/d02/binary__search__tree_8c_adff4c6248834a9944a1fb03a20230c9c_cgraph.md5 @@ -0,0 +1 @@ +5eeb33c52aae7183f3016fb572c3798b \ No newline at end of file diff --git a/da/d02/binary__search__tree_8c_adff4c6248834a9944a1fb03a20230c9c_cgraph.svg b/da/d02/binary__search__tree_8c_adff4c6248834a9944a1fb03a20230c9c_cgraph.svg new file mode 100644 index 000000000..8c339ff29 --- /dev/null +++ b/da/d02/binary__search__tree_8c_adff4c6248834a9944a1fb03a20230c9c_cgraph.svg @@ -0,0 +1,28 @@ + + + + + + +find + + + +Node1 + + +find + + + + + +Node1->Node1 + + + + + diff --git a/da/d02/binary__search__tree_8c_ae4a66d8b0c2b0d626aea45977e358c83_cgraph.map b/da/d02/binary__search__tree_8c_ae4a66d8b0c2b0d626aea45977e358c83_cgraph.map new file mode 100644 index 000000000..6cb2e91d2 --- /dev/null +++ b/da/d02/binary__search__tree_8c_ae4a66d8b0c2b0d626aea45977e358c83_cgraph.map @@ -0,0 +1,3 @@ + + + diff --git a/da/d02/binary__search__tree_8c_ae4a66d8b0c2b0d626aea45977e358c83_cgraph.md5 b/da/d02/binary__search__tree_8c_ae4a66d8b0c2b0d626aea45977e358c83_cgraph.md5 new file mode 100644 index 000000000..1ebd24ebe --- /dev/null +++ b/da/d02/binary__search__tree_8c_ae4a66d8b0c2b0d626aea45977e358c83_cgraph.md5 @@ -0,0 +1 @@ +4c4ec380d2358eff5a2c87fb583d2aac \ No newline at end of file diff --git a/da/d02/binary__search__tree_8c_ae4a66d8b0c2b0d626aea45977e358c83_cgraph.svg b/da/d02/binary__search__tree_8c_ae4a66d8b0c2b0d626aea45977e358c83_cgraph.svg new file mode 100644 index 000000000..80935c975 --- /dev/null +++ b/da/d02/binary__search__tree_8c_ae4a66d8b0c2b0d626aea45977e358c83_cgraph.svg @@ -0,0 +1,28 @@ + + + + + + +height + + + +Node1 + + +height + + + + + +Node1->Node1 + + + + + diff --git a/da/d02/binary__search__tree_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/da/d02/binary__search__tree_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..da234f61d --- /dev/null +++ b/da/d02/binary__search__tree_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/da/d02/binary__search__tree_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/da/d02/binary__search__tree_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..8a6977915 --- /dev/null +++ b/da/d02/binary__search__tree_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +f0f60299aaf1a5d3e0bed60b43e9fe9b \ No newline at end of file diff --git a/da/d02/binary__search__tree_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/da/d02/binary__search__tree_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..eef0a5a79 --- /dev/null +++ b/da/d02/binary__search__tree_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,142 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +find + + + + + +Node1->Node2 + + + + + +Node3 + + +height + + + + + +Node1->Node3 + + + + + +Node4 + + +inOrder + + + + + +Node1->Node4 + + + + + +Node5 + + +insert + + + + + +Node1->Node5 + + + + + +Node7 + + +purge + + + + + +Node1->Node7 + + + + + +Node2->Node2 + + + + + +Node3->Node3 + + + + + +Node4->Node4 + + + + + +Node5->Node5 + + + + + +Node6 + + +newNode + + + + + +Node5->Node6 + + + + + +Node7->Node7 + + + + + diff --git a/da/d07/tcp__half__duplex__client_8c.html b/da/d07/tcp__half__duplex__client_8c.html new file mode 100644 index 000000000..4c299b5d5 --- /dev/null +++ b/da/d07/tcp__half__duplex__client_8c.html @@ -0,0 +1,351 @@ + + + + + + + +Algorithms_in_C: client_server/tcp_half_duplex_client.c File Reference + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Algorithms_in_C 1.0.0 +
    +
    Set of algorithms implemented in C.
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    tcp_half_duplex_client.c File Reference
    +
    +
    + +

    Client-side implementation of TCP Half Duplex Communication +More...

    +
    #include <netdb.h>
    +#include <netinet/in.h>
    +#include <stdint.h>
    +#include <stdio.h>
    +#include <stdlib.h>
    +#include <string.h>
    +#include <sys/socket.h>
    +#include <sys/types.h>
    +#include <unistd.h>
    +
    +Include dependency graph for tcp_half_duplex_client.c:
    +
    +
    +
    +
    +
    + + + + +

    +Macros

    #define PORT   8100
     For structures returned by the network database library - formatted internet addresses and port numbers For in_addr and sockaddr_in structures. More...
     
    + + + + + + + +

    +Functions

    void error ()
     Utility function used to print an error message to stderr. More...
     
    int main ()
     Main function. More...
     
    +

    Detailed Description

    +

    Client-side implementation of TCP Half Duplex Communication

    +
    Author
    Nikhill Vombatkere
    +
    See also
    tcp_half_duplex_server.c
    +

    The algorithm is based on the simple TCP client and server model. However, instead of the server only sending and the client only receiving data, the server and client can both send data but only one at a time. This is implemented by using a particular ordering of the send() and recv() functions. When one of the clients or servers is sending, the other can only receive and vice-versa. In this way, the Half Duplex Form of communication can be represented using the TCP server-client model & socket programming

    +

    Macro Definition Documentation

    + +

    ◆ PORT

    + +
    +
    + + + + +
    #define PORT   8100
    +
    + +

    For structures returned by the network database library - formatted internet addresses and port numbers For in_addr and sockaddr_in structures.

    +

    For specific bit size values of variables Variable types, several macros, and various functions for performing input and output Variable types, several macros, and various functions for performing general functions Various functions for manipulating arrays of characters For macro definitions related to the creation of sockets For definitions to allow for the porting of BSD programs For miscellaneous symbolic constants and types, and miscellaneous functions

    + +
    +
    +

    Function Documentation

    + +

    ◆ error()

    + +
    +
    + + + + + + + +
    void error ()
    +
    + +

    Utility function used to print an error message to stderr.

    +

    It prints str and an implementation-defined error message corresponding to the global variable errno.

    Returns
    void
    +
    37{
    +
    38 perror("Socket Creation Failed");
    +
    39 exit(EXIT_FAILURE);
    +
    40}
    +
    +
    +
    + +

    ◆ main()

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

    Main function.

    +
    Returns
    0 on exit
    +

    Variable Declarations

    +

    < socket descriptors - Like file handles but for sockets

    +

    < basic structures for all syscalls and functions that deal with internet addresses. Structures for handling internet addresses

    +

    < Character arrays to read and store string data for communication

    +

    The TCP socket is created using the socket function.

    +

    AF_INET (Family) - it is an address family that is used to designate the type of addresses that your socket can communicate with

    +

    SOCK_STREAM (Type) - Indicates TCP Connection - A stream socket provides for the bidirectional, reliable, sequenced, and unduplicated flow of data without record boundaries. Aside from the bidirectionality of data flow, a pair of connected stream sockets provides an interface nearly identical to pipes.

    +

    0 (Protocol) - Specifies a particular protocol to be used with the socket. Specifying a protocol of 0 causes socket() to use an unspecified default protocol appropriate for the requested socket type.

    +

    Server Address Information

    +

    The bzero() function erases the data in the n bytes of the memory starting at the location pointed to, by writing zeros (bytes containing '\0') to that area.

    +

    We bind the server_addr to the internet address and port number thus giving our socket an identity with an address and port where it can listen for connections

    +

    htons - The htons() function translates a short integer from host byte order to network byte order

    +

    htonl - The htonl() function translates a long integer from host byte order to network byte order

    +

    These functions are necessary so that the binding of address and port takes place with data in the correct format

    +

    Connects the client to the server address using the socket descriptor This enables the two to communicate and exchange data

    +

    Communication between client and server

    +

    The bzero() function erases the data in the n bytes of the memory starting at the location pointed to, by writing zeros (bytes containing '\0') to that area. The variables are emptied and then ready for use

    +

    First the CLIENT receives the servers message and displays it (recv())

    +

    The CLIENT is then prompted to type in a message and send it to the server. (send())

    +

    The server and client can communicate till one of them exits the connection

    +

    Since the exchange of information between the server and client take place one at a time this represents HALF DUPLEX COMMUNICATION

    +

    Receive Message

    +

    Send Message

    +

    Close Socket

    +
    47{
    +
    48 /** Variable Declarations */
    +
    49 uint32_t
    +
    50 sockfd; ///< socket descriptors - Like file handles but for sockets
    +
    51 struct sockaddr_in
    +
    52 server_addr; ///< basic structures for all syscalls and functions that
    +
    53 /// deal with internet addresses. Structures for handling
    +
    54 /// internet addresses
    +
    55 char serverResponse[10000],
    +
    56 clientResponse[10000]; ///< Character arrays to read and store string
    +
    57 /// data for communication
    +
    58
    +
    59 /**
    +
    60 * The TCP socket is created using the socket function.
    +
    61 *
    +
    62 * AF_INET (Family) - it is an address family that is used to designate the
    +
    63 * type of addresses that your socket can communicate with
    +
    64 *
    +
    65 * SOCK_STREAM (Type) - Indicates TCP Connection - A stream socket provides
    +
    66 * for the bidirectional, reliable, sequenced, and unduplicated flow of data
    +
    67 * without record boundaries. Aside from the bidirectionality of data flow,
    +
    68 * a pair of connected stream sockets provides an interface nearly identical
    +
    69 * to pipes.
    +
    70 *
    +
    71 * 0 (Protocol) - Specifies a particular protocol to be used with the
    +
    72 * socket. Specifying a protocol of 0 causes socket() to use an unspecified
    +
    73 * default protocol appropriate for the requested socket type.
    +
    74 */
    +
    75 if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
    +
    76 {
    +
    77 error();
    +
    78 }
    +
    79
    +
    80 /**
    +
    81 * Server Address Information
    +
    82 *
    +
    83 * The bzero() function erases the data in the n bytes of the memory
    +
    84 * starting at the location pointed to, by writing zeros (bytes
    +
    85 * containing '\0') to that area.
    +
    86 *
    +
    87 * We bind the server_addr to the internet address and port number thus
    +
    88 * giving our socket an identity with an address and port where it can
    +
    89 * listen for connections
    +
    90 *
    +
    91 * htons - The htons() function translates a short integer from host byte
    +
    92 * order to network byte order
    +
    93 *
    +
    94 * htonl - The htonl() function translates a long integer from host byte
    +
    95 * order to network byte order
    +
    96 *
    +
    97 * These functions are necessary so that the binding of address and port
    +
    98 * takes place with data in the correct format
    +
    99 */
    +
    100 bzero(&server_addr, sizeof(server_addr));
    +
    101 server_addr.sin_family = AF_INET;
    +
    102 server_addr.sin_port = htons(PORT);
    +
    103 server_addr.sin_addr.s_addr = htonl(INADDR_ANY);
    +
    104
    +
    105 printf("Client is running...\n");
    +
    106
    +
    107 /**
    +
    108 * Connects the client to the server address using the socket descriptor
    +
    109 * This enables the two to communicate and exchange data
    +
    110 */
    +
    111 connect(sockfd, (struct sockaddr *)&server_addr, sizeof(server_addr));
    +
    112
    +
    113 printf("Client is connected...\n");
    +
    114
    +
    115 /**
    +
    116 * Communication between client and server
    +
    117 *
    +
    118 * The bzero() function erases the data in the n bytes of the memory
    +
    119 * starting at the location pointed to, by writing zeros (bytes
    +
    120 * containing '\0') to that area. The variables are emptied and then
    +
    121 * ready for use
    +
    122 *
    +
    123 * First the CLIENT receives the servers message and displays it (recv())
    +
    124 *
    +
    125 * The CLIENT is then prompted to type in a message and send it to the
    +
    126 * server. (send())
    +
    127 *
    +
    128 * The server and client can communicate till one of them exits the
    +
    129 * connection
    +
    130 *
    +
    131 * Since the exchange of information between the server and client take
    +
    132 * place one at a time this represents HALF DUPLEX COMMUNICATION
    +
    133 */
    +
    134 while (1)
    +
    135 {
    +
    136 bzero(&serverResponse, sizeof(serverResponse));
    +
    137 bzero(&clientResponse, sizeof(clientResponse));
    +
    138
    +
    139 /// Receive Message
    +
    140 recv(sockfd, serverResponse, sizeof(serverResponse), 0);
    +
    141 printf("\nServer message: %s \n", serverResponse);
    +
    142
    +
    143 /// Send Message
    +
    144 printf("\nEnter message here: ");
    +
    145 fgets(clientResponse, 10000, stdin);
    +
    146 send(sockfd, clientResponse, strlen(clientResponse) + 1, 0);
    +
    147 }
    +
    148
    +
    149 /// Close Socket
    +
    150 close(sockfd);
    +
    151 printf("Client is offline...\n");
    +
    152 return 0;
    +
    153}
    +
    #define PORT
    For structures returned by the network database library - formatted internet addresses and port numbe...
    Definition: tcp_half_duplex_client.c:28
    +
    void error()
    Utility function used to print an error message to stderr.
    Definition: tcp_half_duplex_client.c:36
    +
    +Here is the call graph for this function:
    +
    +
    +
    +
    + +
    +
    +
    +
    + + + + diff --git a/da/d07/tcp__half__duplex__client_8c.js b/da/d07/tcp__half__duplex__client_8c.js new file mode 100644 index 000000000..3770be68f --- /dev/null +++ b/da/d07/tcp__half__duplex__client_8c.js @@ -0,0 +1,6 @@ +var tcp__half__duplex__client_8c = +[ + [ "PORT", "da/d07/tcp__half__duplex__client_8c.html#a614217d263be1fb1a5f76e2ff7be19a2", null ], + [ "error", "da/d07/tcp__half__duplex__client_8c.html#a7e15c8e2885871839fc2b820dfbdb4ce", null ], + [ "main", "da/d07/tcp__half__duplex__client_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/da/d07/tcp__half__duplex__client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/da/d07/tcp__half__duplex__client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..493054b6a --- /dev/null +++ b/da/d07/tcp__half__duplex__client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/da/d07/tcp__half__duplex__client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/da/d07/tcp__half__duplex__client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..d8defbc7a --- /dev/null +++ b/da/d07/tcp__half__duplex__client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +7273c383b402f3858218ae47986bccf2 \ No newline at end of file diff --git a/da/d07/tcp__half__duplex__client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/da/d07/tcp__half__duplex__client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..cc46029c3 --- /dev/null +++ b/da/d07/tcp__half__duplex__client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,37 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +error + + + + + +Node1->Node2 + + + + + diff --git a/da/d0b/alaw_8c__incl.map b/da/d0b/alaw_8c__incl.map new file mode 100644 index 000000000..af10f55c5 --- /dev/null +++ b/da/d0b/alaw_8c__incl.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/da/d0b/alaw_8c__incl.md5 b/da/d0b/alaw_8c__incl.md5 new file mode 100644 index 000000000..3ad4641b0 --- /dev/null +++ b/da/d0b/alaw_8c__incl.md5 @@ -0,0 +1 @@ +8be4af8b0d0bfe352a3c8f0e45f456c3 \ No newline at end of file diff --git a/da/d0b/alaw_8c__incl.svg b/da/d0b/alaw_8c__incl.svg new file mode 100644 index 000000000..974f6151e --- /dev/null +++ b/da/d0b/alaw_8c__incl.svg @@ -0,0 +1,67 @@ + + + + + + +audio/alaw.c + + + +Node1 + + +audio/alaw.c + + + + + +Node2 + + +assert.h + + + + + +Node1->Node2 + + + + + +Node3 + + +inttypes.h + + + + + +Node1->Node3 + + + + + +Node4 + + +stdio.h + + + + + +Node1->Node4 + + + + + diff --git a/da/d23/list_8h_source.html b/da/d23/list_8h_source.html index 92b29647b..91f275638 100644 --- a/da/d23/list_8h_source.html +++ b/da/d23/list_8h_source.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: data_structures/list/list.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.
    - + +/* @license-end */ +
    @@ -70,7 +70,7 @@ $(function() {
@@ -90,34 +90,33 @@ $(document).ready(function(){initNavTree('da/d23/list_8h_source.html','../../');
-
-
list.h
+
list.h
-
1 #ifndef __LIST__
-
2 #define __LIST__
-
3 
-
4 #define L List_T
-
5 typedef struct L *L;
-
6 
-
7 struct L
-
8 {
-
9  void *val;
-
10  L next;
-
11 };
-
12 
-
13 extern L List_init(void);
-
14 extern L List_push(L list, void *val);
-
15 extern int List_length(L list);
-
16 extern void **List_toArray(L list);
-
17 extern L List_append(L list, L tail);
-
18 extern L List_list(L list, void *val, ...);
-
19 /* TODO */
-
20 extern L List_copy(L list);
-
21 extern int List_pop(L *list);
-
22 
-
23 #undef L
-
24 #endif
+
1#ifndef __LIST__
+
2#define __LIST__
+
3
+
4#define L List_T
+
5typedef struct L *L;
+
6
+
7struct L
+
8{
+
9 void *val;
+
10 L next;
+
11};
+
12
+
13extern L List_init(void);
+
14extern L List_push(L list, void *val);
+
15extern int List_length(L list);
+
16extern void **List_toArray(L list);
+
17extern L List_append(L list, L tail);
+
18extern L List_list(L list, void *val, ...);
+
19/* TODO */
+
20extern L List_copy(L list);
+
21extern int List_pop(L *list);
+
22
+
23#undef L
+
24#endif
Definition: list.h:8
Doubly linked list struct.
Definition: doubly_linked_list.c:24
@@ -126,7 +125,7 @@ $(document).ready(function(){initNavTree('da/d23/list_8h_source.html','../../'); diff --git a/da/d2a/group__adaline.html b/da/d2a/group__adaline.html index c1625bd5d..f03ab0bee 100644 --- a/da/d2a/group__adaline.html +++ b/da/d2a/group__adaline.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Adaline learning 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() {
@@ -94,35 +94,34 @@ $(document).ready(function(){initNavTree('da/d2a/group__adaline.html','../../'); Data Structures | Macros | Functions -
-
Adaline learning algorithm
+
Adaline learning algorithm
Collaboration diagram for Adaline learning algorithm:
-
+
-

+

Data Structures

struct  adaline
 structure to hold adaline model parameters More...
 
- - + - +

+

Macros

-#define MAX_ADALINE_ITER   500
+#define MAX_ADALINE_ITER   500
 Maximum number of iterations to learn.
 
-#define ADALINE_ACCURACY   1e-5
+#define ADALINE_ACCURACY   1e-5
 convergence accuracy \(=1\times10^{-5}\)
 
- @@ -131,11 +130,11 @@ Functions - + - - - + + + @@ -148,7 +147,7 @@ Functions

+

Functions

struct adaline new_adaline (const int num_features, const double eta)
 Default constructor. More...
 delete dynamically allocated memory More...
 
int adaline_activation (double x)
 Heaviside activation function More...
 Heaviside activation function More...
 
char * adaline_get_weights_str (const struct adaline *ada)
 Operator to print the weights of the model. More...
 
char * adaline_get_weights_str (const struct adaline *ada)
 Operator to print the weights of the model. More...
 
int adaline_predict (struct adaline *ada, const double *x, double *out)
 predict the output of the model for given set of features More...
 

Detailed Description

Function Documentation

- +

◆ adaline_activation()

@@ -164,7 +163,7 @@ Functions
-

Heaviside activation function

+

Heaviside activation function

Parameters
@@ -172,11 +171,11 @@ Functions
Returns
\(f(x)= \begin{cases}1 & \forall\; x > 0\\ -1 & \forall\; x \le0 \end{cases}\)
-
105 { return x > 0 ? 1 : -1; }
+
105{ return x > 0 ? 1 : -1; }
- +

◆ adaline_fit()

@@ -224,49 +223,49 @@ Functions
xactivation function input
-
185 {
-
186  double avg_pred_error = 1.f;
-
187 
-
188  int iter;
-
189  for (iter = 0;
-
190  (iter < MAX_ADALINE_ITER) && (avg_pred_error > ADALINE_ACCURACY);
-
191  iter++)
-
192  {
-
193  avg_pred_error = 0.f;
-
194 
-
195  // perform fit for each sample
-
196  for (int i = 0; i < N; i++)
-
197  {
-
198  double err = adaline_fit_sample(ada, X[i], y[i]);
-
199  avg_pred_error += fabs(err);
-
200  }
-
201  avg_pred_error /= N;
-
202 
-
203  // Print updates every 200th iteration
-
204  // if (iter % 100 == 0)
-
205  printf("\tIter %3d: Training weights: %s\tAvg error: %.4f\n", iter,
-
206  adaline_get_weights_str(ada), avg_pred_error);
-
207  }
-
208 
-
209  if (iter < MAX_ADALINE_ITER)
-
210  printf("Converged after %d iterations.\n", iter);
-
211  else
-
212  printf("Did not converged after %d iterations.\n", iter);
-
213 }
+
185{
+
186 double avg_pred_error = 1.f;
+
187
+
188 int iter;
+
189 for (iter = 0;
+
190 (iter < MAX_ADALINE_ITER) && (avg_pred_error > ADALINE_ACCURACY);
+
191 iter++)
+
192 {
+
193 avg_pred_error = 0.f;
+
194
+
195 // perform fit for each sample
+
196 for (int i = 0; i < N; i++)
+
197 {
+
198 double err = adaline_fit_sample(ada, X[i], y[i]);
+
199 avg_pred_error += fabs(err);
+
200 }
+
201 avg_pred_error /= N;
+
202
+
203 // Print updates every 200th iteration
+
204 // if (iter % 100 == 0)
+
205 printf("\tIter %3d: Training weights: %s\tAvg error: %.4f\n", iter,
+
206 adaline_get_weights_str(ada), avg_pred_error);
+
207 }
+
208
+
209 if (iter < MAX_ADALINE_ITER)
+
210 printf("Converged after %d iterations.\n", iter);
+
211 else
+
212 printf("Did not converged after %d iterations.\n", iter);
+
213}
double adaline_fit_sample(struct adaline *ada, const double *x, const int y)
Update the weights of the model using supervised learning for one feature vector.
Definition: adaline_learning.c:158
-
char * adaline_get_weights_str(const struct adaline *ada)
Operator to print the weights of the model.
Definition: adaline_learning.c:112
#define MAX_ADALINE_ITER
Maximum number of iterations to learn.
Definition: adaline_learning.c:40
#define ADALINE_ACCURACY
convergence accuracy
Definition: adaline_learning.c:51
+
char * adaline_get_weights_str(const struct adaline *ada)
Operator to print the weights of the model.
Definition: adaline_learning.c:112
Here is the call graph for this function:
-
+
- +

◆ adaline_fit_sample()

@@ -308,21 +307,21 @@ Here is the call graph for this function:
Returns
correction factor
-
159 {
-
160  /* output of the model with current weights */
-
161  int p = adaline_predict(ada, x, NULL);
-
162  int prediction_error = y - p; // error in estimation
-
163  double correction_factor = ada->eta * prediction_error;
-
164 
-
165  /* update each weight, the last weight is the bias term */
-
166  for (int i = 0; i < ada->num_weights - 1; i++)
-
167  {
-
168  ada->weights[i] += correction_factor * x[i];
-
169  }
-
170  ada->weights[ada->num_weights - 1] += correction_factor; // update bias
-
171 
-
172  return correction_factor;
-
173 }
+
159{
+
160 /* output of the model with current weights */
+
161 int p = adaline_predict(ada, x, NULL);
+
162 int prediction_error = y - p; // error in estimation
+
163 double correction_factor = ada->eta * prediction_error;
+
164
+
165 /* update each weight, the last weight is the bias term */
+
166 for (int i = 0; i < ada->num_weights - 1; i++)
+
167 {
+
168 ada->weights[i] += correction_factor * x[i];
+
169 }
+
170 ada->weights[ada->num_weights - 1] += correction_factor; // update bias
+
171
+
172 return correction_factor;
+
173}
int adaline_predict(struct adaline *ada, const double *x, double *out)
predict the output of the model for given set of features
Definition: adaline_learning.c:136
double * weights
weights of the neural network
Definition: adaline_learning.c:46
int num_weights
number of weights of the neural network
Definition: adaline_learning.c:47
@@ -330,20 +329,20 @@ Here is the call graph for this function:
Here is the call graph for this function:
-
+
- -

◆ adaline_get_weights_str()

+ +

◆ adaline_get_weights_str()

- + @@ -360,23 +359,23 @@ Here is the call graph for this function:
Returns
pointer to a NULL terminated string of formatted weights
-
113 {
-
114  static char out[100]; // static so the value is persistent
-
115 
-
116  sprintf(out, "<");
-
117  for (int i = 0; i < ada->num_weights; i++)
-
118  {
-
119  sprintf(out, "%s%.4g", out, ada->weights[i]);
-
120  if (i < ada->num_weights - 1)
-
121  sprintf(out, "%s, ", out);
-
122  }
-
123  sprintf(out, "%s>", out);
-
124  return out;
-
125 }
+
113{
+
114 static char out[100]; // static so the value is persistent
+
115
+
116 sprintf(out, "<");
+
117 for (int i = 0; i < ada->num_weights; i++)
+
118 {
+
119 sprintf(out, "%s%.4g", out, ada->weights[i]);
+
120 if (i < ada->num_weights - 1)
+
121 sprintf(out, "%s, ", out);
+
122 }
+
123 sprintf(out, "%s>", out);
+
124 return out;
+
125}
- +

◆ adaline_predict()

@@ -418,28 +417,28 @@ Here is the call graph for this function:
Returns
model prediction output
-
137 {
-
138  double y = ada->weights[ada->num_weights - 1]; // assign bias value
-
139 
-
140  for (int i = 0; i < ada->num_weights - 1; i++) y += x[i] * ada->weights[i];
-
141 
-
142  if (out) // if out variable is not NULL
-
143  *out = y;
-
144 
-
145  // quantizer: apply ADALINE threshold function
-
146  return adaline_activation(y);
-
147 }
+
137{
+
138 double y = ada->weights[ada->num_weights - 1]; // assign bias value
+
139
+
140 for (int i = 0; i < ada->num_weights - 1; i++) y += x[i] * ada->weights[i];
+
141
+
142 if (out) // if out variable is not NULL
+
143 *out = y;
+
144
+
145 // quantizer: apply ADALINE threshold function
+
146 return adaline_activation(y);
+
147}
int adaline_activation(double x)
Heaviside activation function
Definition: adaline_learning.c:105
Here is the call graph for this function:
-
+
- +

◆ delete_adaline()

@@ -462,17 +461,17 @@ Here is the call graph for this function:
char* adaline_get_weights_str char * adaline_get_weights_str ( const struct adaline *  ada)
-
90 {
-
91  if (ada == NULL)
-
92  return;
-
93 
-
94  free(ada->weights);
-
95 };
+
90{
+
91 if (ada == NULL)
+
92 return;
+
93
+
94 free(ada->weights);
+
95};
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
- +

◆ new_adaline()

@@ -507,31 +506,31 @@ Here is the call graph for this function:
Returns
new adaline model
-
60 {
-
61  if (eta <= 0.f || eta >= 1.f)
-
62  {
-
63  fprintf(stderr, "learning rate should be > 0 and < 1\n");
-
64  exit(EXIT_FAILURE);
-
65  }
-
66 
-
67  // additional weight is for the constant bias term
-
68  int num_weights = num_features + 1;
-
69  struct adaline ada;
-
70  ada.eta = eta;
-
71  ada.num_weights = num_weights;
-
72  ada.weights = (double *)malloc(num_weights * sizeof(double));
-
73  if (!ada.weights)
-
74  {
-
75  perror("Unable to allocate error for weights!");
-
76  return ada;
-
77  }
-
78 
-
79  // initialize with random weights in the range [-50, 49]
-
80  for (int i = 0; i < num_weights; i++) ada.weights[i] = 1.f;
-
81  // ada.weights[i] = (double)(rand() % 100) - 50);
-
82 
-
83  return ada;
-
84 }
+
60{
+
61 if (eta <= 0.f || eta >= 1.f)
+
62 {
+
63 fprintf(stderr, "learning rate should be > 0 and < 1\n");
+
64 exit(EXIT_FAILURE);
+
65 }
+
66
+
67 // additional weight is for the constant bias term
+
68 int num_weights = num_features + 1;
+
69 struct adaline ada;
+
70 ada.eta = eta;
+
71 ada.num_weights = num_weights;
+
72 ada.weights = (double *)malloc(num_weights * sizeof(double));
+
73 if (!ada.weights)
+
74 {
+
75 perror("Unable to allocate error for weights!");
+
76 return ada;
+
77 }
+
78
+
79 // initialize with random weights in the range [-50, 49]
+
80 for (int i = 0; i < num_weights; i++) ada.weights[i] = 1.f;
+
81 // ada.weights[i] = (double)(rand() % 100) - 50);
+
82
+
83 return ada;
+
84}
#define malloc(bytes)
This macro replace the standard malloc function with malloc_dbg.
Definition: malloc_dbg.h:18
structure to hold adaline model parameters
Definition: adaline_learning.c:44
@@ -542,7 +541,7 @@ Here is the call graph for this function:
diff --git a/da/d2a/group__adaline.js b/da/d2a/group__adaline.js index 8aad22a8e..f74fd160a 100644 --- a/da/d2a/group__adaline.js +++ b/da/d2a/group__adaline.js @@ -10,7 +10,7 @@ var group__adaline = [ "adaline_activation", "da/d2a/group__adaline.html#ga43576566b020c4157d4fb28f0dd45cfa", null ], [ "adaline_fit", "da/d2a/group__adaline.html#gaa52120912e32d2893fe1c6d78da5befd", null ], [ "adaline_fit_sample", "da/d2a/group__adaline.html#ga20d3642e0a87f36fdb7bf91b023cd166", null ], - [ "adaline_get_weights_str", "da/d2a/group__adaline.html#ga251695a79baa885cafdcf6d8ed4ac120", null ], + [ "adaline_get_weights_str", "da/d2a/group__adaline.html#gadb1a7acb555ad62daaf3806bf2fed036", null ], [ "adaline_predict", "da/d2a/group__adaline.html#gac70b578aee679005fd336073969c3d94", null ], [ "delete_adaline", "da/d2a/group__adaline.html#ga6f35caa3084772cc126ac7b20f67f665", null ], [ "new_adaline", "da/d2a/group__adaline.html#gacd88962c5f6341e43cbc69b4a7d3485b", null ] diff --git a/da/d2a/group__adaline.map b/da/d2a/group__adaline.map index db6ca6b71..cade6e430 100644 --- a/da/d2a/group__adaline.map +++ b/da/d2a/group__adaline.map @@ -1,4 +1,4 @@ - - + + diff --git a/da/d2a/group__adaline.svg b/da/d2a/group__adaline.svg index bfc8bead7..c803be47a 100644 --- a/da/d2a/group__adaline.svg +++ b/da/d2a/group__adaline.svg @@ -1,20 +1,20 @@ - - + Adaline learning algorithm - + Node1 - -Adaline learning algorithm + +Adaline learning algorithm @@ -22,16 +22,16 @@ Node2 - -Machine learning algorithms + +Machine learning algorithms Node2->Node1 - - + + diff --git a/da/d2a/group__adaline_ga20d3642e0a87f36fdb7bf91b023cd166_cgraph.map b/da/d2a/group__adaline_ga20d3642e0a87f36fdb7bf91b023cd166_cgraph.map index 4d8009b84..77e6cc21d 100644 --- a/da/d2a/group__adaline_ga20d3642e0a87f36fdb7bf91b023cd166_cgraph.map +++ b/da/d2a/group__adaline_ga20d3642e0a87f36fdb7bf91b023cd166_cgraph.map @@ -1,5 +1,5 @@ - - - + + + diff --git a/da/d2a/group__adaline_ga20d3642e0a87f36fdb7bf91b023cd166_cgraph.svg b/da/d2a/group__adaline_ga20d3642e0a87f36fdb7bf91b023cd166_cgraph.svg index ea30112ad..a61d75b94 100644 --- a/da/d2a/group__adaline_ga20d3642e0a87f36fdb7bf91b023cd166_cgraph.svg +++ b/da/d2a/group__adaline_ga20d3642e0a87f36fdb7bf91b023cd166_cgraph.svg @@ -1,20 +1,20 @@ - - + adaline_fit_sample - + Node1 - -adaline_fit_sample + +adaline_fit_sample @@ -22,31 +22,31 @@ Node2 - -adaline_predict + +adaline_predict Node1->Node2 - - + + Node3 - -adaline_activation + +adaline_activation Node2->Node3 - - + + diff --git a/da/d2a/group__adaline_gaa52120912e32d2893fe1c6d78da5befd_cgraph.map b/da/d2a/group__adaline_gaa52120912e32d2893fe1c6d78da5befd_cgraph.map index 9bb3caf80..7e773d2a1 100644 --- a/da/d2a/group__adaline_gaa52120912e32d2893fe1c6d78da5befd_cgraph.map +++ b/da/d2a/group__adaline_gaa52120912e32d2893fe1c6d78da5befd_cgraph.map @@ -1,7 +1,7 @@ - - - - - + + + + + diff --git a/da/d2a/group__adaline_gaa52120912e32d2893fe1c6d78da5befd_cgraph.md5 b/da/d2a/group__adaline_gaa52120912e32d2893fe1c6d78da5befd_cgraph.md5 index 987545e7c..a3738f89a 100644 --- a/da/d2a/group__adaline_gaa52120912e32d2893fe1c6d78da5befd_cgraph.md5 +++ b/da/d2a/group__adaline_gaa52120912e32d2893fe1c6d78da5befd_cgraph.md5 @@ -1 +1 @@ -1de5fca047e6bf8bfe13973d3a05338c \ No newline at end of file +5884e3f9285c9c629883cd0790772b3f \ No newline at end of file diff --git a/da/d2a/group__adaline_gaa52120912e32d2893fe1c6d78da5befd_cgraph.svg b/da/d2a/group__adaline_gaa52120912e32d2893fe1c6d78da5befd_cgraph.svg index 56bac0f0a..b0075e821 100644 --- a/da/d2a/group__adaline_gaa52120912e32d2893fe1c6d78da5befd_cgraph.svg +++ b/da/d2a/group__adaline_gaa52120912e32d2893fe1c6d78da5befd_cgraph.svg @@ -1,20 +1,20 @@ - - + adaline_fit - + Node1 - -adaline_fit + +adaline_fit @@ -22,61 +22,61 @@ Node2 - -adaline_fit_sample + +adaline_fit_sample Node1->Node2 - - + + Node5 - - -adaline_get_weights_str + + +adaline_get_weights_str Node1->Node5 - - + + Node3 - -adaline_predict + +adaline_predict Node2->Node3 - - + + Node4 - -adaline_activation + +adaline_activation Node3->Node4 - - + + diff --git a/da/d2a/group__adaline_gac70b578aee679005fd336073969c3d94_cgraph.map b/da/d2a/group__adaline_gac70b578aee679005fd336073969c3d94_cgraph.map index 722af557f..37665532a 100644 --- a/da/d2a/group__adaline_gac70b578aee679005fd336073969c3d94_cgraph.map +++ b/da/d2a/group__adaline_gac70b578aee679005fd336073969c3d94_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/da/d2a/group__adaline_gac70b578aee679005fd336073969c3d94_cgraph.svg b/da/d2a/group__adaline_gac70b578aee679005fd336073969c3d94_cgraph.svg index 5e369bd2e..d6351b2ac 100644 --- a/da/d2a/group__adaline_gac70b578aee679005fd336073969c3d94_cgraph.svg +++ b/da/d2a/group__adaline_gac70b578aee679005fd336073969c3d94_cgraph.svg @@ -1,20 +1,20 @@ - - + adaline_predict - + Node1 - -adaline_predict + +adaline_predict @@ -22,16 +22,16 @@ Node2 - -adaline_activation + +adaline_activation Node1->Node2 - - + + diff --git a/da/d31/exponential__search_8c__incl.map b/da/d31/exponential__search_8c__incl.map new file mode 100644 index 000000000..3548f3ab1 --- /dev/null +++ b/da/d31/exponential__search_8c__incl.map @@ -0,0 +1,5 @@ + + + + + diff --git a/da/d31/exponential__search_8c__incl.md5 b/da/d31/exponential__search_8c__incl.md5 new file mode 100644 index 000000000..369daa72f --- /dev/null +++ b/da/d31/exponential__search_8c__incl.md5 @@ -0,0 +1 @@ +108202c651d58b12933b3fff2389422f \ No newline at end of file diff --git a/da/d31/exponential__search_8c__incl.svg b/da/d31/exponential__search_8c__incl.svg new file mode 100644 index 000000000..fa1c368c4 --- /dev/null +++ b/da/d31/exponential__search_8c__incl.svg @@ -0,0 +1,53 @@ + + + + + + +searching/exponential_search.c + + + +Node1 + + +searching/exponential +_search.c + + + + + +Node2 + + +assert.h + + + + + +Node1->Node2 + + + + + +Node3 + + +inttypes.h + + + + + +Node1->Node3 + + + + + diff --git a/da/d35/problem__1_2sol1_8c.html b/da/d35/problem__1_2sol1_8c.html index 117011862..7966c9c9e 100644 --- a/da/d35/problem__1_2sol1_8c.html +++ b/da/d35/problem__1_2sol1_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_1/sol1.c 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,38 +92,80 @@ $(document).ready(function(){initNavTree('da/d35/problem__1_2sol1_8c.html','../.
-
-
sol1.c File Reference
+
sol1.c File Reference
-

Problem 1 solution +

Problem 1 solution More...

#include <stdio.h>
Include dependency graph for sol1.c:
-
+
- - - + +

+

Functions

-int main ()
 Main function.
int main ()
 Main function. More...
 

Detailed Description

-

Problem 1 solution

-

An Efficient code to print all the sum of all numbers that are multiples of 3 & 5 below N.

-
+

Problem 1 solution

+

An Efficient code to print all the sum of all numbers that are multiples of 3 & 5 below N.

+

Function Documentation

+ +

◆ main()

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

Main function.

+
13{
+
14 int t;
+
15 printf("Enter number of times you want to try");
+
16 scanf("%d", &t);
+
17 while (t--) // while t > 0, decrement 't' before every iteration
+
18 {
+
19 unsigned long long N, p = 0, sum = 0;
+
20 printf("Enter the value of N ");
+
21
+
22 scanf("%lld", &N); // Take input of N from user
+
23 p = (N - 1) / 3;
+
24 sum = ((3 * p * (p + 1)) / 2);
+
25
+
26 p = (N - 1) / 5;
+
27 sum = sum + ((5 * p * (p + 1)) / 2);
+
28
+
29 p = (N - 1) / 15;
+
30 sum = sum - ((15 * p * (p + 1)) / 2);
+
31 printf("%lld\n", sum); // print the sum of all numbers that are
+
32 // multiples of 3 & 5 below N
+
33 }
+
34 return 0;
+
35}
+
+
+
+
diff --git a/da/d38/durand__kerner__roots_8c.html b/da/d38/durand__kerner__roots_8c.html index 85c79f3ba..6e4a85c0a 100644 --- a/da/d38/durand__kerner__roots_8c.html +++ b/da/d38/durand__kerner__roots_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: numerical_methods/durand_kerner_roots.c 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('da/d38/durand__kerner__roots_8c.html',
Macros | Functions
-
-
durand_kerner_roots.c File Reference
+
durand_kerner_roots.c File Reference
-

Compute all possible approximate roots of any given polynomial using Durand Kerner algorithm +

Compute all possible approximate roots of any given polynomial using Durand Kerner algorithm More...

#include <complex.h>
#include <limits.h>
@@ -114,21 +113,21 @@ Include dependency graph for durand_kerner_roots.c:
- - +

+

Macros

-#define ACCURACY   1e-10
+#define ACCURACY   1e-10
 maximum accuracy limit
 
- - - - + + + @@ -136,10 +135,10 @@ Functions

+

Functions

long double complex poly_function (long double *coeffs, unsigned int degree, long double complex x)
 Evaluate the value of a polynomial with given coefficients. More...
 
const char * complex_str (long double complex x)
 create a textual form of complex number More...
 
const char * complex_str (long double complex x)
 create a textual form of complex number More...
 
char check_termination (long double delta)
 check for termination condition More...
 
 

Detailed Description

-

Compute all possible approximate roots of any given polynomial using Durand Kerner algorithm

-
Author
Krishna Vedala
+

Compute all possible approximate roots of any given polynomial using Durand Kerner algorithm

+
Author
Krishna Vedala

Test the algorithm online: https://gist.github.com/kvedala/27f1b0b6502af935f6917673ec43bcd7

-

Try the highly unstable Wilkinson's polynomial:

./numerical_methods/durand_kerner_roots.c 1 -210 20615 -1256850 53327946
+

Try the highly unstable Wilkinson's polynomial:

./numerical_methods/durand_kerner_roots.c 1 -210 20615 -1256850 53327946
-1672280820 40171771630 -756111184500 11310276995381 -135585182899530
1307535010540395 -10142299865511450 63030812099294896 -311333643161390640
1206647803780373360 -3599979517947607200 8037811822645051776
@@ -151,7 +150,7 @@ iteration." style="pointer-events: none;" width="400" class="inline"/>

Function Documentation

- +

◆ check_termination()

@@ -177,25 +176,25 @@ approximations" style="pointer-events: none;" width="400" class="inline"/>

Returns
0 if termination not reached
1 if termination reached
-
84 {
-
85  static long double past_delta = INFINITY;
-
86  if (fabsl(past_delta - delta) <= ACCURACY || delta < ACCURACY)
-
87  return 1;
-
88  past_delta = delta;
-
89  return 0;
-
90 }
+
84{
+
85 static long double past_delta = INFINITY;
+
86 if (fabsl(past_delta - delta) <= ACCURACY || delta < ACCURACY)
+
87 return 1;
+
88 past_delta = delta;
+
89 return 0;
+
90}
#define ACCURACY
maximum accuracy limit
Definition: durand_kerner_roots.c:41
- -

◆ complex_str()

+ +

◆ complex_str()

- + @@ -212,19 +211,19 @@ approximations" style="pointer-events: none;" width="400" class="inline"/>

Returns
pointer to converted string
-
67 {
-
68  static char msg[50];
-
69  double r = creal(x);
-
70  double c = cimag(x);
-
71 
-
72  sprintf(msg, "% 7.04g%+7.04gj", r, c);
-
73 
-
74  return msg;
-
75 }
+
67{
+
68 static char msg[50];
+
69 double r = creal(x);
+
70 double c = cimag(x);
+
71
+
72 sprintf(msg, "% 7.04g%+7.04gj", r, c);
+
73
+
74 return msg;
+
75}
- +

◆ main()

@@ -249,179 +248,179 @@ approximations" style="pointer-events: none;" width="400" class="inline"/>

const char* complex_str const char * complex_str ( long double complex  x)
-

store intermediate values to a CSV file

-
96 {
-
97  long double *coeffs = NULL;
-
98  long double complex *s0 = NULL;
-
99  unsigned int degree = 0;
-
100  unsigned int n, i;
-
101 
-
102  if (argc < 2)
-
103  {
-
104  printf(
-
105  "Please pass the coefficients of the polynomial as commandline "
-
106  "arguments.\n");
-
107  return 0;
-
108  }
-
109 
-
110  degree = argc - 1; /* detected polynomial degree */
-
111  coeffs = (long double *)malloc(
-
112  degree * sizeof(long double)); /* store all input coefficients */
-
113  s0 = (long double complex *)malloc(
-
114  (degree - 1) *
-
115  sizeof(long double complex)); /* number of roots = degree-1 */
-
116 
-
117  /* initialize random seed: */
-
118  srand(time(NULL));
-
119 
-
120  if (!coeffs || !s0)
-
121  {
-
122  perror("Unable to allocate memory!");
-
123  if (coeffs)
-
124  free(coeffs);
-
125  if (s0)
-
126  free(s0);
-
127  return EXIT_FAILURE;
-
128  }
-
129 
-
130 #if defined(DEBUG) || !defined(NDEBUG)
-
131  /**
-
132  * store intermediate values to a CSV file
-
133  */
-
134  FILE *log_file = fopen("durand_kerner.log.csv", "wt");
-
135  if (!log_file)
-
136  {
-
137  perror("Unable to create a storage log file!");
-
138  free(coeffs);
-
139  free(s0);
-
140  return EXIT_FAILURE;
-
141  }
-
142  fprintf(log_file, "iter#,");
-
143 #endif
-
144 
-
145  printf("Computing the roots for:\n\t");
-
146  for (n = 0; n < degree; n++)
-
147  {
-
148  coeffs[n] = strtod(argv[n + 1], NULL);
-
149  if (n < degree - 1 && coeffs[n] != 0)
-
150  printf("(%Lg) x^%d + ", coeffs[n], degree - n - 1);
-
151  else if (coeffs[n] != 0)
-
152  printf("(%Lg) x^%d = 0\n", coeffs[n], degree - n - 1);
-
153 
-
154  double tmp;
-
155  if (n > 0)
-
156  coeffs[n] /= tmp; /* numerical errors less when the first
-
157  coefficient is "1" */
-
158  else
-
159  {
-
160  tmp = coeffs[0];
-
161  coeffs[0] = 1;
-
162  }
-
163 
-
164  /* initialize root approximations with random values */
-
165  if (n < degree - 1)
-
166  {
-
167  s0[n] = (long double)rand() + (long double)rand() * I;
-
168 #if defined(DEBUG) || !defined(NDEBUG)
-
169  fprintf(log_file, "root_%d,", n);
-
170 #endif
-
171  }
-
172  }
-
173 
-
174 #if defined(DEBUG) || !defined(NDEBUG)
-
175  fprintf(log_file, "avg. correction");
-
176  fprintf(log_file, "\n0,");
-
177  for (n = 0; n < degree - 1; n++)
-
178  fprintf(log_file, "%s,", complex_str(s0[n]));
-
179 #endif
-
180 
-
181  double tol_condition = 1;
-
182  unsigned long iter = 0;
-
183 
-
184  clock_t end_time, start_time = clock();
-
185  while (!check_termination(tol_condition) && iter < INT_MAX)
-
186  {
-
187  long double complex delta = 0;
-
188  tol_condition = 0;
-
189  iter++;
-
190 
-
191 #if defined(DEBUG) || !defined(NDEBUG)
-
192  fprintf(log_file, "\n%ld,", iter);
-
193 #endif
-
194 
-
195  for (n = 0; n < degree - 1; n++)
-
196  {
-
197  long double complex numerator =
-
198  poly_function(coeffs, degree, s0[n]);
-
199  long double complex denominator = 1.0;
-
200  for (i = 0; i < degree - 1; i++)
-
201  if (i != n)
-
202  denominator *= s0[n] - s0[i];
-
203 
-
204  delta = numerator / denominator;
-
205 
-
206  if (isnan(cabsl(delta)) || isinf(cabsl(delta)))
-
207  {
-
208  printf("\n\nOverflow/underrun error - got value = %Lg",
-
209  cabsl(delta));
-
210  goto end;
-
211  }
-
212 
-
213  s0[n] -= delta;
-
214 
-
215  tol_condition = fmaxl(tol_condition, fabsl(cabsl(delta)));
-
216 
-
217 #if defined(DEBUG) || !defined(NDEBUG)
-
218  fprintf(log_file, "%s,", complex_str(s0[n]));
-
219 #endif
-
220  }
-
221  // tol_condition /= (degree - 1);
-
222 
-
223 #if defined(DEBUG) || !defined(NDEBUG)
-
224  if (iter % 500 == 0)
-
225  {
-
226  printf("Iter: %lu\t", iter);
-
227  for (n = 0; n < degree - 1; n++) printf("\t%s", complex_str(s0[n]));
-
228  printf("\t\tabsolute average change: %.4g\n", tol_condition);
-
229  }
-
230 
-
231  fprintf(log_file, "%.4g", tol_condition);
-
232 #endif
-
233  }
-
234 end:
-
235 
-
236  end_time = clock();
-
237 
-
238 #if defined(DEBUG) || !defined(NDEBUG)
-
239  fclose(log_file);
-
240 #endif
-
241 
-
242  printf("\nIterations: %lu\n", iter);
-
243  for (n = 0; n < degree - 1; n++) printf("\t%s\n", complex_str(s0[n]));
-
244  printf("absolute average change: %.4g\n", tol_condition);
-
245  printf("Time taken: %.4g sec\n",
-
246  (end_time - start_time) / (double)CLOCKS_PER_SEC);
-
247 
-
248  free(coeffs);
-
249  free(s0);
-
250 
-
251  return 0;
-
252 }
+

store intermediate values to a CSV file

+
96{
+
97 long double *coeffs = NULL;
+
98 long double complex *s0 = NULL;
+
99 unsigned int degree = 0;
+
100 unsigned int n, i;
+
101
+
102 if (argc < 2)
+
103 {
+
104 printf(
+
105 "Please pass the coefficients of the polynomial as commandline "
+
106 "arguments.\n");
+
107 return 0;
+
108 }
+
109
+
110 degree = argc - 1; /* detected polynomial degree */
+
111 coeffs = (long double *)malloc(
+
112 degree * sizeof(long double)); /* store all input coefficients */
+
113 s0 = (long double complex *)malloc(
+
114 (degree - 1) *
+
115 sizeof(long double complex)); /* number of roots = degree-1 */
+
116
+
117 /* initialize random seed: */
+
118 srand(time(NULL));
+
119
+
120 if (!coeffs || !s0)
+
121 {
+
122 perror("Unable to allocate memory!");
+
123 if (coeffs)
+
124 free(coeffs);
+
125 if (s0)
+
126 free(s0);
+
127 return EXIT_FAILURE;
+
128 }
+
129
+
130#if defined(DEBUG) || !defined(NDEBUG)
+
131 /**
+
132 * store intermediate values to a CSV file
+
133 */
+
134 FILE *log_file = fopen("durand_kerner.log.csv", "wt");
+
135 if (!log_file)
+
136 {
+
137 perror("Unable to create a storage log file!");
+
138 free(coeffs);
+
139 free(s0);
+
140 return EXIT_FAILURE;
+
141 }
+
142 fprintf(log_file, "iter#,");
+
143#endif
+
144
+
145 printf("Computing the roots for:\n\t");
+
146 for (n = 0; n < degree; n++)
+
147 {
+
148 coeffs[n] = strtod(argv[n + 1], NULL);
+
149 if (n < degree - 1 && coeffs[n] != 0)
+
150 printf("(%Lg) x^%d + ", coeffs[n], degree - n - 1);
+
151 else if (coeffs[n] != 0)
+
152 printf("(%Lg) x^%d = 0\n", coeffs[n], degree - n - 1);
+
153
+
154 double tmp;
+
155 if (n > 0)
+
156 coeffs[n] /= tmp; /* numerical errors less when the first
+
157 coefficient is "1" */
+
158 else
+
159 {
+
160 tmp = coeffs[0];
+
161 coeffs[0] = 1;
+
162 }
+
163
+
164 /* initialize root approximations with random values */
+
165 if (n < degree - 1)
+
166 {
+
167 s0[n] = (long double)rand() + (long double)rand() * I;
+
168#if defined(DEBUG) || !defined(NDEBUG)
+
169 fprintf(log_file, "root_%d,", n);
+
170#endif
+
171 }
+
172 }
+
173
+
174#if defined(DEBUG) || !defined(NDEBUG)
+
175 fprintf(log_file, "avg. correction");
+
176 fprintf(log_file, "\n0,");
+
177 for (n = 0; n < degree - 1; n++)
+
178 fprintf(log_file, "%s,", complex_str(s0[n]));
+
179#endif
+
180
+
181 double tol_condition = 1;
+
182 unsigned long iter = 0;
+
183
+
184 clock_t end_time, start_time = clock();
+
185 while (!check_termination(tol_condition) && iter < INT_MAX)
+
186 {
+
187 long double complex delta = 0;
+
188 tol_condition = 0;
+
189 iter++;
+
190
+
191#if defined(DEBUG) || !defined(NDEBUG)
+
192 fprintf(log_file, "\n%ld,", iter);
+
193#endif
+
194
+
195 for (n = 0; n < degree - 1; n++)
+
196 {
+
197 long double complex numerator =
+
198 poly_function(coeffs, degree, s0[n]);
+
199 long double complex denominator = 1.0;
+
200 for (i = 0; i < degree - 1; i++)
+
201 if (i != n)
+
202 denominator *= s0[n] - s0[i];
+
203
+
204 delta = numerator / denominator;
+
205
+
206 if (isnan(cabsl(delta)) || isinf(cabsl(delta)))
+
207 {
+
208 printf("\n\nOverflow/underrun error - got value = %Lg",
+
209 cabsl(delta));
+
210 goto end;
+
211 }
+
212
+
213 s0[n] -= delta;
+
214
+
215 tol_condition = fmaxl(tol_condition, fabsl(cabsl(delta)));
+
216
+
217#if defined(DEBUG) || !defined(NDEBUG)
+
218 fprintf(log_file, "%s,", complex_str(s0[n]));
+
219#endif
+
220 }
+
221 // tol_condition /= (degree - 1);
+
222
+
223#if defined(DEBUG) || !defined(NDEBUG)
+
224 if (iter % 500 == 0)
+
225 {
+
226 printf("Iter: %lu\t", iter);
+
227 for (n = 0; n < degree - 1; n++) printf("\t%s", complex_str(s0[n]));
+
228 printf("\t\tabsolute average change: %.4g\n", tol_condition);
+
229 }
+
230
+
231 fprintf(log_file, "%.4g", tol_condition);
+
232#endif
+
233 }
+
234end:
+
235
+
236 end_time = clock();
+
237
+
238#if defined(DEBUG) || !defined(NDEBUG)
+
239 fclose(log_file);
+
240#endif
+
241
+
242 printf("\nIterations: %lu\n", iter);
+
243 for (n = 0; n < degree - 1; n++) printf("\t%s\n", complex_str(s0[n]));
+
244 printf("absolute average change: %.4g\n", tol_condition);
+
245 printf("Time taken: %.4g sec\n",
+
246 (end_time - start_time) / (double)CLOCKS_PER_SEC);
+
247
+
248 free(coeffs);
+
249 free(s0);
+
250
+
251 return 0;
+
252}
char check_termination(long double delta)
check for termination condition
Definition: durand_kerner_roots.c:83
long double complex poly_function(long double *coeffs, unsigned int degree, long double complex x)
Evaluate the value of a polynomial with given coefficients.
Definition: durand_kerner_roots.c:50
-
const char * complex_str(long double complex x)
create a textual form of complex number
Definition: durand_kerner_roots.c:66
+
const char * complex_str(long double complex x)
create a textual form of complex number
Definition: durand_kerner_roots.c:66
#define malloc(bytes)
This macro replace the standard malloc function with malloc_dbg.
Definition: malloc_dbg.h:18
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
Here is the call graph for this function:
-
+
- +

◆ poly_function()

@@ -463,14 +462,14 @@ Here is the call graph for this function:
Returns
\(f(x)\)
-
52 {
-
53  long double complex out = 0.;
-
54  unsigned int n;
-
55 
-
56  for (n = 0; n < degree; n++) out += coeffs[n] * cpow(x, degree - n - 1);
-
57 
-
58  return out;
-
59 }
+
52{
+
53 long double complex out = 0.;
+
54 unsigned int n;
+
55
+
56 for (n = 0; n < degree; n++) out += coeffs[n] * cpow(x, degree - n - 1);
+
57
+
58 return out;
+
59}
@@ -480,7 +479,7 @@ Here is the call graph for this function:
diff --git a/da/d38/durand__kerner__roots_8c.js b/da/d38/durand__kerner__roots_8c.js index 6e07f2b0f..c8e0e30af 100644 --- a/da/d38/durand__kerner__roots_8c.js +++ b/da/d38/durand__kerner__roots_8c.js @@ -2,7 +2,7 @@ var durand__kerner__roots_8c = [ [ "ACCURACY", "da/d38/durand__kerner__roots_8c.html#af270a96662132d0385cb6b4637c5a689", null ], [ "check_termination", "da/d38/durand__kerner__roots_8c.html#a26d5695ebed0818a3e7cf4b10aacab52", null ], - [ "complex_str", "da/d38/durand__kerner__roots_8c.html#afa5b04ce11475d67049cba8273741fb7", null ], + [ "complex_str", "da/d38/durand__kerner__roots_8c.html#a46197e91f478e99a2229562aaaac311e", null ], [ "main", "da/d38/durand__kerner__roots_8c.html#a3c04138a5bfe5d72780bb7e82a18e627", null ], [ "poly_function", "da/d38/durand__kerner__roots_8c.html#a321f9781a9744ccdaf0aba89f35ec29c", null ] ]; \ No newline at end of file diff --git a/da/d38/durand__kerner__roots_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map b/da/d38/durand__kerner__roots_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map index b424a085c..d5671f0f3 100644 --- a/da/d38/durand__kerner__roots_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map +++ b/da/d38/durand__kerner__roots_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map @@ -1,6 +1,6 @@ - - - + + + diff --git a/da/d38/durand__kerner__roots_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 b/da/d38/durand__kerner__roots_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 index 46b6e3173..9b813fcf6 100644 --- a/da/d38/durand__kerner__roots_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 +++ b/da/d38/durand__kerner__roots_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 @@ -1 +1 @@ -bc9b81851cf25e8c6f3a27e95f35f3bc \ No newline at end of file +40f5eeee98adb89dda486af7ec6c12ef \ No newline at end of file diff --git a/da/d38/durand__kerner__roots_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg b/da/d38/durand__kerner__roots_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg index a1e886997..5663f823f 100644 --- a/da/d38/durand__kerner__roots_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg +++ b/da/d38/durand__kerner__roots_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg @@ -1,14 +1,14 @@ - - + main - + Node1 @@ -22,46 +22,46 @@ Node2 - -check_termination + +check_termination Node1->Node2 - - + + Node3 - - -complex_str + + +complex_str Node1->Node3 - - + + Node4 - -poly_function + +poly_function Node1->Node4 - - + + diff --git a/da/d56/problem__1_2sol3_8c.html b/da/d56/problem__1_2sol3_8c.html index 983e9ad50..2ab027e70 100644 --- a/da/d56/problem__1_2sol3_8c.html +++ b/da/d56/problem__1_2sol3_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_1/sol3.c 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,39 +92,99 @@ $(document).ready(function(){initNavTree('da/d56/problem__1_2sol3_8c.html','../.
-
-
sol3.c File Reference
+
sol3.c File Reference
-

Problem 1 solution. +

Problem 1 solution. More...

#include <stdio.h>
Include dependency graph for sol3.c:
-
+
- - - + +

+

Functions

-int main ()
 Main function.
int main ()
 Main function. More...
 

Detailed Description

-

Problem 1 solution.

-

This solution is based on the pattern that the successive numbers in the series follow: 0+3,+2,+1,+3,+1,+2,+3.

-

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3,5,6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below N.

-
+

Problem 1 solution.

+

This solution is based on the pattern that the successive numbers in the series follow: 0+3,+2,+1,+3,+1,+2,+3.

+

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3,5,6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below N.

+

Function Documentation

+ +

◆ main()

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

Main function.

+
15{
+
16 int n = 0;
+
17 int sum = 0;
+
18 int num = 0;
+
19 scanf("%d", &n);
+
20
+
21 while (1)
+
22 {
+
23 num += 3;
+
24 if (num >= n)
+
25 break;
+
26 sum += num;
+
27 num += 2;
+
28 if (num >= n)
+
29 break;
+
30 sum += num;
+
31 num += 1;
+
32 if (num >= n)
+
33 break;
+
34 sum += num;
+
35 num += 3;
+
36 if (num >= n)
+
37 break;
+
38 sum += num;
+
39 num += 1;
+
40 if (num >= n)
+
41 break;
+
42 sum += num;
+
43 num += 2;
+
44 if (num >= n)
+
45 break;
+
46 sum += num;
+
47 num += 3;
+
48 if (num >= n)
+
49 break;
+
50 sum += num;
+
51 }
+
52
+
53 printf("%d\n", sum);
+
54 return 0;
+
55}
+
+
+
+
diff --git a/da/d6c/exponential__search_8c.html b/da/d6c/exponential__search_8c.html new file mode 100644 index 000000000..a47a05461 --- /dev/null +++ b/da/d6c/exponential__search_8c.html @@ -0,0 +1,387 @@ + + + + + + + +Algorithms_in_C: searching/exponential_search.c File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Algorithms_in_C 1.0.0 +
+
Set of algorithms implemented in C.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
exponential_search.c File Reference
+
+
+ +

Exponential Search +More...

+
#include <assert.h>
+#include <inttypes.h>
+
+Include dependency graph for exponential_search.c:
+
+
+
+
+
+ + + + +

+Macros

+#define ELEMENT   -10
 for assert for int64_t, uint16_t
 
+ + + + + + + + + + + + + +

+Functions

int64_t binary_search (const int64_t *arr, const uint16_t l_index, const uint16_t r_index, const int64_t n)
 used to perform the binary search over the given array More...
 
int64_t exponential_search (const int64_t *arr, const uint16_t length, const int64_t n)
 used to perform the exponential search over the given array More...
 
static void test ()
 used to run the self-test implementations More...
 
int main ()
 Main function. More...
 
+

Detailed Description

+

Function Documentation

+ +

◆ binary_search()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int64_t binary_search (const int64_t * arr,
const uint16_t l_index,
const uint16_t r_index,
const int64_t n 
)
+
+ +

used to perform the binary search over the given array

+

Function: binary_search.

+

algorithm that search the index of the given item

+

recursive function that search the given element in

+

+the array using the <a href="https://github.com/TheAlgorithms/Algorithms-Explanation/blob/master/en/Search%20Algorithms/Binary%20Search.md" target="_blank" >Binary Search</a>

+
Parameters
+ + + + + +
arrarray where search the element
l_indexstart index of the array (arr) to apply the algorithm
r_indexend index of the array (arr) to apply the algorithm
nelement to find in the array (arr)
+
+
+
Returns
the index of the element (n) in the array (arr)
+
+-1 if the n element wasn't found
+
56{
+
57 // calculate the middle index of the array
+
58 uint16_t middle_index = l_index + ( r_index - l_index ) / 2;
+
59 // base cases
+
60 if ( l_index > r_index ) { return -1; }
+
61 if ( arr[middle_index] == n ) { return middle_index; }
+
62 // recursion
+
63 if ( arr[middle_index] > n ) { return binary_search(arr, l_index, middle_index-1, n); } // left
+
64 return binary_search(arr, middle_index+1, r_index, n); // right
+
65}
+
int64_t binary_search(const int64_t *arr, const uint16_t l_index, const uint16_t r_index, const int64_t n)
used to perform the binary search over the given array
Definition: exponential_search.c:55
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ exponential_search()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int64_t exponential_search (const int64_t * arr,
const uint16_t length,
const int64_t n 
)
+
+ +

used to perform the exponential search over the given array

+

Function: exponential_search.

+

algorithm that search the index of the given item

+

recursive function that take an array and quickly find the range

+

+where to apply the binary search algorithm to find the given element

+
Parameters
+ + + + +
arrarray where search the element
lengththe total length of the given array (arr)
nelement to find in the array (arr)
+
+
+
Returns
the index of the element (n) in the array (arr)
+
+-1 if the element wasn't found
+
29{
+
30 if ( length == 0 ) { return -1; }
+
31 // find the upperbound
+
32 uint32_t upper_bound = 1;
+
33 while ( upper_bound <= length && arr[upper_bound] < n ) { upper_bound = upper_bound * 2; }
+
34 // calculate the range ( between lower_boud and upper_bound )
+
35 uint16_t lower_bound = upper_bound/2;
+
36 if ( upper_bound > length ) { upper_bound = length; }
+
37 // apply the binary search in the range
+
38 return binary_search(arr, lower_bound, upper_bound, n);
+
39}
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ main()

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

Main function.

+
Returns
0 on exit
+
72{
+
73 test(); // run self-test implementations
+
74 return 0;
+
75}
+
static void test()
used to run the self-test implementations
Definition: exponential_search.c:81
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ test()

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

used to run the self-test implementations

+

Self-test implementations.

+
Returns
void
+
82{
+
83 // empty array
+
84 int64_t arr_empty[] = {};
+
85 assert(exponential_search(arr_empty, 0, 10) == -1);
+
86 // elent not found
+
87 int64_t arr_found[] = {1, 2, 3};
+
88 assert(exponential_search(arr_found, 3, 10) == -1);
+
89 // element found in an array of length 1
+
90 int64_t arr_one[] = {1};
+
91 assert(exponential_search(arr_found, 1, 1) == 0);
+
92 // find the first element in an array of length 2
+
93 int64_t arr_first_2[] = {1, 2};
+
94 assert(exponential_search(arr_first_2, 2, 1) == 0);
+
95 // find the last element in an array of length 2
+
96 int64_t arr_last_2[] = {1, 2};
+
97 assert(exponential_search(arr_last_2, 2, 2) == 1);
+
98 // find the first element in an array of length n
+
99 int64_t arr_first_n[] = {-1, 2, 4, 6, 8};
+
100 assert(exponential_search(arr_first_n, 5, -1) == 0);
+
101 // find the last element in an array of length n
+
102 int64_t arr_last_n[] = {-1, 2, 4, 6, 8};
+
103 assert(exponential_search(arr_last_n, 5, 8) == 4);
+
104 // find an element in an array of length n
+
105 int64_t arr_middle[] = {-1, 2, 4, 6, 8};
+
106 assert(exponential_search(arr_middle, 5, 6) == 3);
+
107}
+
int64_t exponential_search(const int64_t *arr, const uint16_t length, const int64_t n)
used to perform the exponential search over the given array
Definition: exponential_search.c:28
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+
+
+ + + + diff --git a/da/d6c/exponential__search_8c.js b/da/d6c/exponential__search_8c.js new file mode 100644 index 000000000..21af599c1 --- /dev/null +++ b/da/d6c/exponential__search_8c.js @@ -0,0 +1,8 @@ +var exponential__search_8c = +[ + [ "ELEMENT", "da/d6c/exponential__search_8c.html#aa5e9be47d76a4e1865914bcb7a2a7479", null ], + [ "binary_search", "da/d6c/exponential__search_8c.html#aae97ef76c065e91c188f1f8c8076869a", null ], + [ "exponential_search", "da/d6c/exponential__search_8c.html#a82d4de0907b9601a376febf50955bacd", null ], + [ "main", "da/d6c/exponential__search_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], + [ "test", "da/d6c/exponential__search_8c.html#aa8dca7b867074164d5f45b0f3851269d", null ] +]; \ No newline at end of file diff --git a/da/d6c/exponential__search_8c_a82d4de0907b9601a376febf50955bacd_cgraph.map b/da/d6c/exponential__search_8c_a82d4de0907b9601a376febf50955bacd_cgraph.map new file mode 100644 index 000000000..d7cef28e9 --- /dev/null +++ b/da/d6c/exponential__search_8c_a82d4de0907b9601a376febf50955bacd_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/da/d6c/exponential__search_8c_a82d4de0907b9601a376febf50955bacd_cgraph.md5 b/da/d6c/exponential__search_8c_a82d4de0907b9601a376febf50955bacd_cgraph.md5 new file mode 100644 index 000000000..9ec39e326 --- /dev/null +++ b/da/d6c/exponential__search_8c_a82d4de0907b9601a376febf50955bacd_cgraph.md5 @@ -0,0 +1 @@ +8f4106a783eec802fcf90db4fc52ece9 \ No newline at end of file diff --git a/da/d6c/exponential__search_8c_a82d4de0907b9601a376febf50955bacd_cgraph.svg b/da/d6c/exponential__search_8c_a82d4de0907b9601a376febf50955bacd_cgraph.svg new file mode 100644 index 000000000..5c1811a8a --- /dev/null +++ b/da/d6c/exponential__search_8c_a82d4de0907b9601a376febf50955bacd_cgraph.svg @@ -0,0 +1,43 @@ + + + + + + +exponential_search + + + +Node1 + + +exponential_search + + + + + +Node2 + + +binary_search + + + + + +Node1->Node2 + + + + + +Node2->Node2 + + + + + diff --git a/da/d6c/exponential__search_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map b/da/d6c/exponential__search_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map new file mode 100644 index 000000000..773e7f4c5 --- /dev/null +++ b/da/d6c/exponential__search_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/da/d6c/exponential__search_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 b/da/d6c/exponential__search_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 new file mode 100644 index 000000000..d402daf63 --- /dev/null +++ b/da/d6c/exponential__search_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 @@ -0,0 +1 @@ +75c041a03e507460f9b1c6832bc62b45 \ No newline at end of file diff --git a/da/d6c/exponential__search_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/da/d6c/exponential__search_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg new file mode 100644 index 000000000..b0d269ae2 --- /dev/null +++ b/da/d6c/exponential__search_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg @@ -0,0 +1,58 @@ + + + + + + +test + + + +Node1 + + +test + + + + + +Node2 + + +exponential_search + + + + + +Node1->Node2 + + + + + +Node3 + + +binary_search + + + + + +Node2->Node3 + + + + + +Node3->Node3 + + + + + diff --git a/da/d6c/exponential__search_8c_aae97ef76c065e91c188f1f8c8076869a_cgraph.map b/da/d6c/exponential__search_8c_aae97ef76c065e91c188f1f8c8076869a_cgraph.map new file mode 100644 index 000000000..eb67fc9da --- /dev/null +++ b/da/d6c/exponential__search_8c_aae97ef76c065e91c188f1f8c8076869a_cgraph.map @@ -0,0 +1,3 @@ + + + diff --git a/da/d6c/exponential__search_8c_aae97ef76c065e91c188f1f8c8076869a_cgraph.md5 b/da/d6c/exponential__search_8c_aae97ef76c065e91c188f1f8c8076869a_cgraph.md5 new file mode 100644 index 000000000..c9638be21 --- /dev/null +++ b/da/d6c/exponential__search_8c_aae97ef76c065e91c188f1f8c8076869a_cgraph.md5 @@ -0,0 +1 @@ +11cb76f6b94fb0bc5b7b25e70b106fdf \ No newline at end of file diff --git a/da/d6c/exponential__search_8c_aae97ef76c065e91c188f1f8c8076869a_cgraph.svg b/da/d6c/exponential__search_8c_aae97ef76c065e91c188f1f8c8076869a_cgraph.svg new file mode 100644 index 000000000..f0075a27c --- /dev/null +++ b/da/d6c/exponential__search_8c_aae97ef76c065e91c188f1f8c8076869a_cgraph.svg @@ -0,0 +1,28 @@ + + + + + + +binary_search + + + +Node1 + + +binary_search + + + + + +Node1->Node1 + + + + + diff --git a/da/d6c/exponential__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/da/d6c/exponential__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..d4b0e69ab --- /dev/null +++ b/da/d6c/exponential__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/da/d6c/exponential__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/da/d6c/exponential__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..72dca97c5 --- /dev/null +++ b/da/d6c/exponential__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +87d752653bf615c429c64de3b8843f93 \ No newline at end of file diff --git a/da/d6c/exponential__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/da/d6c/exponential__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..03cd24d6b --- /dev/null +++ b/da/d6c/exponential__search_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,73 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +test + + + + + +Node1->Node2 + + + + + +Node3 + + +exponential_search + + + + + +Node2->Node3 + + + + + +Node4 + + +binary_search + + + + + +Node3->Node4 + + + + + +Node4->Node4 + + + + + diff --git a/da/d81/prime_8c__incl.map b/da/d81/prime_8c__incl.map index afe8b54fc..7fc345ef7 100644 --- a/da/d81/prime_8c__incl.map +++ b/da/d81/prime_8c__incl.map @@ -2,6 +2,6 @@ - - + +
diff --git a/da/d81/prime_8c__incl.svg b/da/d81/prime_8c__incl.svg index c8d134200..dbd87191a 100644 --- a/da/d81/prime_8c__incl.svg +++ b/da/d81/prime_8c__incl.svg @@ -1,14 +1,14 @@ - - + misc/prime.c - + Node1 @@ -52,7 +52,7 @@ Node4 - + stdbool.h @@ -67,16 +67,16 @@ Node5 - -stdio.h + +stdio.h Node1->Node5 - - + + diff --git a/da/d90/stack__linked__list_2stack_8h_source.html b/da/d90/stack__linked__list_2stack_8h_source.html index 31e19ced1..8ef6882aa 100644 --- a/da/d90/stack__linked__list_2stack_8h_source.html +++ b/da/d90/stack__linked__list_2stack_8h_source.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: data_structures/stack/stack_linked_list/stack.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,25 +90,24 @@ $(document).ready(function(){initNavTree('da/d90/stack__linked__list_2stack_8h_s
-
-
stack.h
+
stack.h
-
1 #ifndef __STACK__
-
2 #define __STACK__
-
3 
-
4 #define T Stack_T
-
5 typedef struct T *T;
-
6 
-
7 extern T Stack_init(void);
-
8 extern int Stack_size(T stack);
-
9 extern int Stack_empty(T stack);
-
10 extern void Stack_push(T stack, void *val);
-
11 extern void *Stack_pop(T stack);
-
12 extern void Stack_print(T stack);
-
13 
-
14 #undef T
-
15 #endif
+
1#ifndef __STACK__
+
2#define __STACK__
+
3
+
4#define T Stack_T
+
5typedef struct T *T;
+
6
+
7extern T Stack_init(void);
+
8extern int Stack_size(T stack);
+
9extern int Stack_empty(T stack);
+
10extern void Stack_push(T stack, void *val);
+
11extern void *Stack_pop(T stack);
+
12extern void Stack_print(T stack);
+
13
+
14#undef T
+
15#endif
Definition: stack.c:16
@@ -116,7 +115,7 @@ $(document).ready(function(){initNavTree('da/d90/stack__linked__list_2stack_8h_s diff --git a/da/d93/prime_8c.html b/da/d93/prime_8c.html index 291c7d9aa..19d28413a 100644 --- a/da/d93/prime_8c.html +++ b/da/d93/prime_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: misc/prime.c 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('da/d93/prime_8c.html','../../'); initR
Functions
-
-
prime.c File Reference
+
prime.c File Reference
-

Program to identify if a number is prime number or not. +

Program to identify if a number is prime number or not. More...

#include <assert.h>
#include <math.h>
@@ -106,11 +105,11 @@ $(document).ready(function(){initNavTree('da/d93/prime_8c.html','../../'); initR
Include dependency graph for prime.c:
-
+
- @@ -123,9 +122,9 @@ Functions

+

Functions

bool isPrime (int x)
 Check if a given number is prime number or not. More...
 

Detailed Description

-

Program to identify if a number is prime number or not.

+

Program to identify if a number is prime number or not.

Function Documentation

- +

◆ isPrime()

@@ -149,31 +148,31 @@ Functions
Returns
true if given number is prime number, otherwise false
-
17 {
-
18  if (x == 2)
-
19  {
-
20  return true;
-
21  }
-
22  if (x < 2 || x % 2 == 0)
-
23  {
-
24  return false;
-
25  }
-
26 
-
27  double squareRoot = sqrt(x);
-
28 
-
29  for (int i = 3; i <= squareRoot; i += 2)
-
30  {
-
31  if (x % i == 0)
-
32  {
-
33  return false;
-
34  }
-
35  }
-
36  return true;
-
37 }
+
17{
+
18 if (x == 2)
+
19 {
+
20 return true;
+
21 }
+
22 if (x < 2 || x % 2 == 0)
+
23 {
+
24 return false;
+
25 }
+
26
+
27 double squareRoot = sqrt(x);
+
28
+
29 for (int i = 3; i <= squareRoot; i += 2)
+
30 {
+
31 if (x % i == 0)
+
32 {
+
33 return false;
+
34 }
+
35 }
+
36 return true;
+
37}
- +

◆ main()

@@ -191,10 +190,10 @@ Functions

Driver Code.

Returns
None
-
68 {
-
69  test();
-
70  return 0;
-
71 }
+
68{
+
69 test();
+
70 return 0;
+
71}
void test()
Test function.
Definition: prime.c:43
Here is the call graph for this function:
@@ -205,7 +204,7 @@ Here is the call graph for this function:
- +

◆ test()

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

Test function.

Returns
void
-
44 {
-
45  /* all the prime numbers less than 100 */
-
46  int primers[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41,
-
47  43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97};
-
48  for (size_t i = 0, size = sizeof(primers) / sizeof(primers[0]); i < size;
-
49  ++i)
-
50  {
-
51  assert(isPrime(primers[i]));
-
52  }
-
53 
-
54  /* Example Non-prime numbers */
-
55  int NonPrimers[] = {-1, 0, 1, 4, 6, 8, 9, 10};
-
56  for (size_t i = 0, size = sizeof(NonPrimers) / sizeof(NonPrimers[0]);
-
57  i < size; ++i)
-
58  {
-
59  assert(!isPrime(NonPrimers[i]));
-
60  }
-
61 }
+
44{
+
45 /* all the prime numbers less than 100 */
+
46 int primers[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41,
+
47 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97};
+
48 for (size_t i = 0, size = sizeof(primers) / sizeof(primers[0]); i < size;
+
49 ++i)
+
50 {
+
51 assert(isPrime(primers[i]));
+
52 }
+
53
+
54 /* Example Non-prime numbers */
+
55 int NonPrimers[] = {-1, 0, 1, 4, 6, 8, 9, 10};
+
56 for (size_t i = 0, size = sizeof(NonPrimers) / sizeof(NonPrimers[0]);
+
57 i < size; ++i)
+
58 {
+
59 assert(!isPrime(NonPrimers[i]));
+
60 }
+
61}
bool isPrime(int x)
Check if a given number is prime number or not.
Definition: prime.c:16
Here is the call graph for this function:
@@ -257,7 +256,7 @@ Here is the call graph for this function:
diff --git a/da/d93/prime_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg b/da/d93/prime_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg index 174bca932..03d131b46 100644 --- a/da/d93/prime_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg +++ b/da/d93/prime_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg @@ -1,7 +1,7 @@ - - + + + + + + +Algorithms_in_C: conversions/infix_to_postfix2.c File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Algorithms_in_C 1.0.0 +
+
Set of algorithms implemented in C.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
infix_to_postfix2.c File Reference
+
+
+ +

Infix to Postfix converter implementation +More...

+
#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <assert.h>
+
+Include dependency graph for infix_to_postfix2.c:
+
+
+
+
+
+ + + + +

+Data Structures

struct  Stack
 for printf() and scanf() More...
 
+ + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

void push (char opd)
 Function to push on the stack. More...
 
char pop ()
 Function to pop from the stack. More...
 
uint16_t isEmpty ()
 Function to check whether the stack is empty or not. More...
 
char Top ()
 Function to get top of the stack. More...
 
int16_t priority (char opr)
 Function to check priority of operators. More...
 
char * convert (char inf[])
 Function to convert infix expression to postfix expression. More...
 
static void test ()
 Self-test implementations. More...
 
int main ()
 Main function. More...
 
+ + + + +

+Variables

+struct Stack st
 global declaration of stack st
 
+

Detailed Description

+

Infix to Postfix converter implementation

+

The input infix expression is of type string upto 24 characters. Supported operations- '+', '-', '/', '*', ''

Author
Kumar Yash
+
See also
infix_to_postfix.c
+

Function Documentation

+ +

◆ convert()

+ +
+
+ + + + + + + + +
char * convert (char inf[])
+
+ +

Function to convert infix expression to postfix expression.

+
Parameters
+ + +
infthe input infix expression
+
+
+
Returns
output postfix expression
+

< to store the postfix expression

+

< loop iterator

+

< keeps track of end of postfix string

+
100 {
+
101 static char post[25]; ///< to store the postfix expression
+
102 int i; ///< loop iterator
+
103 int j = 0; ///< keeps track of end of postfix string
+
104 for(i = 0; i < strlen(inf); i++) {
+
105 if(isalnum(inf[i])) { // if scanned element is an alphabet or number
+
106 post[j] = inf[i]; // append in postfix expression
+
107 j++;
+
108 }
+
109 else if(inf[i] == '(') { // if scanned element is opening parentheses
+
110 push(inf[i]); // push on stack.
+
111 }
+
112 else if(inf[i] == ')') { // if scanned element is closing parentheses,
+
113 while(Top() != '(') { // pop elements from stack and append in postfix expression
+
114 post[j] = pop(); // until opening parentheses becomes top.
+
115 j++;
+
116 }
+
117 pop(); // pop opening parentheses
+
118 }
+
119 else { // if scanned element is an operator
+
120 while( (!isEmpty()) && (priority(inf[i]) <= priority(Top())) ) { // pop and append until stack becomes
+
121 post[j] = pop(); // empty or priority of top operator
+
122 j++; // becomes smaller than scanned operator
+
123 } // '(' has priority -1
+
124 push(inf[i]); // push the scanned operator
+
125 }
+
126 }
+
127 while(!isEmpty()) { // pop and append residual operators from stack
+
128 post[j] = pop();
+
129 j++;
+
130 }
+
131 post[j] = '\0'; // end postfix string with null character
+
132 return post;
+
133}
+
int16_t priority(char opr)
Function to check priority of operators.
Definition: infix_to_postfix2.c:83
+
char Top()
Function to get top of the stack.
Definition: infix_to_postfix2.c:72
+
char pop()
Function to pop from the stack.
Definition: infix_to_postfix2.c:45
+
uint16_t isEmpty()
Function to check whether the stack is empty or not.
Definition: infix_to_postfix2.c:61
+
void push(char opd)
Function to push on the stack.
Definition: infix_to_postfix2.c:32
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ isEmpty()

+ +
+
+ + + + + + + +
int isEmpty ()
+
+ +

Function to check whether the stack is empty or not.

+

Returns 1 if stack is empty, returns 0 if not empty.

+
Returns
1 if the stack IS empty
+
+0 if the stack is NOT empty
+
61 {
+
62 if(st.top == -1) {
+
63 return 1;
+
64 }
+
65 return 0;
+
66}
+
struct Stack st
global declaration of stack st
Definition: infix_to_postfix2.c:25
+
int top
stores index of the top element
Definition: infix_to_postfix2.c:23
+
+
+
+ +

◆ main()

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

Main function.

+
Returns
0 on exit
+

initialize

+

run self-test implementations

+

< to store input infix expression

+
156 {
+
157 st.top = -1; /// initialize
+
158 test(); /// run self-test implementations
+
159 char inf[25]; ///< to store input infix expression
+
160 printf("Enter infix: ");
+
161 scanf("%s", inf);
+
162 printf("Postfix: %s", convert(inf));
+
163 return 0;
+
164}
+
static void test()
Self-test implementations.
Definition: infix_to_postfix2.c:139
+
char * convert(char inf[])
Function to convert infix expression to postfix expression.
Definition: infix_to_postfix2.c:100
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ pop()

+ +
+
+ + + + + + + + +
void pop (void )
+
+ +

Function to pop from the stack.

+

Pop data from the stack.

+
Returns
popped character
+

< to store the popped value to be returned

+
45 {
+
46 char item; ///< to store the popped value to be returned
+
47 if(st.top == -1) { // underflow condition
+
48 printf("Stack underflow...");
+
49 exit(1);
+
50 }
+
51 item = st.stack[st.top];
+
52 st.top--;
+
53 return item;
+
54}
+
char stack[10]
array stack
Definition: infix_to_postfix2.c:22
+
+
+
+ +

◆ priority()

+ +
+
+ + + + + + + + +
int16_t priority (char opr)
+
+ +

Function to check priority of operators.

+
Parameters
+ + +
oproperator whose priority is to be checked
+
+
+
Returns
0 if operator is '+' or '-'
+
+1 if operator is '/' or '*' or ''
+
+-1 otherwise
+
83 {
+
84 if(opr == '+' || opr == '-') {
+
85 return 0;
+
86 }
+
87 else if(opr == '/' || opr == '*' || opr == '%') {
+
88 return 1;
+
89 }
+
90 else {
+
91 return -1;
+
92 }
+
93}
+
+
+
+ +

◆ push()

+ +
+
+ + + + + + + + +
void push (char opd)
+
+ +

Function to push on the stack.

+
Parameters
+ + +
opdcharacter to be pushed in the stack
+
+
+
Returns
void
+
32 {
+
33 if(st.top == 9) { // overflow condition
+
34 printf("Stack overflow...");
+
35 exit(1);
+
36 }
+
37 st.top++;
+
38 st.stack[st.top] = opd;
+
39}
+
+
+
+ +

◆ test()

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

Self-test implementations.

+
Returns
void
+

this ensures that the algorithm works as expected

+

this ensures that the algorithm works as expected

+
139 {
+
140 /* check sample test case
+
141 input- "(A/(B-C)*D+E)"
+
142 expected output- "ABC-/D*E+"
+
143 */
+
144 assert(strcmp(convert("(A/(B-C)*D+E)"), "ABC-/D*E+") == 0); /// this ensures that the algorithm works as expected
+
145 /* input- "7-(2*3+5)*(8-4/2)"
+
146 expected output- "723*5+842/-*-"
+
147 */
+
148 assert(strcmp(convert("7-(2*3+5)*(8-4/2)"), "723*5+842/-*-") == 0); /// this ensures that the algorithm works as expected
+
149 printf("All tests have successfully passed!\n");
+
150}
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ Top()

+ +
+
+ + + + + + + +
char Top ()
+
+ +

Function to get top of the stack.

+
Returns
top of stack
+
72 {
+
73 return st.stack[st.top];
+
74}
+
+
+
+
+
+ + + + diff --git a/da/d96/infix__to__postfix2_8c.js b/da/d96/infix__to__postfix2_8c.js new file mode 100644 index 000000000..6da33b011 --- /dev/null +++ b/da/d96/infix__to__postfix2_8c.js @@ -0,0 +1,13 @@ +var infix__to__postfix2_8c = +[ + [ "Stack", "dd/d10/struct_stack.html", "dd/d10/struct_stack" ], + [ "convert", "da/d96/infix__to__postfix2_8c.html#ae363a3863a8bfbf40e7a95c2b9dbe71b", null ], + [ "isEmpty", "da/d96/infix__to__postfix2_8c.html#a653c98c68c558505b75b04c44b7c838e", null ], + [ "main", "da/d96/infix__to__postfix2_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], + [ "pop", "da/d96/infix__to__postfix2_8c.html#a312e7f6c761a199c1369fbe651e084f0", null ], + [ "priority", "da/d96/infix__to__postfix2_8c.html#a02d1bf0ff997efc46ba6fd0ec7952952", null ], + [ "push", "da/d96/infix__to__postfix2_8c.html#a90e051f23f741be4f8ca86c270d66489", null ], + [ "test", "da/d96/infix__to__postfix2_8c.html#aa8dca7b867074164d5f45b0f3851269d", null ], + [ "Top", "da/d96/infix__to__postfix2_8c.html#a2d1c13296ce9c42bb5dd7d834e2802bf", null ], + [ "st", "da/d96/infix__to__postfix2_8c.html#a791cc5e78425bce611db4e3bdc4b19d5", null ] +]; \ No newline at end of file diff --git a/da/d96/infix__to__postfix2_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map b/da/d96/infix__to__postfix2_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map new file mode 100644 index 000000000..80d9f574c --- /dev/null +++ b/da/d96/infix__to__postfix2_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/da/d96/infix__to__postfix2_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 b/da/d96/infix__to__postfix2_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 new file mode 100644 index 000000000..e994fd43b --- /dev/null +++ b/da/d96/infix__to__postfix2_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 @@ -0,0 +1 @@ +b2a1d8e7d593dc43599ed3e468a3bc3f \ No newline at end of file diff --git a/da/d96/infix__to__postfix2_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/da/d96/infix__to__postfix2_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg new file mode 100644 index 000000000..21fe2f940 --- /dev/null +++ b/da/d96/infix__to__postfix2_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg @@ -0,0 +1,112 @@ + + + + + + +test + + + +Node1 + + +test + + + + + +Node2 + + +convert + + + + + +Node1->Node2 + + + + + +Node3 + + +isEmpty + + + + + +Node2->Node3 + + + + + +Node4 + + +pop + + + + + +Node2->Node4 + + + + + +Node5 + + +priority + + + + + +Node2->Node5 + + + + + +Node6 + + +push + + + + + +Node2->Node6 + + + + + +Node7 + + +Top + + + + + +Node2->Node7 + + + + + diff --git a/da/d96/infix__to__postfix2_8c_ae363a3863a8bfbf40e7a95c2b9dbe71b_cgraph.map b/da/d96/infix__to__postfix2_8c_ae363a3863a8bfbf40e7a95c2b9dbe71b_cgraph.map new file mode 100644 index 000000000..6c536c789 --- /dev/null +++ b/da/d96/infix__to__postfix2_8c_ae363a3863a8bfbf40e7a95c2b9dbe71b_cgraph.map @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/da/d96/infix__to__postfix2_8c_ae363a3863a8bfbf40e7a95c2b9dbe71b_cgraph.md5 b/da/d96/infix__to__postfix2_8c_ae363a3863a8bfbf40e7a95c2b9dbe71b_cgraph.md5 new file mode 100644 index 000000000..5ddab368e --- /dev/null +++ b/da/d96/infix__to__postfix2_8c_ae363a3863a8bfbf40e7a95c2b9dbe71b_cgraph.md5 @@ -0,0 +1 @@ +9db09ac9da341856526d07885dd4416f \ No newline at end of file diff --git a/da/d96/infix__to__postfix2_8c_ae363a3863a8bfbf40e7a95c2b9dbe71b_cgraph.svg b/da/d96/infix__to__postfix2_8c_ae363a3863a8bfbf40e7a95c2b9dbe71b_cgraph.svg new file mode 100644 index 000000000..7dee47b92 --- /dev/null +++ b/da/d96/infix__to__postfix2_8c_ae363a3863a8bfbf40e7a95c2b9dbe71b_cgraph.svg @@ -0,0 +1,97 @@ + + + + + + +convert + + + +Node1 + + +convert + + + + + +Node2 + + +isEmpty + + + + + +Node1->Node2 + + + + + +Node3 + + +pop + + + + + +Node1->Node3 + + + + + +Node4 + + +priority + + + + + +Node1->Node4 + + + + + +Node5 + + +push + + + + + +Node1->Node5 + + + + + +Node6 + + +Top + + + + + +Node1->Node6 + + + + + diff --git a/da/d96/infix__to__postfix2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/da/d96/infix__to__postfix2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..301a78497 --- /dev/null +++ b/da/d96/infix__to__postfix2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/da/d96/infix__to__postfix2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/da/d96/infix__to__postfix2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..6070244b0 --- /dev/null +++ b/da/d96/infix__to__postfix2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +3c51e5e7bd733d1cc2a6b80ffdeaee64 \ No newline at end of file diff --git a/da/d96/infix__to__postfix2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/da/d96/infix__to__postfix2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..93dcee7f6 --- /dev/null +++ b/da/d96/infix__to__postfix2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,133 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +convert + + + + + +Node1->Node2 + + + + + +Node8 + + +test + + + + + +Node1->Node8 + + + + + +Node3 + + +isEmpty + + + + + +Node2->Node3 + + + + + +Node4 + + +pop + + + + + +Node2->Node4 + + + + + +Node5 + + +priority + + + + + +Node2->Node5 + + + + + +Node6 + + +push + + + + + +Node2->Node6 + + + + + +Node7 + + +Top + + + + + +Node2->Node7 + + + + + +Node8->Node2 + + + + + diff --git a/da/d9b/struct_trie_node.html b/da/d9b/struct_trie_node.html index 25f7dd0ca..5ca60253e 100644 --- a/da/d9b/struct_trie_node.html +++ b/da/d9b/struct_trie_node.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: 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() {
@@ -92,26 +92,25 @@ $(document).ready(function(){initNavTree('da/d9b/struct_trie_node.html','../../'
Data Fields
-
-
TrieNode Struct Reference
+
TrieNode Struct Reference
Collaboration diagram for TrieNode:
-
+
[legend]
- - - -

+

Data Fields

+
struct TrieNode * children [ALPHABET_SIZE]
 
+
char character
 
+
bool isEndOfWord
 
@@ -124,7 +123,7 @@ bool isEndOfWord< diff --git a/da/d9b/struct_trie_node.js b/da/d9b/struct_trie_node.js deleted file mode 100644 index df39e0cda..000000000 --- a/da/d9b/struct_trie_node.js +++ /dev/null @@ -1,6 +0,0 @@ -var struct_trie_node = -[ - [ "character", "da/d9b/struct_trie_node.html#a8e9e3ac8a47ed2f730476945933722c1", null ], - [ "children", "da/d9b/struct_trie_node.html#a9dc2a9bc247486fac3e4b350c73a3060", null ], - [ "isEndOfWord", "da/d9b/struct_trie_node.html#ab2732ce1e141346865d997859836d663", null ] -]; \ No newline at end of file diff --git a/da/da0/segment__tree_8c.html b/da/da0/segment__tree_8c.html index 9a4102869..83ec8fd51 100644 --- a/da/da0/segment__tree_8c.html +++ b/da/da0/segment__tree_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: data_structures/binary_trees/segment_tree.c 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('da/da0/segment__tree_8c.html','../../' Data Structures | Typedefs | Functions -
-
segment_tree.c File Reference
+
segment_tree.c File Reference
@@ -113,23 +112,23 @@ Include dependency graph for segment_tree.c:
-

+

Data Structures

struct  segment_tree
 This structures holds all the data that is required by a segment tree. More...
 
- - +

+

Typedefs

typedef void(* combine_function) (const void *a, const void *b, void *result)
 Function that combines two data to generate a new one The name of function might be misleading actually combine here signifies the fact that in segment trees we take partial result from two ranges and using partial results we derive the result for joint range of those two ranges For Example: array(1,2,3,4,5,6) sum of range [0,2] = 6 and sum of range [3,5] = 15 the combined sum of two range is 6+15=21. More...
 
-typedef struct segment_tree segment_tree
+typedef struct segment_tree segment_tree
 This structures holds all the data that is required by a segment tree.
 
- @@ -140,9 +139,9 @@ Functions - - - + + + @@ -160,10 +159,10 @@ Functions

+

Functions

void segment_tree_build (segment_tree *tree)
 Builds a Segment tree It is assumed that leaves of tree already contains data. More...
void segment_tree_query (segment_tree *tree, long long l, long long r, void *res)
 Query the segment tree This function helps in range query of segment tree This function assumes that the given range is valid Performs the query in range [l,r]. More...
 
segment_tree * segment_tree_init (void *arr, size_t elem_size, size_t len, void *identity, combine_function func)
 Initializes Segment Tree Accquires memory for segment tree and fill the leaves of segment tree with data from array. More...
 
segment_tree * segment_tree_init (void *arr, size_t elem_size, size_t len, void *identity, combine_function func)
 Initializes Segment Tree Accquires memory for segment tree and fill the leaves of segment tree with data from array. More...
 
void segment_tree_dispose (segment_tree *tree)
 Dispose Segment Tree Frees all heap memory accquired by segment tree. More...
 
 

Detailed Description

-

segment trees with only point updates

-

This code implements segment trees. Segment trees are general structures which allow range based queries in a given array in logN time. Segment tree with point updates allow update of single element in the array in logN time. Learn more about segment trees here

Author
Lakhan Nad
+

segment trees with only point updates

+

This code implements segment trees. Segment trees are general structures which allow range based queries in a given array in logN time. Segment tree with point updates allow update of single element in the array in logN time. Learn more about segment trees here

Author
Lakhan Nad

Typedef Documentation

- +

◆ combine_function

@@ -189,7 +188,7 @@ Functions

Function Documentation

- +

◆ main()

@@ -207,21 +206,21 @@ Functions

Main Function.

Returns
0 on exit
-
232 {
-
233  test();
-
234  return 0;
-
235 }
+
232{
+
233 test();
+
234 return 0;
+
235}
static void test()
Test RMQ Testing Segment tree using Range Minimum Queries.
Definition: segment_tree.c:205
Here is the call graph for this function:
-
+
- +

◆ minimum()

@@ -262,13 +261,13 @@ Here is the call graph for this function:
-
195 {
-
196  *(int *)c = *(int *)a < *(int *)b ? *(int *)a : *(int *)b;
-
197 }
+
195{
+
196 *(int *)c = *(int *)a < *(int *)b ? *(int *)a : *(int *)b;
+
197}
- +

◆ segment_tree_build()

@@ -291,19 +290,19 @@ Here is the call graph for this function:
-
56 {
-
57  size_t elem_size = tree->elem_size;
-
58  int index = (tree->length - 2);
-
59  size_t b, l, r;
-
60  char *ptr = (char *)tree->root;
-
61  for (; index >= 0; index--)
-
62  {
-
63  b = index * elem_size;
-
64  l = (2 * index + 1) * elem_size;
-
65  r = (2 * index + 2) * elem_size;
-
66  tree->combine(ptr + l, ptr + r, ptr + b);
-
67  }
-
68 }
+
56{
+
57 size_t elem_size = tree->elem_size;
+
58 int index = (tree->length - 2);
+
59 size_t b, l, r;
+
60 char *ptr = (char *)tree->root;
+
61 for (; index >= 0; index--)
+
62 {
+
63 b = index * elem_size;
+
64 l = (2 * index + 1) * elem_size;
+
65 r = (2 * index + 2) * elem_size;
+
66 tree->combine(ptr + l, ptr + r, ptr + b);
+
67 }
+
68}
size_t length
total size of array which segment tree represents
Definition: segment_tree.c:43
combine_function combine
the function to be used to combine two node's data to form parent's data
Definition: segment_tree.c:47
void * root
the root of formed segment tree
Definition: segment_tree.c:40
@@ -311,7 +310,7 @@ Here is the call graph for this function:
- +

◆ segment_tree_dispose()

@@ -334,23 +333,23 @@ Here is the call graph for this function:
-
163 {
-
164  free(tree->root);
-
165  free(tree->identity);
-
166 }
+
163{
+
164 free(tree->root);
+
165 free(tree->identity);
+
166}
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
void * identity
identity element for combine function
Definition: segment_tree.c:41
- -

◆ segment_tree_init()

+ +

◆ segment_tree_init()

- + @@ -399,33 +398,33 @@ Here is the call graph for this function:
Returns
pointer to sgement tree build
-
142 {
-
143  segment_tree *tree = malloc(sizeof(segment_tree));
-
144  tree->elem_size = elem_size;
-
145  tree->length = len;
-
146  tree->combine = func;
-
147  tree->root = malloc(sizeof(char) * elem_size * (2 * len - 1));
-
148  tree->identity = malloc(sizeof(char) * elem_size);
-
149  char *ptr = (char *)tree->root;
-
150  memset(ptr, 0, (len - 1) * elem_size); // Initializing memory
-
151  ptr = ptr + (len - 1) * elem_size;
-
152  memcpy(ptr, arr, elem_size * len); // copy the leaf nodes i.e. array data
-
153  memcpy(tree->identity, identity, elem_size); // copy identity element
-
154  return tree;
-
155 }
+
142{
+
143 segment_tree *tree = malloc(sizeof(segment_tree));
+
144 tree->elem_size = elem_size;
+
145 tree->length = len;
+
146 tree->combine = func;
+
147 tree->root = malloc(sizeof(char) * elem_size * (2 * len - 1));
+
148 tree->identity = malloc(sizeof(char) * elem_size);
+
149 char *ptr = (char *)tree->root;
+
150 memset(ptr, 0, (len - 1) * elem_size); // Initializing memory
+
151 ptr = ptr + (len - 1) * elem_size;
+
152 memcpy(ptr, arr, elem_size * len); // copy the leaf nodes i.e. array data
+
153 memcpy(tree->identity, identity, elem_size); // copy identity element
+
154 return tree;
+
155}
void func(int sockfd)
Continuous loop to send and receive over the socket.
Definition: client.c:37
#define malloc(bytes)
This macro replace the standard malloc function with malloc_dbg.
Definition: malloc_dbg.h:18
This structures holds all the data that is required by a segment tree.
Definition: segment_tree.c:39
Here is the call graph for this function:
-
+
- +

◆ segment_tree_print_int()

@@ -448,19 +447,19 @@ Here is the call graph for this function:
segment_tree* segment_tree_init segment_tree * segment_tree_init ( void *  arr,
-
176 {
-
177  char *base = (char *)tree->root;
-
178  size_t i = 0;
-
179  for (; i < 2 * tree->length - 1; i++)
-
180  {
-
181  printf("%d ", *(int *)(base + i * tree->elem_size));
-
182  }
-
183  printf("\n");
-
184 }
+
176{
+
177 char *base = (char *)tree->root;
+
178 size_t i = 0;
+
179 for (; i < 2 * tree->length - 1; i++)
+
180 {
+
181 printf("%d ", *(int *)(base + i * tree->elem_size));
+
182 }
+
183 printf("\n");
+
184}
- +

◆ segment_tree_query()

@@ -508,31 +507,31 @@ Here is the call graph for this function:
-
106 {
-
107  size_t elem_size = tree->elem_size;
-
108  memcpy(res, tree->identity, elem_size);
-
109  elem_size = tree->elem_size;
-
110  char *root = (char *)tree->root;
-
111  l += tree->length - 1;
-
112  r += tree->length - 1;
-
113  while (l <= r)
-
114  {
-
115  if (!(l & 1))
-
116  {
-
117  tree->combine(res, root + l * elem_size, res);
-
118  }
-
119  if (r & 1)
-
120  {
-
121  tree->combine(res, root + r * elem_size, res);
-
122  }
-
123  r = (r >> 1) - 1;
-
124  l = (l >> 1);
-
125  }
-
126 }
+
106{
+
107 size_t elem_size = tree->elem_size;
+
108 memcpy(res, tree->identity, elem_size);
+
109 elem_size = tree->elem_size;
+
110 char *root = (char *)tree->root;
+
111 l += tree->length - 1;
+
112 r += tree->length - 1;
+
113 while (l <= r)
+
114 {
+
115 if (!(l & 1))
+
116 {
+
117 tree->combine(res, root + l * elem_size, res);
+
118 }
+
119 if (r & 1)
+
120 {
+
121 tree->combine(res, root + r * elem_size, res);
+
122 }
+
123 r = (r >> 1) - 1;
+
124 l = (l >> 1);
+
125 }
+
126}
- +

◆ segment_tree_update()

@@ -573,24 +572,24 @@ Here is the call graph for this function:
-
80 {
-
81  size_t elem_size = tree->elem_size;
-
82  index = index + tree->length - 1;
-
83  char *base = (char *)tree->root;
-
84  char *t = base + index * elem_size;
-
85  memcpy(t, val, elem_size);
-
86  while (index > 0)
-
87  {
-
88  index = ((index - 1) >> 1);
-
89  tree->combine(base + (2 * index + 1) * elem_size,
-
90  base + (2 * index + 2) * elem_size,
-
91  base + index * elem_size);
-
92  }
-
93 }
+
80{
+
81 size_t elem_size = tree->elem_size;
+
82 index = index + tree->length - 1;
+
83 char *base = (char *)tree->root;
+
84 char *t = base + index * elem_size;
+
85 memcpy(t, val, elem_size);
+
86 while (index > 0)
+
87 {
+
88 index = ((index - 1) >> 1);
+
89 tree->combine(base + (2 * index + 1) * elem_size,
+
90 base + (2 * index + 2) * elem_size,
+
91 base + index * elem_size);
+
92 }
+
93}
- +

◆ test()

@@ -616,36 +615,36 @@ Here is the call graph for this function:

Test RMQ Testing Segment tree using Range Minimum Queries.

Returns
void
-
206 {
-
207  int32_t arr[10] = {1, 0, 3, 5, 7, 2, 11, 6, -2, 8};
-
208  int32_t identity = __INT32_MAX__;
-
209  segment_tree *tree =
-
210  segment_tree_init(arr, sizeof(*arr), 10, &identity, minimum);
-
211  segment_tree_build(tree);
-
212  int32_t result;
-
213  segment_tree_query(tree, 3, 6, &result);
-
214  assert(result == 2);
-
215  segment_tree_query(tree, 8, 9, &result);
-
216  assert(result == -2);
-
217  result = 12;
-
218  segment_tree_update(tree, 5, &result);
-
219  segment_tree_update(tree, 8, &result);
-
220  segment_tree_query(tree, 0, 3, &result);
-
221  assert(result == 0);
-
222  segment_tree_query(tree, 8, 9, &result);
-
223  assert(result == 8);
-
224  segment_tree_dispose(tree);
-
225 }
+
206{
+
207 int32_t arr[10] = {1, 0, 3, 5, 7, 2, 11, 6, -2, 8};
+
208 int32_t identity = __INT32_MAX__;
+
209 segment_tree *tree =
+
210 segment_tree_init(arr, sizeof(*arr), 10, &identity, minimum);
+
211 segment_tree_build(tree);
+
212 int32_t result;
+
213 segment_tree_query(tree, 3, 6, &result);
+
214 assert(result == 2);
+
215 segment_tree_query(tree, 8, 9, &result);
+
216 assert(result == -2);
+
217 result = 12;
+
218 segment_tree_update(tree, 5, &result);
+
219 segment_tree_update(tree, 8, &result);
+
220 segment_tree_query(tree, 0, 3, &result);
+
221 assert(result == 0);
+
222 segment_tree_query(tree, 8, 9, &result);
+
223 assert(result == 8);
+ +
225}
void segment_tree_update(segment_tree *tree, size_t index, void *val)
For point updates This function updates the element at given index and also updates segment tree acco...
Definition: segment_tree.c:79
+
segment_tree * segment_tree_init(void *arr, size_t elem_size, size_t len, void *identity, combine_function func)
Initializes Segment Tree Accquires memory for segment tree and fill the leaves of segment tree with d...
Definition: segment_tree.c:140
void minimum(const void *a, const void *b, void *c)
Utility for test A function compare for minimum between two integers This function is used as combine...
Definition: segment_tree.c:194
void segment_tree_build(segment_tree *tree)
Builds a Segment tree It is assumed that leaves of tree already contains data.
Definition: segment_tree.c:55
-
segment_tree * segment_tree_init(void *arr, size_t elem_size, size_t len, void *identity, combine_function func)
Initializes Segment Tree Accquires memory for segment tree and fill the leaves of segment tree with d...
Definition: segment_tree.c:140
void segment_tree_dispose(segment_tree *tree)
Dispose Segment Tree Frees all heap memory accquired by segment tree.
Definition: segment_tree.c:162
void segment_tree_query(segment_tree *tree, long long l, long long r, void *res)
Query the segment tree This function helps in range query of segment tree This function assumes that ...
Definition: segment_tree.c:105
Here is the call graph for this function:
-
+
@@ -657,7 +656,7 @@ Here is the call graph for this function:
diff --git a/da/da0/segment__tree_8c.js b/da/da0/segment__tree_8c.js index d7111806a..d77198010 100644 --- a/da/da0/segment__tree_8c.js +++ b/da/da0/segment__tree_8c.js @@ -7,7 +7,7 @@ var segment__tree_8c = [ "minimum", "da/da0/segment__tree_8c.html#a93bfab032ce9dbc0c1feaeee32a885fb", null ], [ "segment_tree_build", "da/da0/segment__tree_8c.html#aae59daf9a0dc33f8cbc7a525a616ee75", null ], [ "segment_tree_dispose", "da/da0/segment__tree_8c.html#af20a9f373083d3f701e1cd92560cef01", null ], - [ "segment_tree_init", "da/da0/segment__tree_8c.html#acecc34fd89923ab41dcee3a779622816", null ], + [ "segment_tree_init", "da/da0/segment__tree_8c.html#a3513a2b7c3f1d15aa3d019af1f834cde", null ], [ "segment_tree_print_int", "da/da0/segment__tree_8c.html#a776abfa81cde9016a2885dca7cfc05ab", null ], [ "segment_tree_query", "da/da0/segment__tree_8c.html#af61bd96660cb53f49f28d60a5f1d0c91", null ], [ "segment_tree_update", "da/da0/segment__tree_8c.html#a1e81a9bbf01716f1b4fb27ef36a9098c", null ], diff --git a/da/da0/segment__tree_8c_acecc34fd89923ab41dcee3a779622816_cgraph.map b/da/da0/segment__tree_8c_a3513a2b7c3f1d15aa3d019af1f834cde_cgraph.map similarity index 75% rename from da/da0/segment__tree_8c_acecc34fd89923ab41dcee3a779622816_cgraph.map rename to da/da0/segment__tree_8c_a3513a2b7c3f1d15aa3d019af1f834cde_cgraph.map index 91b939229..746cc17c7 100644 --- a/da/da0/segment__tree_8c_acecc34fd89923ab41dcee3a779622816_cgraph.map +++ b/da/da0/segment__tree_8c_a3513a2b7c3f1d15aa3d019af1f834cde_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/da/da0/segment__tree_8c_acecc34fd89923ab41dcee3a779622816_cgraph.md5 b/da/da0/segment__tree_8c_a3513a2b7c3f1d15aa3d019af1f834cde_cgraph.md5 similarity index 100% rename from da/da0/segment__tree_8c_acecc34fd89923ab41dcee3a779622816_cgraph.md5 rename to da/da0/segment__tree_8c_a3513a2b7c3f1d15aa3d019af1f834cde_cgraph.md5 diff --git a/da/da0/segment__tree_8c_acecc34fd89923ab41dcee3a779622816_cgraph.svg b/da/da0/segment__tree_8c_a3513a2b7c3f1d15aa3d019af1f834cde_cgraph.svg similarity index 61% rename from da/da0/segment__tree_8c_acecc34fd89923ab41dcee3a779622816_cgraph.svg rename to da/da0/segment__tree_8c_a3513a2b7c3f1d15aa3d019af1f834cde_cgraph.svg index 339caca9c..dbb61f245 100644 --- a/da/da0/segment__tree_8c_acecc34fd89923ab41dcee3a779622816_cgraph.svg +++ b/da/da0/segment__tree_8c_a3513a2b7c3f1d15aa3d019af1f834cde_cgraph.svg @@ -1,20 +1,20 @@ - - + segment_tree_init - + Node1 - -segment_tree_init + +segment_tree_init @@ -22,16 +22,16 @@ Node2 - -func + +func Node1->Node2 - - + + diff --git a/da/da0/segment__tree_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map b/da/da0/segment__tree_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map index b0d8c6d42..4e3cb3392 100644 --- a/da/da0/segment__tree_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map +++ b/da/da0/segment__tree_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map @@ -1,10 +1,10 @@ - - - - - - - + + + + + + + diff --git a/da/da0/segment__tree_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 b/da/da0/segment__tree_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 index 7844660da..081c8b2e2 100644 --- a/da/da0/segment__tree_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 +++ b/da/da0/segment__tree_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 @@ -1 +1 @@ -1c86120d378018b751c34c9d4c753d45 \ No newline at end of file +f8a2d51d2aed508aed401f32b038a6cc \ No newline at end of file diff --git a/da/da0/segment__tree_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/da/da0/segment__tree_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg index f17a990ef..54d92301a 100644 --- a/da/da0/segment__tree_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg +++ b/da/da0/segment__tree_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg @@ -1,14 +1,14 @@ - - + test - + Node1 @@ -22,106 +22,106 @@ Node2 - -minimum + +minimum Node1->Node2 - - + + Node3 - -segment_tree_build + +segment_tree_build Node1->Node3 - - + + Node4 - -segment_tree_dispose + +segment_tree_dispose Node1->Node4 - - + + Node5 - - -segment_tree_init + + +segment_tree_init Node1->Node5 - - + + Node7 - -segment_tree_query + +segment_tree_query Node1->Node7 - - + + Node8 - -segment_tree_update + +segment_tree_update Node1->Node8 - - + + Node6 - -func + +func Node5->Node6 - - + + diff --git a/da/da0/segment__tree_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/da/da0/segment__tree_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map index 818382996..6ef5aec34 100644 --- a/da/da0/segment__tree_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map +++ b/da/da0/segment__tree_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -1,11 +1,11 @@ - - - - - - - + + + + + + + diff --git a/da/da0/segment__tree_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/da/da0/segment__tree_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 index 323595ba3..a9f18653c 100644 --- a/da/da0/segment__tree_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 +++ b/da/da0/segment__tree_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -1 +1 @@ -70269bbf38df81cb7cc61e734ac5d492 \ No newline at end of file +2a8a4b767cbf45958cfd9e1db0d74aea \ No newline at end of file diff --git a/da/da0/segment__tree_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/da/da0/segment__tree_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index fc79d92a1..e229e2d8f 100644 --- a/da/da0/segment__tree_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/da/da0/segment__tree_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,14 +1,14 @@ - - + main - + Node1 @@ -37,106 +37,106 @@ Node3 - -minimum + +minimum Node2->Node3 - - + + Node4 - -segment_tree_build + +segment_tree_build Node2->Node4 - - + + Node5 - -segment_tree_dispose + +segment_tree_dispose Node2->Node5 - - + + Node6 - - -segment_tree_init + + +segment_tree_init Node2->Node6 - - + + Node8 - -segment_tree_query + +segment_tree_query Node2->Node8 - - + + Node9 - -segment_tree_update + +segment_tree_update Node2->Node9 - - + + Node7 - -func + +func Node6->Node7 - - + + diff --git a/da/dd5/spirograph_8c__incl.map b/da/dd5/spirograph_8c__incl.map index d8adefbf8..a1ac6e6c1 100644 --- a/da/dd5/spirograph_8c__incl.map +++ b/da/dd5/spirograph_8c__incl.map @@ -1,8 +1,8 @@ - + - - - - + + + + diff --git a/da/dd5/spirograph_8c__incl.svg b/da/dd5/spirograph_8c__incl.svg index 05064ffe5..d9069d6e5 100644 --- a/da/dd5/spirograph_8c__incl.svg +++ b/da/dd5/spirograph_8c__incl.svg @@ -1,20 +1,20 @@ - - + graphics/spirograph.c - + Node1 - -graphics/spirograph.c + +graphics/spirograph.c @@ -30,14 +30,14 @@ Node1->Node2 - - + + Node3 - + stdbool.h @@ -45,53 +45,53 @@ Node1->Node3 - - + + Node4 - -stdio.h + +stdio.h Node1->Node4 - - + + Node5 - -stdlib.h + +stdlib.h Node1->Node5 - - + + Node6 - -time.h + +time.h Node1->Node6 - - + + diff --git a/da/de2/shell__sort2_8c__incl.map b/da/de2/shell__sort2_8c__incl.map index ac8f2177c..63e10cce9 100644 --- a/da/de2/shell__sort2_8c__incl.map +++ b/da/de2/shell__sort2_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/da/de2/shell__sort2_8c__incl.svg b/da/de2/shell__sort2_8c__incl.svg index 075083ec7..9fe427d93 100644 --- a/da/de2/shell__sort2_8c__incl.svg +++ b/da/de2/shell__sort2_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - + sorting/shell_sort2.c diff --git a/da/de6/udp__client_8c.html b/da/de6/udp__client_8c.html index 800e1830b..eca2630b4 100644 --- a/da/de6/udp__client_8c.html +++ b/da/de6/udp__client_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: client_server/udp_client.c 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('da/de6/udp__client_8c.html','../../');
Macros | Functions
-
-
udp_client.c File Reference
+
udp_client.c File Reference
@@ -116,37 +115,107 @@ Include dependency graph for udp_client.c:
- - + - +

+

Macros

-#define PORT   8080
+#define PORT   8080
 port number to connect to
 
-#define MAXLINE   1024
+#define MAXLINE   1024
 maximum characters per line
 
- - - + +

+

Functions

-int main ()
 Driver code.
int main ()
 Driver code. More...
 

Detailed Description

-

Client side implementation of UDP client-server model.

-
Author
TheShubham99
+

Client side implementation of UDP client-server model.

+
Author
TheShubham99
-Krishna Vedala
+Krishna Vedala
See also
client_server/udp_server.c
-
+

Function Documentation

+ +

◆ main()

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

Driver code.

+
36{
+
37#ifdef _WIN32
+
38 // when using winsock2.h, startup required
+
39 WSADATA wsData;
+
40 if (WSAStartup(MAKEWORD(2, 2), &wsData) != 0)
+
41 {
+
42 perror("WSA Startup error: \n");
+
43 return 0;
+
44 }
+
45
+
46 atexit(cleanup); // register at-exit function
+
47#endif
+
48
+
49 int sockfd;
+
50 char buffer[MAXLINE];
+
51 char *hello = "Hello from client";
+
52 struct sockaddr_in servaddr;
+
53
+
54 // Creating socket file descriptor
+
55 if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
+
56 {
+
57 perror("socket creation failed");
+
58 exit(EXIT_FAILURE);
+
59 }
+
60
+
61 memset(&servaddr, 0, sizeof(servaddr));
+
62
+
63 // Filling server information
+
64 servaddr.sin_family = AF_INET;
+
65 servaddr.sin_port = htons(PORT);
+
66 servaddr.sin_addr.s_addr = INADDR_ANY;
+
67
+
68 int n;
+
69 unsigned int len;
+
70
+
71 sendto(sockfd, (const char *)hello, strlen(hello), 0,
+
72 (const struct sockaddr *)&servaddr, sizeof(servaddr));
+
73 printf("Hello message sent.\n");
+
74
+
75 n = recvfrom(sockfd, (char *)buffer, MAXLINE, MSG_WAITALL,
+
76 (struct sockaddr *)&servaddr, &len);
+
77 buffer[n] = '\0';
+
78 printf("Server : %s\n", buffer);
+
79
+
80 close(sockfd);
+
81 return 0;
+
82}
+
struct used to store character in certain times
Definition: min_printf.h:31
+
#define MAXLINE
maximum characters per line
Definition: udp_client.c:27
+
#define PORT
port number to connect to
Definition: udp_client.c:26
+
+
+
+ diff --git a/da/dfd/kohonen__som__trace_8c__incl.map b/da/dfd/kohonen__som__trace_8c__incl.map index 3c8e2dc1e..a79103291 100644 --- a/da/dfd/kohonen__som__trace_8c__incl.map +++ b/da/dfd/kohonen__som__trace_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/da/dfd/kohonen__som__trace_8c__incl.svg b/da/dfd/kohonen__som__trace_8c__incl.svg index 63dcd9b0d..3d0751730 100644 --- a/da/dfd/kohonen__som__trace_8c__incl.svg +++ b/da/dfd/kohonen__som__trace_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - -machine_learning/kohonen + +machine_learning/kohonen _som_trace.c diff --git a/db/d01/problem__13_2sol1_8c.html b/db/d01/problem__13_2sol1_8c.html index 792d7a556..3852cfe2f 100644 --- a/db/d01/problem__13_2sol1_8c.html +++ b/db/d01/problem__13_2sol1_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_13/sol1.c 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/d01/problem__13_2sol1_8c.html','../
-
-
sol1.c File Reference
+
sol1.c File Reference
-

Problem 13 solution +

Problem 13 solution More...

#include <stdint.h>
#include <stdio.h>
@@ -110,28 +109,26 @@ Include dependency graph for sol1.c:
- - + - - + + - - + +

+

Functions

int get_number (FILE *fp, char *buffer, uint8_t *out_int)
int get_number (FILE *fp, char *buffer, uint8_t *out_int)
 Function to read the number from a file and store it in array. More...
 
int add_numbers (uint8_t *a, uint8_t *b, uint8_t N)
 Function to add arbitrary length decimal integers stored in an array. More...
 
-int print_number (uint8_t *number, uint8_t N, int8_t num_digits_to_print)
 Function to print a long number.
int print_number (uint8_t *number, uint8_t N, int8_t num_digits_to_print)
 Function to print a long number. More...
 
-int main (void)
 Main function.
int main (void)
 Main function. More...
 

Detailed Description

-

Problem 13 solution

-
Author
Krishna Vedala
+

Problem 13 solution

+
Author
Krishna Vedala

Function Documentation

- +

◆ add_numbers()

@@ -164,52 +161,52 @@ int 

Function to add arbitrary length decimal integers stored in an array.

-

a + b = c = new b

-
49 {
-
50  int carry = 0;
-
51  uint8_t *c = b; /* accumulate the result in the array 'b' */
-
52 
-
53  for (int i = 0; i < N; i++)
-
54  {
-
55  // printf("\t%d + %d + %d ", a[i], b[i], carry);
-
56  c[i] = carry + a[i] + b[i]; // NOLINT // This is a known false-positive
-
57  if (c[i] > 9) /* check for carry */
-
58  {
-
59  carry = 1;
-
60  c[i] -= 10;
-
61  }
-
62  else
-
63  {
-
64  carry = 0;
-
65  }
-
66  // printf("= %d, %d\n", carry, c[i]);
-
67  }
-
68 
-
69  for (int i = N; i < N + 10; i++)
-
70  {
-
71  if (carry == 0)
-
72  {
-
73  break;
-
74  }
-
75  // printf("\t0 + %d + %d ", b[i], carry);
-
76  c[i] = carry + c[i];
-
77  if (c[i] > 9)
-
78  {
-
79  carry = 1;
-
80  c[i] -= 10;
-
81  }
-
82  else
-
83  {
-
84  carry = 0;
-
85  }
-
86  // printf("= %d, %d\n", carry, c[i]);
-
87  }
-
88  return 0;
-
89 }
+

a + b = c = new b

+
49{
+
50 int carry = 0;
+
51 uint8_t *c = b; /* accumulate the result in the array 'b' */
+
52
+
53 for (int i = 0; i < N; i++)
+
54 {
+
55 // printf("\t%d + %d + %d ", a[i], b[i], carry);
+
56 c[i] = carry + a[i] + b[i]; // NOLINT // This is a known false-positive
+
57 if (c[i] > 9) /* check for carry */
+
58 {
+
59 carry = 1;
+
60 c[i] -= 10;
+
61 }
+
62 else
+
63 {
+
64 carry = 0;
+
65 }
+
66 // printf("= %d, %d\n", carry, c[i]);
+
67 }
+
68
+
69 for (int i = N; i < N + 10; i++)
+
70 {
+
71 if (carry == 0)
+
72 {
+
73 break;
+
74 }
+
75 // printf("\t0 + %d + %d ", b[i], carry);
+
76 c[i] = carry + c[i];
+
77 if (c[i] > 9)
+
78 {
+
79 carry = 1;
+
80 c[i] -= 10;
+
81 }
+
82 else
+
83 {
+
84 carry = 0;
+
85 }
+
86 // printf("= %d, %d\n", carry, c[i]);
+
87 }
+
88 return 0;
+
89}
- +

◆ get_number()

@@ -242,36 +239,182 @@ int 

Function to read the number from a file and store it in array.

-


+


index 0 of output buffer => units place
index 1 of output buffer => tens place and so on i.e., index i => 10^i th place

-
17 {
-
18  long l = fscanf(fp, "%s\n", buffer);
-
19  if (!l)
-
20  {
-
21  perror("Error reading line.");
-
22  return -1;
-
23  }
-
24  // printf("Number: %s\t length: %ld, %ld\n", buffer, strlen(buffer), l);
-
25 
-
26  long L = strlen(buffer);
-
27 
-
28  for (int i = 0; i < L; i++)
-
29  {
-
30  if (buffer[i] < 0x30 || buffer[i] > 0x39)
-
31  {
-
32  perror("found inavlid character in the number!");
-
33  return -1;
-
34  }
-
35  else
-
36  {
-
37  out_int[L - i - 1] = buffer[i] - 0x30;
-
38  }
-
39  }
-
40 
-
41  return 0;
-
42 }
+
17{
+
18 long l = fscanf(fp, "%s\n", buffer);
+
19 if (!l)
+
20 {
+
21 perror("Error reading line.");
+
22 return -1;
+
23 }
+
24 // printf("Number: %s\t length: %ld, %ld\n", buffer, strlen(buffer), l);
+
25
+
26 long L = strlen(buffer);
+
27
+
28 for (int i = 0; i < L; i++)
+
29 {
+
30 if (buffer[i] < 0x30 || buffer[i] > 0x39)
+
31 {
+
32 perror("found inavlid character in the number!");
+
33 return -1;
+
34 }
+
35 else
+
36 {
+
37 out_int[L - i - 1] = buffer[i] - 0x30;
+
38 }
+
39 }
+
40
+
41 return 0;
+
42}
Definition: list.h:8
+
struct used to store character in certain times
Definition: min_printf.h:31
+
+
+
+ +

◆ main()

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

Main function.

+
124{
+
125 /* number of digits of the large number */
+
126 const int N = 10;
+
127 /* number of digits in output number */
+
128 const int N2 = N + 10;
+
129
+
130 // const char N = 50, N2 = N+10; /* length of numbers */
+
131 char *txt_buffer =
+
132 (char *)calloc(N + 5, sizeof(char)); /* temporary buffer */
+
133 uint8_t *number = (uint8_t *)calloc(
+
134 N, sizeof(uint8_t)); /* array to store digits of a large number */
+
135 uint8_t *sum = (uint8_t *)calloc(
+
136 N2, sizeof(uint8_t)); /* array to store the sum of the large
+
137numbers. For safety, we make it twice the length of a number. */
+
138
+
139 FILE *fp = fopen("num.txt", "rt"); /* open text file to read */
+
140 if (!fp)
+
141 {
+
142 perror("Unable to open file 'num.txt'.");
+
143 free(txt_buffer);
+
144 free(sum);
+
145 free(number);
+
146 return -1;
+
147 }
+
148
+
149 int count = 0;
+
150 get_number(fp, txt_buffer, sum); /* 0 + = first_number = first_number */
+
151 do
+
152 {
+
153 count++;
+
154 if (get_number(fp, txt_buffer, number) != 0)
+
155 {
+
156 break;
+
157 }
+
158 add_numbers(number, sum, N);
+
159 } while (!feof(fp));
+
160
+
161 printf("\nSum : ");
+
162 print_number(sum, N2, -1);
+
163
+
164 printf("first 10 digits: \t");
+
165 print_number(sum, N2, 10);
+
166
+
167 fclose(fp); /* close file */
+
168 free(txt_buffer);
+
169 free(sum);
+
170 free(number);
+
171 return 0;
+
172}
+
int count(int *arr, const int size)
Count func counts the number of prime numbers.
Definition: prime_seive.c:42
+
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
+
#define calloc(elemCount, elemSize)
This macro replace the standard calloc function with calloc_dbg.
Definition: malloc_dbg.h:22
+
int print_number(uint8_t *number, uint8_t N, int8_t num_digits_to_print)
Function to print a long number.
Definition: sol1.c:92
+
int get_number(FILE *fp, char *buffer, uint8_t *out_int)
Function to read the number from a file and store it in array.
Definition: sol1.c:16
+
int add_numbers(uint8_t *a, uint8_t *b, uint8_t N)
Function to add arbitrary length decimal integers stored in an array.
Definition: sol1.c:48
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ print_number()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int print_number (uint8_t * number,
uint8_t N,
int8_t num_digits_to_print 
)
+
+ +

Function to print a long number.

+
93{
+
94 uint8_t start_pos = N - 1;
+
95 uint8_t end_pos;
+
96
+
97 /* skip all initial zeros */
+
98 while (number[start_pos] == 0) start_pos--;
+
99
+
100 /* if end_pos < 0, print all digits */
+
101 if (num_digits_to_print < 0)
+
102 {
+
103 end_pos = 0;
+
104 }
+
105 else if (num_digits_to_print <= start_pos)
+
106 {
+
107 end_pos = start_pos - num_digits_to_print + 1;
+
108 }
+
109 else
+
110 {
+
111 fprintf(stderr, "invalid number of digits argumet!\n");
+
112 return -1;
+
113 }
+
114
+
115 for (int i = start_pos; i >= end_pos; i--) putchar(number[i] + 0x30);
+
116
+
117 putchar('\n');
+
118
+
119 return 0;
+
120}
@@ -281,7 +424,7 @@ int 
diff --git a/db/d01/problem__13_2sol1_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map b/db/d01/problem__13_2sol1_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map new file mode 100644 index 000000000..dd75e78ba --- /dev/null +++ b/db/d01/problem__13_2sol1_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/db/d01/problem__13_2sol1_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.md5 b/db/d01/problem__13_2sol1_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.md5 new file mode 100644 index 000000000..3a0266bb0 --- /dev/null +++ b/db/d01/problem__13_2sol1_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.md5 @@ -0,0 +1 @@ +18f1498592ec11f4ccdbefbc7f979e9e \ No newline at end of file diff --git a/db/d01/problem__13_2sol1_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg b/db/d01/problem__13_2sol1_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg new file mode 100644 index 000000000..a75d9578d --- /dev/null +++ b/db/d01/problem__13_2sol1_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg @@ -0,0 +1,82 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +add_numbers + + + + + +Node1->Node2 + + + + + +Node3 + + +count + + + + + +Node1->Node3 + + + + + +Node4 + + +get_number + + + + + +Node1->Node4 + + + + + +Node5 + + +print_number + + + + + +Node1->Node5 + + + + + diff --git a/db/d0c/infix__to__postfix_8c.html b/db/d0c/infix__to__postfix_8c.html index 3b598538c..a80b11d4d 100644 --- a/db/d0c/infix__to__postfix_8c.html +++ b/db/d0c/infix__to__postfix_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: conversions/infix_to_postfix.c 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/d0c/infix__to__postfix_8c.html','..
Data Structures | Functions
-
-
infix_to_postfix.c File Reference
+
infix_to_postfix.c File Reference
-

Infix to Postfix Expression Conversion +

Infix to Postfix Expression Conversion More...

#include <stdio.h>
@@ -108,13 +107,13 @@ Include dependency graph for infix_to_postfix.c:
-

+

Data Structures

struct  Stack
 for printf() and scanf() More...
 
- @@ -139,10 +138,10 @@ Functions

+

Functions

void push (struct Stack *p, char x)
 push function More...
 

Detailed Description

-

Infix to Postfix Expression Conversion

-

Convert Infixed expressions to Postfix expression.

Author
Harsh Karande
+

Infix to Postfix Expression Conversion

+

Convert Infixed expressions to Postfix expression.

Author
Harsh Karande

Function Documentation

- +

◆ convert()

@@ -177,69 +176,69 @@ Functions
Returns
postfixed expresion or \0 on exit
-
131 {
-
132  struct Stack s; // initialze object reference of stack
-
133  s.tos = -1; // initalize the tos
-
134 
-
135  int i, j = 0, pr;
-
136  char ch, temp;
-
137 
-
138  for (i = 0; infix[i] != '\0'; i++)
-
139  {
-
140  ch = infix[i];
-
141 
-
142  if (isOprnd(ch) == 1) // check if char is operand or operator
-
143  {
-
144  postfix[j] = ch; // assign ch to postfix array with index j
-
145  j++; // incement j
-
146  }
-
147  else
-
148  {
-
149  if (ch == '(')
-
150  {
-
151  push(&s, ch);
-
152  }
-
153  else
-
154  {
-
155  if (ch == ')')
-
156  {
-
157  while ((temp = pop(&s)) != '(')
-
158  {
-
159  postfix[j] = temp;
-
160  j++;
-
161  }
-
162  }
-
163  else
-
164  {
-
165  while (isEmpty(s) == 0) // check if stack is empty
-
166  {
-
167  pr = getPrecedence (ch,
-
168  s.arr[s.tos]); // check operator precedence
-
169 
-
170  if (pr == 1)
-
171  {
-
172  break; // if ch has a greater precedence than
-
173  // s.arr[s.top]
-
174  }
-
175 
-
176  postfix[j] = pop(&s);
-
177  j++;
-
178  }
-
179 
-
180  push(&s, ch); // push ch to stack
-
181  }
-
182  }
-
183  }
-
184  }
-
185 
-
186  while (isEmpty(s) == 0) // check if stack is empty
-
187  {
-
188  postfix[j] = pop(&s);
-
189  j++;
-
190  }
-
191 
-
192  postfix[j] = '\0';
-
193 }
+
131{
+
132 struct Stack s; // initialze object reference of stack
+
133 s.tos = -1; // initalize the tos
+
134
+
135 int i, j = 0, pr;
+
136 char ch, temp;
+
137
+
138 for (i = 0; infix[i] != '\0'; i++)
+
139 {
+
140 ch = infix[i];
+
141
+
142 if (isOprnd(ch) == 1) // check if char is operand or operator
+
143 {
+
144 postfix[j] = ch; // assign ch to postfix array with index j
+
145 j++; // incement j
+
146 }
+
147 else
+
148 {
+
149 if (ch == '(')
+
150 {
+
151 push(&s, ch);
+
152 }
+
153 else
+
154 {
+
155 if (ch == ')')
+
156 {
+
157 while ((temp = pop(&s)) != '(')
+
158 {
+
159 postfix[j] = temp;
+
160 j++;
+
161 }
+
162 }
+
163 else
+
164 {
+
165 while (isEmpty(s) == 0) // check if stack is empty
+
166 {
+
167 pr = getPrecedence (ch,
+
168 s.arr[s.tos]); // check operator precedence
+
169
+
170 if (pr == 1)
+
171 {
+
172 break; // if ch has a greater precedence than
+
173 // s.arr[s.top]
+
174 }
+
175
+
176 postfix[j] = pop(&s);
+
177 j++;
+
178 }
+
179
+
180 push(&s, ch); // push ch to stack
+
181 }
+
182 }
+
183 }
+
184 }
+
185
+
186 while (isEmpty(s) == 0) // check if stack is empty
+
187 {
+
188 postfix[j] = pop(&s);
+
189 j++;
+
190 }
+
191
+
192 postfix[j] = '\0';
+
193}
void push(struct Stack *p, char ch)
push function
Definition: infix_to_postfix.c:55
char pop(struct Stack *p)
pop function
Definition: infix_to_postfix.c:72
int getPrecedence(char op1, char op2)
getPrecedence function returns the precedence after comparing two operators passed as parameter.
Definition: infix_to_postfix.c:201
@@ -250,13 +249,13 @@ Functions
Here is the call graph for this function:
-
+
- +

◆ getPrecedence()

@@ -291,36 +290,36 @@ Here is the call graph for this function:
Returns
1 or 0 on exit
-
202 {
-
203  if (op2 == '$')
-
204  {
-
205  return 0;
-
206  }
-
207  else if (op1 == '$')
-
208  {
-
209  return 1;
-
210  }
-
211  else if (op2 == '*' || op2 == '/' || op2 == '%')
-
212  {
-
213  return 0;
-
214  }
-
215  else if (op1 == '*' || op1 == '/' || op1 == '%')
-
216  {
-
217  return 1;
-
218  }
-
219  else if (op2 == '+' || op2 == '-')
-
220  {
-
221  return 0;
-
222  }
-
223  else
-
224  {
-
225  return 1;
-
226  }
-
227 }
+
202{
+
203 if (op2 == '$')
+
204 {
+
205 return 0;
+
206 }
+
207 else if (op1 == '$')
+
208 {
+
209 return 1;
+
210 }
+
211 else if (op2 == '*' || op2 == '/' || op2 == '%')
+
212 {
+
213 return 0;
+
214 }
+
215 else if (op1 == '*' || op1 == '/' || op1 == '%')
+
216 {
+
217 return 1;
+
218 }
+
219 else if (op2 == '+' || op2 == '-')
+
220 {
+
221 return 0;
+
222 }
+
223 else
+
224 {
+
225 return 1;
+
226 }
+
227}
- +

◆ isEmpty()

@@ -344,20 +343,20 @@ Here is the call graph for this function:
Returns
1 or 0 on exit
-
113 {
-
114  if (s.tos == -1) // check if stack is empty
-
115  {
-
116  return 1; // return for true result
-
117  }
-
118  else
-
119  {
-
120  return 0; // return for false result
-
121  }
-
122 }
+
113{
+
114 if (s.tos == -1) // check if stack is empty
+
115 {
+
116 return 1; // return for true result
+
117 }
+
118 else
+
119 {
+
120 return 0; // return for false result
+
121 }
+
122}
- +

◆ isOprnd()

@@ -381,22 +380,22 @@ Here is the call graph for this function:
Returns
1 or 0 on exit
-
94 {
-
95  if ((ch >= 65 && ch <= 90) ||
-
96  (ch >= 97 && ch <= 122) || // check if ch is an operator or
-
97  (ch >= 48 && ch <= 57)) // operand using ASCII values
-
98  {
-
99  return 1; // return for true result
-
100  }
-
101  else
-
102  {
-
103  return 0; // return for false result
-
104  }
-
105 }
+
94{
+
95 if ((ch >= 65 && ch <= 90) ||
+
96 (ch >= 97 && ch <= 122) || // check if ch is an operator or
+
97 (ch >= 48 && ch <= 57)) // operand using ASCII values
+
98 {
+
99 return 1; // return for true result
+
100 }
+
101 else
+
102 {
+
103 return 0; // return for false result
+
104 }
+
105}
- +

◆ main()

@@ -414,28 +413,28 @@ Here is the call graph for this function:

main function

Returns
0 on exit
-
37 {
-
38  char infix[20], postfix[20]; // initialize empty infix and postfix array
-
39 
-
40  printf("Enter infix expression: "); // example : A+B-C*D/E$F
-
41  scanf("%s", infix); // get values for infix array
-
42 
-
43  convert(infix, postfix);
-
44  printf("Postfix expression is %s", postfix); // output : AB+CD*EF$/-
-
45 
-
46  return 0;
-
47 }
+
37{
+
38 char infix[20], postfix[20]; // initialize empty infix and postfix array
+
39
+
40 printf("Enter infix expression: "); // example : A+B-C*D/E$F
+
41 scanf("%s", infix); // get values for infix array
+
42
+
43 convert(infix, postfix);
+
44 printf("Postfix expression is %s", postfix); // output : AB+CD*EF$/-
+
45
+
46 return 0;
+
47}
void convert(char infix[], char postfix[])
convert function
Definition: infix_to_postfix.c:130
Here is the call graph for this function:
-
+
- +

◆ pop()

@@ -459,24 +458,24 @@ Here is the call graph for this function:
Returns
x or \0 on exit
-
73 {
-
74  char x;
-
75 
-
76  if (p->tos == -1)
-
77  {
-
78  printf("Stack Underflow!");
-
79  return '\0';
-
80  }
-
81 
-
82  x = p->arr[p->tos]; // assign the value of stack at index tos to x
-
83  p->tos -= 1; // decrement tos
-
84 
-
85  return x;
-
86 }
+
73{
+
74 char x;
+
75
+
76 if (p->tos == -1)
+
77 {
+
78 printf("Stack Underflow!");
+
79 return '\0';
+
80 }
+
81
+
82 x = p->arr[p->tos]; // assign the value of stack at index tos to x
+
83 p->tos -= 1; // decrement tos
+
84
+
85 return x;
+
86}
- +

◆ push()

@@ -511,16 +510,16 @@ Here is the call graph for this function:
Returns
void
-
56 {
-
57  if (p->tos == 9) // check if stack has reached its max limit
-
58  {
-
59  printf("Stack Overflow!");
-
60  return;
-
61  }
-
62 
-
63  p->tos += 1; // increment tos
-
64  p->arr[p->tos] = x; // assign char x to index of stack pointed by tos
-
65 }
+
56{
+
57 if (p->tos == 9) // check if stack has reached its max limit
+
58 {
+
59 printf("Stack Overflow!");
+
60 return;
+
61 }
+
62
+
63 p->tos += 1; // increment tos
+
64 p->arr[p->tos] = x; // assign char x to index of stack pointed by tos
+
65}
@@ -530,7 +529,7 @@ Here is the call graph for this function: diff --git a/db/d0c/infix__to__postfix_8c_a92af69ffc1e1f965ebce6a44672e96b1_cgraph.map b/db/d0c/infix__to__postfix_8c_a92af69ffc1e1f965ebce6a44672e96b1_cgraph.map index caacd4fa8..5d6af52f9 100644 --- a/db/d0c/infix__to__postfix_8c_a92af69ffc1e1f965ebce6a44672e96b1_cgraph.map +++ b/db/d0c/infix__to__postfix_8c_a92af69ffc1e1f965ebce6a44672e96b1_cgraph.map @@ -1,8 +1,8 @@ - - - - - + + + + + diff --git a/db/d0c/infix__to__postfix_8c_a92af69ffc1e1f965ebce6a44672e96b1_cgraph.svg b/db/d0c/infix__to__postfix_8c_a92af69ffc1e1f965ebce6a44672e96b1_cgraph.svg index 2ae82cd76..9a5b16df4 100644 --- a/db/d0c/infix__to__postfix_8c_a92af69ffc1e1f965ebce6a44672e96b1_cgraph.svg +++ b/db/d0c/infix__to__postfix_8c_a92af69ffc1e1f965ebce6a44672e96b1_cgraph.svg @@ -1,14 +1,14 @@ - - + convert - + Node1 @@ -22,76 +22,76 @@ Node2 - -getPrecedence + +getPrecedence Node1->Node2 - - + + Node3 - -isEmpty + +isEmpty Node1->Node3 - - + + Node4 - -isOprnd + +isOprnd Node1->Node4 - - + + Node5 - -pop + +pop Node1->Node5 - - + + Node6 - -push + +push Node1->Node6 - - + + diff --git a/db/d0c/infix__to__postfix_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/db/d0c/infix__to__postfix_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map index f77501267..00029b542 100644 --- a/db/d0c/infix__to__postfix_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map +++ b/db/d0c/infix__to__postfix_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -1,9 +1,9 @@ - - - - - + + + + + diff --git a/db/d0c/infix__to__postfix_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/db/d0c/infix__to__postfix_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index e27661866..c72006be4 100644 --- a/db/d0c/infix__to__postfix_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/db/d0c/infix__to__postfix_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,14 +1,14 @@ - - + main - + Node1 @@ -37,76 +37,76 @@ Node3 - -getPrecedence + +getPrecedence Node2->Node3 - - + + Node4 - -isEmpty + +isEmpty Node2->Node4 - - + + Node5 - -isOprnd + +isOprnd Node2->Node5 - - + + Node6 - -pop + +pop Node2->Node6 - - + + Node7 - -push + +push Node2->Node7 - - + + diff --git a/db/d17/structtnode__coll__graph.map b/db/d17/structtnode__coll__graph.map index 7c8e842bf..9ff1ae25b 100644 --- a/db/d17/structtnode__coll__graph.map +++ b/db/d17/structtnode__coll__graph.map @@ -1,3 +1,3 @@ - + diff --git a/db/d17/structtnode__coll__graph.svg b/db/d17/structtnode__coll__graph.svg index cf26381db..8b8625920 100644 --- a/db/d17/structtnode__coll__graph.svg +++ b/db/d17/structtnode__coll__graph.svg @@ -1,31 +1,31 @@ - - + tnode - + Node1 - -tnode + +tnode Node1->Node1 - - - eqkid -hikid -lokid + + + eqkid +hikid +lokid diff --git a/db/d28/struct_t__coll__graph.svg b/db/d28/struct_t__coll__graph.svg index e0ddb7755..04ed54169 100644 --- a/db/d28/struct_t__coll__graph.svg +++ b/db/d28/struct_t__coll__graph.svg @@ -1,7 +1,7 @@ - Node2->Node1 - head + head diff --git a/db/d37/int__to__string_8c__incl.map b/db/d37/int__to__string_8c__incl.map index 6e4f58f8a..301ee00de 100644 --- a/db/d37/int__to__string_8c__incl.map +++ b/db/d37/int__to__string_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/db/d37/int__to__string_8c__incl.svg b/db/d37/int__to__string_8c__incl.svg index b393ff734..6186d19cb 100644 --- a/db/d37/int__to__string_8c__incl.svg +++ b/db/d37/int__to__string_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - -conversions/int_to + +conversions/int_to _string.c diff --git a/db/d45/qr__decomposition_8c__incl.map b/db/d45/qr__decomposition_8c__incl.map index 0aa459c1d..f53cd8f0d 100644 --- a/db/d45/qr__decomposition_8c__incl.map +++ b/db/d45/qr__decomposition_8c__incl.map @@ -1,8 +1,8 @@ - + - - - - + + + + diff --git a/db/d45/qr__decomposition_8c__incl.svg b/db/d45/qr__decomposition_8c__incl.svg index 694952a62..8299700df 100644 --- a/db/d45/qr__decomposition_8c__incl.svg +++ b/db/d45/qr__decomposition_8c__incl.svg @@ -1,21 +1,21 @@ - - + numerical_methods/qr_decomposition.c - + Node1 - + numerical_methods/qr -_decomposition.c +_decomposition.c @@ -31,86 +31,86 @@ Node1->Node2 - - + + Node3 - -stdio.h + +stdio.h Node1->Node3 - - + + Node4 - -stdlib.h + +stdlib.h Node1->Node4 - - + + Node5 - -time.h + +time.h Node1->Node5 - - + + Node6 - -qr_decompose.h + +qr_decompose.h Node1->Node6 - - + + Node6->Node2 - - + + Node6->Node3 - - + + Node6->Node4 - - + + diff --git a/db/d50/problem__4_2sol_8c__incl.map b/db/d50/problem__4_2sol_8c__incl.map index 62a774da9..3aaa9f1b6 100644 --- a/db/d50/problem__4_2sol_8c__incl.map +++ b/db/d50/problem__4_2sol_8c__incl.map @@ -1,4 +1,4 @@ - - + + diff --git a/db/d50/problem__4_2sol_8c__incl.svg b/db/d50/problem__4_2sol_8c__incl.svg index a11fcbf04..968e28079 100644 --- a/db/d50/problem__4_2sol_8c__incl.svg +++ b/db/d50/problem__4_2sol_8c__incl.svg @@ -1,21 +1,21 @@ - - + project_euler/problem_4/sol.c - + Node1 - + project_euler/problem -_4/sol.c +_4/sol.c @@ -23,16 +23,16 @@ Node2 - -stdio.h + +stdio.h Node1->Node2 - - + + diff --git a/db/d74/problem__13_2sol1_8c__incl.map b/db/d74/problem__13_2sol1_8c__incl.map index ff65ac0da..fd3e70635 100644 --- a/db/d74/problem__13_2sol1_8c__incl.map +++ b/db/d74/problem__13_2sol1_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/db/d74/problem__13_2sol1_8c__incl.svg b/db/d74/problem__13_2sol1_8c__incl.svg index bc695aff2..ac60b79e1 100644 --- a/db/d74/problem__13_2sol1_8c__incl.svg +++ b/db/d74/problem__13_2sol1_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - -project_euler/problem + +project_euler/problem _13/sol1.c diff --git a/db/d80/problem__20_2sol1_8c.html b/db/d80/problem__20_2sol1_8c.html index 55c5ad458..2f70292d0 100644 --- a/db/d80/problem__20_2sol1_8c.html +++ b/db/d80/problem__20_2sol1_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_20/sol1.c 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('db/d80/problem__20_2sol1_8c.html','../ Data Structures | Typedefs | Functions -
-
sol1.c File Reference
+
sol1.c File Reference
-

Problem 20 solution +

Problem 20 solution More...

#include <stdio.h>
#include <stdlib.h>
@@ -111,45 +110,290 @@ Include dependency graph for sol1.c:
-

+

Data Structures

struct  _big_int
 store arbitratily large integer values as a linked list of digits. More...
 
- - +

+

Typedefs

-typedef struct _big_int big_int
+typedef struct _big_int big_int
 store arbitratily large integer values as a linked list of digits.
 
- - - - - - + + + + + - - + +

+

Functions

-big_int * add_digit (big_int *digit, char value)
 Function that allocates memory to add another digit at the MSB.
 
-char remove_digits (big_int *digit, int N)
 Function to remove digits preceeding the current digit.
big_int * add_digit (big_int *digit, char value)
 Function that allocates memory to add another digit at the MSB. More...
 
char remove_digits (big_int *digit, int N)
 Function to remove digits preceeding the current digit. More...
 
-int main (int argc, char **argv)
 Main function.
int main (int argc, char **argv)
 Main function. More...
 

Detailed Description

-

Problem 20 solution

-
Author
Krishna Vedala
+

Problem 20 solution

+
Author
Krishna Vedala

Implementation uses a custom big_int structure that can store arbitrarily large integer numbers.

-
+

Function Documentation

+ +

◆ add_digit()

+ +
+
+ + + + + + + + + + + + + + + + + + +
big_int * add_digit (big_int * digit,
char value 
)
+
+ +

Function that allocates memory to add another digit at the MSB.

+
38{
+
39 if (digit == NULL)
+
40 {
+
41 digit = (big_int *)malloc(sizeof(big_int));
+
42 if (!digit)
+
43 {
+
44 perror("Unable to allocate memory!");
+
45 return NULL;
+
46 }
+
47 digit->value = value;
+
48 digit->next_digit = NULL;
+
49 digit->prev_digit = NULL;
+
50
+
51 return digit;
+
52 }
+
53
+
54 if (digit->next_digit)
+
55 {
+
56 digit->next_digit->value = value;
+
57 return digit->next_digit;
+
58 }
+
59
+
60 digit->next_digit = (big_int *)malloc(sizeof(big_int));
+
61 if (digit->next_digit == NULL)
+
62 {
+
63 perror("Unable to allocate memory!");
+
64 return NULL;
+
65 }
+
66 digit->next_digit->value = value;
+
67 digit->next_digit->next_digit = NULL;
+
68 digit->next_digit->prev_digit = digit;
+
69 return digit->next_digit;
+
70}
+
#define malloc(bytes)
This macro replace the standard malloc function with malloc_dbg.
Definition: malloc_dbg.h:18
+
store arbitratily large integer values as a linked list of digits.
Definition: sol1.c:18
+
struct _big_int * next_digit
hundreds place
Definition: sol1.c:20
+
char value
tens place (single digit)
Definition: sol1.c:19
+
struct _big_int * prev_digit
units place
Definition: sol1.c:21
+
+
+
+ +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char ** argv 
)
+
+ +

Main function.

+
96{
+
97 unsigned int N = 5;
+
98 big_int *ptr = add_digit(NULL, 1); /* start with 1 */
+
99 const big_int *ptr0 = ptr; /* save the first location */
+
100 unsigned long sum_digits = 0;
+
101 unsigned long num_digits = 0;
+
102
+
103 if (argc == 2)
+
104 N = atoi(argv[1]);
+
105
+
106 clock_t start_time = clock();
+
107
+
108 for (unsigned int i = 1; i <= N; i++)
+
109 {
+
110 int carry = 0;
+
111#ifdef DEBUG
+
112 printf("%3d: ", i);
+
113#endif
+
114 ptr = (big_int *)ptr0; /* multiply every digit with i */
+
115 while (ptr)
+
116 {
+
117#ifdef DEBUG
+
118 printf("%p\t", ptr);
+
119#endif
+
120 unsigned int tmp = ptr->value * i + carry;
+
121 if (tmp >= 10)
+
122 {
+
123 div_t tmp2 = div(tmp, 10);
+
124 carry = tmp2.quot;
+
125 tmp = tmp2.rem;
+
126 }
+
127 else
+
128 carry = 0;
+
129
+
130 if (carry > 0 && ptr->next_digit == NULL)
+
131 add_digit(ptr, 0);
+
132
+
133 ptr->value = tmp;
+
134
+
135 if (i == N)
+
136 /*
+
137 * sum digits on the last iteration
+
138 * this avoid having another loop over all digits
+
139 */
+
140 sum_digits += tmp;
+
141
+
142 if (ptr->next_digit)
+
143 /* more digits available */
+
144 ptr = ptr->next_digit;
+
145 else
+
146 /* no more digits left - reached MSB */
+
147 break;
+
148 }
+
149#ifdef DEBUG
+
150 printf("\n");
+
151#endif
+
152 }
+
153
+
154 clock_t end_time = clock();
+
155
+
156#ifdef DEBUG
+
157 printf("ptr = %p\n", ptr);
+
158 printf("%d! = ", N);
+
159#endif
+
160
+
161 /* Notice that in the loop above, we make sure that at the end of the loop,
+
162 * ptr is pointing to the last digit. Thus we can avoid using another loop.
+
163 */
+
164 // ptr = &my_int;
+
165 // /* move ptr to the MSB digit */
+
166 // while (ptr->next_digit)
+
167 // ptr = ptr->next_digit;
+
168 do
+
169 {
+
170 putchar(ptr->value + 0x30); /* convert digit to ASCII char */
+
171 ptr = ptr->prev_digit;
+
172 num_digits++;
+
173 } while (ptr); /* after coming to units place, there will be no valid ptr */
+
174
+
175 printf("\nTime taken: %.4g millisecond\n",
+
176 1e3 * (end_time - start_time) / CLOCKS_PER_SEC);
+
177 printf(
+
178 "Digit Sum = %lu\tNumber of digits = %lu\tStorage space = %.3gkb\t \n",
+
179 sum_digits, num_digits, num_digits * sizeof(big_int) / 1024.0);
+
180
+
181 remove_digits((big_int *)ptr0, -1);
+
182 return 0;
+
183}
+
big_int * add_digit(big_int *digit, char value)
Function that allocates memory to add another digit at the MSB.
Definition: sol1.c:37
+
char remove_digits(big_int *digit, int N)
Function to remove digits preceeding the current digit.
Definition: sol1.c:76
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ remove_digits()

+ +
+
+ + + + + + + + + + + + + + + + + + +
char remove_digits (big_int * digit,
int N 
)
+
+ +

Function to remove digits preceeding the current digit.

+
77{
+
78 if (digit == NULL)
+
79 return 0;
+
80
+
81 if (digit->next_digit == NULL)
+
82 {
+
83 free(digit);
+
84 digit = NULL;
+
85 return 0;
+
86 }
+
87
+
88 if (N > 0)
+
89 return remove_digits(digit->next_digit, N - 1);
+
90
+
91 return remove_digits(digit->next_digit, 0);
+
92}
+
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ diff --git a/db/d80/problem__20_2sol1_8c.js b/db/d80/problem__20_2sol1_8c.js index 968e9f9a6..143d7457c 100644 --- a/db/d80/problem__20_2sol1_8c.js +++ b/db/d80/problem__20_2sol1_8c.js @@ -2,7 +2,7 @@ var problem__20_2sol1_8c = [ [ "_big_int", "dc/d77/struct__big__int.html", "dc/d77/struct__big__int" ], [ "big_int", "db/d80/problem__20_2sol1_8c.html#a62cbbd106aad52daadb9403a07d0da32", null ], - [ "add_digit", "db/d80/problem__20_2sol1_8c.html#afc373c28da6b17636528edcc97fb5f86", null ], + [ "add_digit", "db/d80/problem__20_2sol1_8c.html#a0dd8af03e6cc8187e996db564ff90960", null ], [ "main", "db/d80/problem__20_2sol1_8c.html#a3c04138a5bfe5d72780bb7e82a18e627", null ], [ "remove_digits", "db/d80/problem__20_2sol1_8c.html#a54a02c4b963fdb16f24959e0137763f1", null ] ]; \ No newline at end of file diff --git a/db/d80/problem__20_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map b/db/d80/problem__20_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map new file mode 100644 index 000000000..df8441ad5 --- /dev/null +++ b/db/d80/problem__20_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/db/d80/problem__20_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 b/db/d80/problem__20_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 new file mode 100644 index 000000000..e6c00d719 --- /dev/null +++ b/db/d80/problem__20_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 @@ -0,0 +1 @@ +5e72413dd3b868a433758ed51b972f5c \ No newline at end of file diff --git a/db/d80/problem__20_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg b/db/d80/problem__20_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg new file mode 100644 index 000000000..a61a7a4d1 --- /dev/null +++ b/db/d80/problem__20_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg @@ -0,0 +1,58 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +add_digit + + + + + +Node1->Node2 + + + + + +Node3 + + +remove_digits + + + + + +Node1->Node3 + + + + + +Node3->Node3 + + + + + diff --git a/db/d80/problem__20_2sol1_8c_a54a02c4b963fdb16f24959e0137763f1_cgraph.map b/db/d80/problem__20_2sol1_8c_a54a02c4b963fdb16f24959e0137763f1_cgraph.map new file mode 100644 index 000000000..45b355148 --- /dev/null +++ b/db/d80/problem__20_2sol1_8c_a54a02c4b963fdb16f24959e0137763f1_cgraph.map @@ -0,0 +1,3 @@ + + + diff --git a/db/d80/problem__20_2sol1_8c_a54a02c4b963fdb16f24959e0137763f1_cgraph.md5 b/db/d80/problem__20_2sol1_8c_a54a02c4b963fdb16f24959e0137763f1_cgraph.md5 new file mode 100644 index 000000000..c8a6ed6a7 --- /dev/null +++ b/db/d80/problem__20_2sol1_8c_a54a02c4b963fdb16f24959e0137763f1_cgraph.md5 @@ -0,0 +1 @@ +c936ea9ea27f39ba12571ed05038d828 \ No newline at end of file diff --git a/db/d80/problem__20_2sol1_8c_a54a02c4b963fdb16f24959e0137763f1_cgraph.svg b/db/d80/problem__20_2sol1_8c_a54a02c4b963fdb16f24959e0137763f1_cgraph.svg new file mode 100644 index 000000000..eb4971880 --- /dev/null +++ b/db/d80/problem__20_2sol1_8c_a54a02c4b963fdb16f24959e0137763f1_cgraph.svg @@ -0,0 +1,28 @@ + + + + + + +remove_digits + + + +Node1 + + +remove_digits + + + + + +Node1->Node1 + + + + + diff --git a/db/d83/problem__12_2sol1_8c__incl.map b/db/d83/problem__12_2sol1_8c__incl.map index 4291f1b8c..88d97a490 100644 --- a/db/d83/problem__12_2sol1_8c__incl.map +++ b/db/d83/problem__12_2sol1_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/db/d83/problem__12_2sol1_8c__incl.svg b/db/d83/problem__12_2sol1_8c__incl.svg index 8c6421ac2..a599c52a4 100644 --- a/db/d83/problem__12_2sol1_8c__incl.svg +++ b/db/d83/problem__12_2sol1_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - -project_euler/problem + +project_euler/problem _12/sol1.c diff --git a/db/d84/malloc__dbg_8c.html b/db/d84/malloc__dbg_8c.html index 4d010c49f..1800e7200 100644 --- a/db/d84/malloc__dbg_8c.html +++ b/db/d84/malloc__dbg_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: developer_tools/malloc_dbg.c 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('db/d84/malloc__dbg_8c.html','../../'); Typedefs | Functions | Variables -
-
malloc_dbg.c File Reference
+
malloc_dbg.c File Reference
@@ -109,39 +108,39 @@ $(document).ready(function(){initNavTree('db/d84/malloc__dbg_8c.html','../../');
Include dependency graph for malloc_dbg.c:
-
+
-

+

Data Structures

struct  MEMORY_INFORMATION
 For the malloc, calloc and free functions. More...
 
-

+

Typedefs

typedef struct MEMORY_INFORMATION mem_info
 For the malloc, calloc and free functions. More...
 
- - - - + + + - - - - - - + + + + + + @@ -149,10 +148,10 @@ Functions

+

Functions

mem_info * addMemInfo (mem_info *memoryInfo, void *ptrToReturn, size_t bytes, int line, const char *filename, const char *functionName)
 addMemInfo function add a memory allocation in the memoryInfo list. More...
 
mem_info * addMemInfo (mem_info *memoryInfo, void *ptrToReturn, size_t bytes, int line, const char *filename, const char *functionName)
 addMemInfo function add a memory allocation in the memoryInfo list. More...
 
int inList (const char *filename, int line)
 inList function is used to know if an element is already in the memoryInfo list. More...
 
void editInfo (int elemPos, size_t bytes)
 editInfo function is used to edit an element in the memoryInfo list. More...
 
void * malloc_dbg (size_t bytes, int line, const char *filename, const char *functionName)
 malloc_dbg function is a wrapper around the malloc function. More...
 
void * calloc_dbg (size_t elementCount, size_t elementSize, int line, const char *filename, const char *functionName)
 calloc_dbg function is a wrapper around the calloc function. More...
 
void * malloc_dbg (size_t bytes, int line, const char *filename, const char *functionName)
 malloc_dbg function is a wrapper around the malloc function. More...
 
void * calloc_dbg (size_t elementCount, size_t elementSize, int line, const char *filename, const char *functionName)
 calloc_dbg function is a wrapper around the calloc function. More...
 
void free_dbg (void *ptrToFree)
 free_dbg function is used to free the memory allocated to a pointer. More...
 
 printLeaks function is used to print all the memory leaks. More...
 
- - + @@ -160,10 +159,10 @@ Variables

+

Variables

-mem_info * memoryInformation = NULL
+mem_info * memoryInformation = NULL
 We use a global variable for the list so we can use it at any time.
 
int atexitCalled = 0
 

Detailed Description

-

This file contains malloc_dbg, calloc_dbg, free_dbg and printLeaks implementations.

-
Author
tinouduart33
+

This file contains malloc_dbg, calloc_dbg, free_dbg and printLeaks implementations.

+
Author
tinouduart33

Typedef Documentation

- +

◆ mem_info

@@ -176,20 +175,20 @@ Variables

For the malloc, calloc and free functions.

-

For IO operations (printf). For the memcmp function. Header file which contains the prototypes of malloc_dbg, calloc_dbg and fre_dbg.

-

Structure used to save an allocated pointer

+

For IO operations (printf). For the memcmp function. Header file which contains the prototypes of malloc_dbg, calloc_dbg and fre_dbg.

+

Structure used to save an allocated pointer

Function Documentation

- -

◆ addMemInfo()

+ +

◆ addMemInfo()

- + @@ -233,7 +232,7 @@ Variables

addMemInfo function add a memory allocation in the memoryInfo list.

-

This function creates a new element and add it on top of the list

Parameters
+

This function creates a new element and add it on top of the list

Parameters
mem_info* addMemInfo mem_info * addMemInfo ( mem_info *  memoryInfo,
@@ -245,25 +244,25 @@ Variables
Returns
mem_info pointer if it succeeds, NULL otherwise
-
52 {
-
53  mem_info* newMemInfo = (mem_info*)malloc(sizeof(mem_info));
-
54  if (!newMemInfo)
-
55  {
-
56  return NULL;
-
57  }
-
58 
-
59  newMemInfo->ptr = ptrToReturn;
-
60  newMemInfo->bytes = bytes;
-
61  newMemInfo->line = line;
-
62  newMemInfo->fileName = filename;
-
63  newMemInfo->functionName = functionName;
-
64  newMemInfo->next = memoryInfo;
-
65  newMemInfo->previous = NULL;
- -
67  memoryInformation->previous = newMemInfo;
-
68 
-
69  return newMemInfo;
-
70 }
+
52{
+
53 mem_info* newMemInfo = (mem_info*)malloc(sizeof(mem_info));
+
54 if (!newMemInfo)
+
55 {
+
56 return NULL;
+
57 }
+
58
+
59 newMemInfo->ptr = ptrToReturn;
+
60 newMemInfo->bytes = bytes;
+
61 newMemInfo->line = line;
+
62 newMemInfo->fileName = filename;
+
63 newMemInfo->functionName = functionName;
+
64 newMemInfo->next = memoryInfo;
+
65 newMemInfo->previous = NULL;
+ +
67 memoryInformation->previous = newMemInfo;
+
68
+
69 return newMemInfo;
+
70}
mem_info * memoryInformation
We use a global variable for the list so we can use it at any time.
Definition: malloc_dbg.c:33
#define malloc(bytes)
This macro replace the standard malloc function with malloc_dbg.
Definition: malloc_dbg.h:18
For the malloc, calloc and free functions.
Definition: malloc_dbg.c:21
@@ -277,14 +276,14 @@ Variables
- -

◆ calloc_dbg()

+ +

◆ calloc_dbg()

memoryInfoPointer to the doubly linked list used to store all of the allocations
ptrToreturnPointer returned by malloc or calloc
- + @@ -322,7 +321,7 @@ Variables

calloc_dbg function is a wrapper around the calloc function.

-

This function calls calloc and allocates the number of bytes passed in the parameters. If the allocation succeeds then it add the pointer returned by malloc in the mem_info list.

Parameters
+

This function calls calloc and allocates the number of bytes passed in the parameters. If the allocation succeeds then it add the pointer returned by malloc in the mem_info list.

Parameters
void* calloc_dbg void * calloc_dbg ( size_t  elementCount,
@@ -333,45 +332,45 @@ Variables
Returns
Pointer returned by calloc if it's valid, NULL otherwhise.
-
175 {
-
176  void* ptrToReturn = calloc(elementCount, elementSize);
-
177  if (!ptrToReturn)
-
178  {
-
179  return NULL;
-
180  }
-
181 
-
182  // We must check atexitCalled value to know if we already called the function
-
183  if (!atexitCalled)
-
184  {
-
185  atexit(printLeaks); // Used to call printLeaks when the program exit
-
186  atexitCalled = 1;
-
187  }
-
188 
-
189  // Add a new element in the mem_info list
-
190  memoryInformation = addMemInfo(memoryInformation, ptrToReturn, elementCount * elementSize, line, filename, functionName);
-
191  if (!memoryInformation)
-
192  {
-
193  free(ptrToReturn);
-
194  return NULL;
-
195  }
-
196 
-
197  return ptrToReturn;
-
198 }
+
175{
+
176 void* ptrToReturn = calloc(elementCount, elementSize);
+
177 if (!ptrToReturn)
+
178 {
+
179 return NULL;
+
180 }
+
181
+
182 // We must check atexitCalled value to know if we already called the function
+
183 if (!atexitCalled)
+
184 {
+
185 atexit(printLeaks); // Used to call printLeaks when the program exit
+
186 atexitCalled = 1;
+
187 }
+
188
+
189 // Add a new element in the mem_info list
+
190 memoryInformation = addMemInfo(memoryInformation, ptrToReturn, elementCount * elementSize, line, filename, functionName);
+ +
192 {
+
193 free(ptrToReturn);
+
194 return NULL;
+
195 }
+
196
+
197 return ptrToReturn;
+
198}
+
mem_info * addMemInfo(mem_info *memoryInfo, void *ptrToReturn, size_t bytes, int line, const char *filename, const char *functionName)
addMemInfo function add a memory allocation in the memoryInfo list.
Definition: malloc_dbg.c:51
void printLeaks()
printLeaks function is used to print all the memory leaks.
Definition: malloc_dbg.c:264
int atexitCalled
Another global variable.
Definition: malloc_dbg.c:37
-
mem_info * addMemInfo(mem_info *memoryInfo, void *ptrToReturn, size_t bytes, int line, const char *filename, const char *functionName)
addMemInfo function add a memory allocation in the memoryInfo list.
Definition: malloc_dbg.c:51
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
#define calloc(elemCount, elemSize)
This macro replace the standard calloc function with calloc_dbg.
Definition: malloc_dbg.h:22
Here is the call graph for this function:
-
+
- +

◆ editInfo()

@@ -398,7 +397,7 @@ Here is the call graph for this function:

editInfo function is used to edit an element in the memoryInfo list.

-

This function is used to edit the number of bytes allocated at a specific line.

Parameters
+

This function is used to edit the number of bytes allocated at a specific line.

Parameters
elementCountnumber of element to allocate
elementSizeSize of each element
@@ -406,21 +405,21 @@ Here is the call graph for this function:
Returns
Nothing.
-
108 {
-
109  int counter = 0;
- -
111 
-
112  while (counter != elemPos)
-
113  {
-
114  tmp = tmp->next;
-
115  counter++;
-
116  }
-
117  tmp->bytes += bytes;
-
118 }
+
108{
+
109 int counter = 0;
+ +
111
+
112 while (counter != elemPos)
+
113 {
+
114 tmp = tmp->next;
+
115 counter++;
+
116 }
+
117 tmp->bytes += bytes;
+
118}
- +

◆ free_dbg()

@@ -437,65 +436,65 @@ Here is the call graph for this function:

free_dbg function is used to free the memory allocated to a pointer.

-

This function free the memory pointed by the pointer passed in parameter. To free this pointer, we loop through the mem_info list and check if we find the pointer. Once it's found, the pointer is freed and the element is deleted from the list.

Parameters
+

This function free the memory pointed by the pointer passed in parameter. To free this pointer, we loop through the mem_info list and check if we find the pointer. Once it's found, the pointer is freed and the element is deleted from the list.

Parameters
elemPosPosition of an element in the doubly linked list memoryInfo
bytesSize of the allocation in bytes
ptrToFreePointer that must be freed
Returns
Nothing.
-
209 {
- -
211  mem_info* toFree = NULL;
-
212  mem_info* previous = NULL;
-
213 
-
214  // Check if the head contains the pointer to free
-
215  if (tmp->ptr == ptrToFree)
-
216  {
-
217  toFree = tmp;
-
218  memoryInformation = tmp->next;
-
219  free(toFree->ptr);
-
220  free(toFree);
-
221  if (memoryInformation)
-
222  {
-
223  memoryInformation->previous = NULL;
-
224  }
-
225  return;
-
226  }
-
227 
-
228  // We can loop through the list without any problems, the head is not the pointer
-
229  while (tmp)
-
230  {
-
231  if (tmp->ptr == ptrToFree) // If we found the pointer that must be freed
-
232  {
-
233  toFree = tmp;
-
234  tmp = tmp->next;
-
235  previous = toFree->previous;
-
236 
-
237  if (previous)
-
238  {
-
239  previous->next = tmp;
-
240  }
-
241  if (tmp)
-
242  {
-
243  tmp->previous = previous;
-
244  }
-
245 
-
246  free(toFree->ptr);
-
247  if (toFree == memoryInformation)
-
248  {
-
249  memoryInformation = NULL;
-
250  }
-
251  free(toFree);
-
252  return;
-
253  }
-
254  tmp = tmp->next;
-
255  }
-
256 }
+
209{
+ +
211 mem_info* toFree = NULL;
+
212 mem_info* previous = NULL;
+
213
+
214 // Check if the head contains the pointer to free
+
215 if (tmp->ptr == ptrToFree)
+
216 {
+
217 toFree = tmp;
+
218 memoryInformation = tmp->next;
+
219 free(toFree->ptr);
+
220 free(toFree);
+ +
222 {
+ +
224 }
+
225 return;
+
226 }
+
227
+
228 // We can loop through the list without any problems, the head is not the pointer
+
229 while (tmp)
+
230 {
+
231 if (tmp->ptr == ptrToFree) // If we found the pointer that must be freed
+
232 {
+
233 toFree = tmp;
+
234 tmp = tmp->next;
+
235 previous = toFree->previous;
+
236
+
237 if (previous)
+
238 {
+
239 previous->next = tmp;
+
240 }
+
241 if (tmp)
+
242 {
+
243 tmp->previous = previous;
+
244 }
+
245
+
246 free(toFree->ptr);
+
247 if (toFree == memoryInformation)
+
248 {
+
249 memoryInformation = NULL;
+
250 }
+
251 free(toFree);
+
252 return;
+
253 }
+
254 tmp = tmp->next;
+
255 }
+
256}
- +

◆ inList()

@@ -522,7 +521,7 @@ Here is the call graph for this function:

inList function is used to know if an element is already in the memoryInfo list.

-

This function is used to know if an allocation in a specific file at a specific line already exists in the list.

Parameters
+

This function is used to know if an allocation in a specific file at a specific line already exists in the list.

Parameters
@@ -530,36 +529,36 @@ Here is the call graph for this function:
Returns
Position of the element in the list if the element is found, -1 otherwise.
-
80 {
- -
82  int counter = 0;
-
83  int len = strlen(filename);
-
84 
-
85  while (tmp)
-
86  {
-
87  if (len == strlen(tmp->fileName))
-
88  {
-
89  if (!memcmp(filename, tmp->fileName, len) && tmp->line == line)
-
90  {
-
91  return counter;
-
92  }
-
93  }
-
94  tmp = tmp->next;
-
95  counter++;
-
96  }
-
97  return -1;
-
98 }
+
80{
+ +
82 int counter = 0;
+
83 int len = strlen(filename);
+
84
+
85 while (tmp)
+
86 {
+
87 if (len == strlen(tmp->fileName))
+
88 {
+
89 if (!memcmp(filename, tmp->fileName, len) && tmp->line == line)
+
90 {
+
91 return counter;
+
92 }
+
93 }
+
94 tmp = tmp->next;
+
95 counter++;
+
96 }
+
97 return -1;
+
98}
- -

◆ malloc_dbg()

+ +

◆ malloc_dbg()

filenameFile in which malloc or calloc has been called
lineLine number in the file in which malloc or calloc has been called
- + @@ -591,7 +590,7 @@ Here is the call graph for this function:

malloc_dbg function is a wrapper around the malloc function.

-

This function calls malloc and allocates the number of bytes passed in the parameters. If the allocation succeeds then it add the pointer returned by malloc in the mem_info list.

Parameters
+

This function calls malloc and allocates the number of bytes passed in the parameters. If the allocation succeeds then it add the pointer returned by malloc in the mem_info list.

Parameters
void* malloc_dbg void * malloc_dbg ( size_t  bytes,
@@ -600,50 +599,50 @@ Here is the call graph for this function:
Returns
Pointer returned by malloc if it's valid, NULL otherwhise.
-
130 {
-
131  void* ptrToReturn = malloc(bytes);
-
132  int pos = 0;
-
133  if (!ptrToReturn)
-
134  {
-
135  return NULL;
-
136  }
-
137 
-
138  // We must check atexitCalled value to know if we already called the function
-
139  if (!atexitCalled)
-
140  {
-
141  atexit(printLeaks); // Used to call printLeaks when the program exit
-
142  atexitCalled = 1;
-
143  }
-
144 
-
145  pos = inList(filename, line);
-
146  if (pos == -1)
-
147  {
-
148  // Add a new element in the mem_info list
-
149  memoryInformation = addMemInfo(memoryInformation, ptrToReturn, bytes, line, filename, functionName);
-
150  if (!memoryInformation)
-
151  {
-
152  free(ptrToReturn);
-
153  return NULL;
-
154  }
-
155  }
-
156  else
-
157  {
-
158  editInfo(pos, bytes);
-
159  }
-
160  return ptrToReturn;
-
161 }
+
130{
+
131 void* ptrToReturn = malloc(bytes);
+
132 int pos = 0;
+
133 if (!ptrToReturn)
+
134 {
+
135 return NULL;
+
136 }
+
137
+
138 // We must check atexitCalled value to know if we already called the function
+
139 if (!atexitCalled)
+
140 {
+
141 atexit(printLeaks); // Used to call printLeaks when the program exit
+
142 atexitCalled = 1;
+
143 }
+
144
+
145 pos = inList(filename, line);
+
146 if (pos == -1)
+
147 {
+
148 // Add a new element in the mem_info list
+
149 memoryInformation = addMemInfo(memoryInformation, ptrToReturn, bytes, line, filename, functionName);
+ +
151 {
+
152 free(ptrToReturn);
+
153 return NULL;
+
154 }
+
155 }
+
156 else
+
157 {
+
158 editInfo(pos, bytes);
+
159 }
+
160 return ptrToReturn;
+
161}
void editInfo(int elemPos, size_t bytes)
editInfo function is used to edit an element in the memoryInfo list.
Definition: malloc_dbg.c:107
int inList(const char *filename, int line)
inList function is used to know if an element is already in the memoryInfo list.
Definition: malloc_dbg.c:79
Here is the call graph for this function:
-
+
- +

◆ printLeaks()

@@ -660,37 +659,37 @@ Here is the call graph for this function:

printLeaks function is used to print all the memory leaks.

-

This function is called when the program exits. It loop through the mem_info list and if it's not empty, it prints the memory leaks.

Returns
Nothing.
-
265 {
- -
267  mem_info* previous = NULL;
-
268  size_t sum = 0;
-
269  int nbBlocks = 0;
-
270 
-
271  if (tmp)
-
272  {
-
273  printf("Memory Leaks detected.\n");
-
274  }
-
275 
-
276  while (tmp)
-
277  {
-
278  previous = tmp;
-
279  printf("\n%ld bytes lost\n", tmp->bytes);
-
280  printf("address : 0x%p in %s\t%s:%d\n", tmp->ptr, tmp->functionName, tmp->fileName, tmp->line);
-
281  printf("\n====================================\n");
-
282  sum += tmp->bytes;
-
283  tmp = tmp->next;
-
284  free(previous);
-
285  nbBlocks++;
-
286  }
-
287 
-
288  printf("SUMMARY :\n%ld bytes lost in %d blocks\n", sum, nbBlocks);
-
289 }
+

This function is called when the program exits. It loop through the mem_info list and if it's not empty, it prints the memory leaks.

Returns
Nothing.
+
265{
+ +
267 mem_info* previous = NULL;
+
268 size_t sum = 0;
+
269 int nbBlocks = 0;
+
270
+
271 if (tmp)
+
272 {
+
273 printf("Memory Leaks detected.\n");
+
274 }
+
275
+
276 while (tmp)
+
277 {
+
278 previous = tmp;
+
279 printf("\n%ld bytes lost\n", tmp->bytes);
+
280 printf("address : 0x%p in %s\t%s:%d\n", tmp->ptr, tmp->functionName, tmp->fileName, tmp->line);
+
281 printf("\n====================================\n");
+
282 sum += tmp->bytes;
+
283 tmp = tmp->next;
+
284 free(previous);
+
285 nbBlocks++;
+
286 }
+
287
+
288 printf("SUMMARY :\n%ld bytes lost in %d blocks\n", sum, nbBlocks);
+
289}

Variable Documentation

- +

◆ atexitCalled

@@ -703,7 +702,7 @@ Here is the call graph for this function:

Another global variable.

-

This one is used to know if we already call the atexit function.

+

This one is used to know if we already call the atexit function.

@@ -713,7 +712,7 @@ Here is the call graph for this function: diff --git a/db/d84/malloc__dbg_8c.js b/db/d84/malloc__dbg_8c.js index 41df57d94..56849da5e 100644 --- a/db/d84/malloc__dbg_8c.js +++ b/db/d84/malloc__dbg_8c.js @@ -2,12 +2,12 @@ var malloc__dbg_8c = [ [ "MEMORY_INFORMATION", "d4/d73/struct_m_e_m_o_r_y___i_n_f_o_r_m_a_t_i_o_n.html", "d4/d73/struct_m_e_m_o_r_y___i_n_f_o_r_m_a_t_i_o_n" ], [ "mem_info", "db/d84/malloc__dbg_8c.html#ab6619fb17769f2e4e2e36c9ef2dda3c6", null ], - [ "addMemInfo", "db/d84/malloc__dbg_8c.html#afae235c0e32e4c8b7d67117da5f78946", null ], - [ "calloc_dbg", "db/d84/malloc__dbg_8c.html#aec6b5ee323e5338f23a1ce6fe9974f25", null ], + [ "addMemInfo", "db/d84/malloc__dbg_8c.html#a062aa89cafd39a97971a2eb22653ff2a", null ], + [ "calloc_dbg", "db/d84/malloc__dbg_8c.html#ab07f946b77155ca78d0e14e231a99f5d", null ], [ "editInfo", "db/d84/malloc__dbg_8c.html#a8ac3a93239838ac88c18df64c58b9275", null ], [ "free_dbg", "db/d84/malloc__dbg_8c.html#a3f9195a04ac8e8a9868ee3e416db7e8c", null ], [ "inList", "db/d84/malloc__dbg_8c.html#acd08c54b257fb81e57f16c94690072f2", null ], - [ "malloc_dbg", "db/d84/malloc__dbg_8c.html#a10238aaeea60178d31fbb74347e941aa", null ], + [ "malloc_dbg", "db/d84/malloc__dbg_8c.html#a37914d05ba1fe8848aa1b48cda719422", null ], [ "printLeaks", "db/d84/malloc__dbg_8c.html#a2a47e4c38db8c00b80248e5535adf797", null ], [ "atexitCalled", "db/d84/malloc__dbg_8c.html#ad04afbbcb9f0f10bc7628ec4f0d7c950", null ], [ "memoryInformation", "db/d84/malloc__dbg_8c.html#afebd751704cd878d2e4b88499519c6e3", null ] diff --git a/db/d84/malloc__dbg_8c_a10238aaeea60178d31fbb74347e941aa_cgraph.md5 b/db/d84/malloc__dbg_8c_a10238aaeea60178d31fbb74347e941aa_cgraph.md5 deleted file mode 100644 index 41d2cfb14..000000000 --- a/db/d84/malloc__dbg_8c_a10238aaeea60178d31fbb74347e941aa_cgraph.md5 +++ /dev/null @@ -1 +0,0 @@ -883964604d5a2e6efe014e00549c992a \ No newline at end of file diff --git a/db/d84/malloc__dbg_8c_a10238aaeea60178d31fbb74347e941aa_cgraph.svg b/db/d84/malloc__dbg_8c_a10238aaeea60178d31fbb74347e941aa_cgraph.svg deleted file mode 100644 index d18bec242..000000000 --- a/db/d84/malloc__dbg_8c_a10238aaeea60178d31fbb74347e941aa_cgraph.svg +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - -malloc_dbg - - - -Node1 - - -malloc_dbg - - - - - -Node2 - - -addMemInfo - - - - - -Node1->Node2 - - - - - -Node3 - - -editInfo - - - - - -Node1->Node3 - - - - - -Node4 - - -inList - - - - - -Node1->Node4 - - - - - -Node5 - - -printLeaks - - - - - -Node1->Node5 - - - - - diff --git a/db/d84/malloc__dbg_8c_a10238aaeea60178d31fbb74347e941aa_cgraph.map b/db/d84/malloc__dbg_8c_a37914d05ba1fe8848aa1b48cda719422_cgraph.map similarity index 75% rename from db/d84/malloc__dbg_8c_a10238aaeea60178d31fbb74347e941aa_cgraph.map rename to db/d84/malloc__dbg_8c_a37914d05ba1fe8848aa1b48cda719422_cgraph.map index 05c8f8e31..978fff1c8 100644 --- a/db/d84/malloc__dbg_8c_a10238aaeea60178d31fbb74347e941aa_cgraph.map +++ b/db/d84/malloc__dbg_8c_a37914d05ba1fe8848aa1b48cda719422_cgraph.map @@ -1,7 +1,7 @@ - - - - - + + + + + diff --git a/db/d84/malloc__dbg_8c_a37914d05ba1fe8848aa1b48cda719422_cgraph.md5 b/db/d84/malloc__dbg_8c_a37914d05ba1fe8848aa1b48cda719422_cgraph.md5 new file mode 100644 index 000000000..3d8de952c --- /dev/null +++ b/db/d84/malloc__dbg_8c_a37914d05ba1fe8848aa1b48cda719422_cgraph.md5 @@ -0,0 +1 @@ +e4bbeeb6a12e95bff435929e543e0d4a \ No newline at end of file diff --git a/db/d84/malloc__dbg_8c_a37914d05ba1fe8848aa1b48cda719422_cgraph.svg b/db/d84/malloc__dbg_8c_a37914d05ba1fe8848aa1b48cda719422_cgraph.svg new file mode 100644 index 000000000..81ef784ef --- /dev/null +++ b/db/d84/malloc__dbg_8c_a37914d05ba1fe8848aa1b48cda719422_cgraph.svg @@ -0,0 +1,82 @@ + + + + + + +malloc_dbg + + + +Node1 + + +malloc_dbg + + + + + +Node2 + + +addMemInfo + + + + + +Node1->Node2 + + + + + +Node3 + + +editInfo + + + + + +Node1->Node3 + + + + + +Node4 + + +inList + + + + + +Node1->Node4 + + + + + +Node5 + + +printLeaks + + + + + +Node1->Node5 + + + + + diff --git a/db/d84/malloc__dbg_8c_aec6b5ee323e5338f23a1ce6fe9974f25_cgraph.map b/db/d84/malloc__dbg_8c_ab07f946b77155ca78d0e14e231a99f5d_cgraph.map similarity index 64% rename from db/d84/malloc__dbg_8c_aec6b5ee323e5338f23a1ce6fe9974f25_cgraph.map rename to db/d84/malloc__dbg_8c_ab07f946b77155ca78d0e14e231a99f5d_cgraph.map index f76eb08b2..c95d3a0e6 100644 --- a/db/d84/malloc__dbg_8c_aec6b5ee323e5338f23a1ce6fe9974f25_cgraph.map +++ b/db/d84/malloc__dbg_8c_ab07f946b77155ca78d0e14e231a99f5d_cgraph.map @@ -1,5 +1,5 @@ - - - + + + diff --git a/db/d84/malloc__dbg_8c_ab07f946b77155ca78d0e14e231a99f5d_cgraph.md5 b/db/d84/malloc__dbg_8c_ab07f946b77155ca78d0e14e231a99f5d_cgraph.md5 new file mode 100644 index 000000000..15b57be4a --- /dev/null +++ b/db/d84/malloc__dbg_8c_ab07f946b77155ca78d0e14e231a99f5d_cgraph.md5 @@ -0,0 +1 @@ +05191848183ce036223fb8421a225d5f \ No newline at end of file diff --git a/d2/ddd/malloc__dbg_8h_aec6b5ee323e5338f23a1ce6fe9974f25_cgraph.svg b/db/d84/malloc__dbg_8c_ab07f946b77155ca78d0e14e231a99f5d_cgraph.svg similarity index 51% rename from d2/ddd/malloc__dbg_8h_aec6b5ee323e5338f23a1ce6fe9974f25_cgraph.svg rename to db/d84/malloc__dbg_8c_ab07f946b77155ca78d0e14e231a99f5d_cgraph.svg index 379010c59..10b1be1df 100644 --- a/d2/ddd/malloc__dbg_8h_aec6b5ee323e5338f23a1ce6fe9974f25_cgraph.svg +++ b/db/d84/malloc__dbg_8c_ab07f946b77155ca78d0e14e231a99f5d_cgraph.svg @@ -1,52 +1,52 @@ - - + calloc_dbg - + Node1 - -calloc_dbg + +calloc_dbg Node2 - - -addMemInfo + + +addMemInfo Node1->Node2 - - + + Node3 - -printLeaks + +printLeaks Node1->Node3 - - + + diff --git a/db/d84/malloc__dbg_8c_aec6b5ee323e5338f23a1ce6fe9974f25_cgraph.md5 b/db/d84/malloc__dbg_8c_aec6b5ee323e5338f23a1ce6fe9974f25_cgraph.md5 deleted file mode 100644 index 3376b8c70..000000000 --- a/db/d84/malloc__dbg_8c_aec6b5ee323e5338f23a1ce6fe9974f25_cgraph.md5 +++ /dev/null @@ -1 +0,0 @@ -37df4a1dd5f2e169d982f7e139354d13 \ No newline at end of file diff --git a/db/d8b/struct_node.html b/db/d8b/struct_node.html index 8e94f4e2d..889abad2c 100644 --- a/db/d8b/struct_node.html +++ b/db/d8b/struct_node.html @@ -2,8 +2,8 @@ - - + +Algorithms_in_C: Node Struct Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ @@ -42,21 +41,22 @@
bytesSize of the allocation in bytes
filenameCaller file
-
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('db/d8b/struct_node.html','../../'); in
-
-
Node Struct Reference
+
Node Struct Reference
@@ -102,32 +101,52 @@ $(document).ready(function(){initNavTree('db/d8b/struct_node.html','../../'); in
Collaboration diagram for Node:
-
+
[legend]
- - + - + - + - + + + + + + + + + + + +

+

Data Fields

-int data
+int data
 stores the number
 
-struct Node * llink
+struct Node * llink
 link to left child
 
-struct Node * rlink
+struct Node * rlink
 link to right child
 
+
+char * word
 the word (value) of the node
 
+uint64_t frequency
 number of occurences of the word
 
+struct Node * left
 pointer to the left child node
 
+struct Node * right
 pointer to the right child node
 
struct Node * next
 

Detailed Description

-

Node, the basic data structure of the tree.

+

Node, the basic data structure of the tree.

+

for assert

+

for type checks for uint64_t based types, int64_t based types for boolean data type for IO operations for memory allocation for string operations

+

structure defining a node in the binary tree


The documentation for this struct was generated from the following files: @@ -137,7 +156,7 @@ struct Node * < diff --git a/db/d8b/struct_node.js b/db/d8b/struct_node.js index dca96a0c8..ffb626a0a 100644 --- a/db/d8b/struct_node.js +++ b/db/d8b/struct_node.js @@ -1,7 +1,10 @@ var struct_node = [ [ "data", "db/d8b/struct_node.html#a87c003c9f600e3fc58e6e90835f0b605", null ], + [ "frequency", "db/d8b/struct_node.html#abe1c200da58f5276c6fd74f640a29a02", null ], + [ "left", "db/d8b/struct_node.html#ad0976834843c7618677d22a10c495b36", null ], [ "llink", "db/d8b/struct_node.html#a60b73f452505cef98795d2c8de3e72ef", null ], - [ "next", "db/d8b/struct_node.html#a772e2a82248c0d0dfc5cdf19d5b45df9", null ], - [ "rlink", "db/d8b/struct_node.html#a0ed3c7305b43527f0f237bbfd438b8f7", null ] + [ "right", "db/d8b/struct_node.html#af99e7102380da88d7c079fa264230cf4", null ], + [ "rlink", "db/d8b/struct_node.html#a0ed3c7305b43527f0f237bbfd438b8f7", null ], + [ "word", "db/d8b/struct_node.html#afa6ccc6414d3e0bcacb715dcdf764bca", null ] ]; \ No newline at end of file diff --git a/db/dd4/structlist__coll__graph.svg b/db/dd4/structlist__coll__graph.svg index 108be33af..bafe6f6e5 100644 --- a/db/dd4/structlist__coll__graph.svg +++ b/db/dd4/structlist__coll__graph.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C: misc/prime_seive.c 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/dd5/prime__seive_8c.html','../../') -
-
prime_seive.c File Reference
+
prime_seive.c File Reference
-

Prime Seive algorithm implementation. +

Prime Seive algorithm implementation. More...

#include <assert.h>
#include <stdio.h>
@@ -110,7 +109,7 @@ Include dependency graph for prime_seive.c:
- @@ -125,23 +124,23 @@ Functions

+

Functions

void prime (int *p)
 Prime Sieve works in O(nlogn) time. More...
 Main function. More...
 
- - +

+

Variables

-const unsigned long long MAX_SIZE = 1000000
+const unsigned long long MAX_SIZE = 1000000
 for assert for standard input output for general purpose standard library
 

Detailed Description

-

Prime Seive algorithm implementation.

-
Author
Divyansh Kushwaha
+

Prime Seive algorithm implementation.

+
Author
Divyansh Kushwaha
diff --git a/db/dd8/problem__26_2sol1_8c__incl.map b/db/dd8/problem__26_2sol1_8c__incl.map index 59425da80..e7c3f8dba 100644 --- a/db/dd8/problem__26_2sol1_8c__incl.map +++ b/db/dd8/problem__26_2sol1_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/db/dd8/problem__26_2sol1_8c__incl.svg b/db/dd8/problem__26_2sol1_8c__incl.svg index ccc17bb1d..f64db5f3f 100644 --- a/db/dd8/problem__26_2sol1_8c__incl.svg +++ b/db/dd8/problem__26_2sol1_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - -project_euler/problem + +project_euler/problem _26/sol1.c diff --git a/db/ddb/hello__world_8h_source.html b/db/ddb/hello__world_8h_source.html index 84d366f16..35cbb9644 100644 --- a/db/ddb/hello__world_8h_source.html +++ b/db/ddb/hello__world_8h_source.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: exercism/hello_world/hello_world.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,23 +90,22 @@ $(document).ready(function(){initNavTree('db/ddb/hello__world_8h_source.html','.
-
-
hello_world.h
+
hello_world.h
-
1 #ifndef HELLO_WORLD_H
-
2 #define HELLO_WORLD_H
-
3 
-
4 const char *hello(void);
-
5 
-
6 #endif
+
1#ifndef HELLO_WORLD_H
+
2#define HELLO_WORLD_H
+
3
+
4const char *hello(void);
+
5
+
6#endif
diff --git a/db/ddf/insertion__sort_8c.html b/db/ddf/insertion__sort_8c.html index 09103ab9c..59a08dd9f 100644 --- a/db/ddf/insertion__sort_8c.html +++ b/db/ddf/insertion__sort_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: sorting/insertion_sort.c 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/ddf/insertion__sort_8c.html','../..
-
-
insertion_sort.c File Reference
+
insertion_sort.c File Reference
-

Insertion sort algorithm implementation. +

Insertion sort algorithm implementation. More...

#include <assert.h>
#include <stdio.h>
@@ -110,7 +109,7 @@ Include dependency graph for insertion_sort.c:
- @@ -118,14 +117,13 @@ Functions - +

+

Functions

void insertionSort (int *arr, int size)
 Insertion sort algorithm implements. More...
static void test ()
 Test function. More...
 
-int main (int argc, const char *argv[])
int main (int argc, const char *argv[])
 

Detailed Description

-

Insertion sort algorithm implementation.

+

Insertion sort algorithm implementation.

Function Documentation

- +

◆ insertionSort()

@@ -159,25 +157,60 @@ int main (int argc, co -
17 {
-
18  for (int i = 1; i < size; i++)
-
19  {
-
20  int j = i - 1;
-
21  int key = arr[i];
-
22  /* Move all elements greater than key to one position */
-
23  while (j >= 0 && key < arr[j])
-
24  {
-
25  arr[j + 1] = arr[j];
-
26  j = j - 1;
-
27  }
-
28  /* Find a correct position for key */
-
29  arr[j + 1] = key;
-
30  }
-
31 }
+
17{
+
18 for (int i = 1; i < size; i++)
+
19 {
+
20 int j = i - 1;
+
21 int key = arr[i];
+
22 /* Move all elements greater than key to one position */
+
23 while (j >= 0 && key < arr[j])
+
24 {
+
25 arr[j + 1] = arr[j];
+
26 j = j - 1;
+
27 }
+
28 /* Find a correct position for key */
+
29 arr[j + 1] = key;
+
30 }
+
31}
- + +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
const char * argv[] 
)
+
+
54{
+
55 /* Intializes random number generator */
+
56 srand(time(NULL));
+
57 test();
+
58 return 0;
+
59}
+
static void test()
Test function.
Definition: insertion_sort.c:36
+
+
+
+

◆ test()

@@ -203,29 +236,29 @@ int main (int argc, co

Test function.

Returns
None
-
37 {
-
38  const int size = rand() % 500; /* random array size */
-
39  int *arr = (int *)calloc(size, sizeof(int));
-
40 
-
41  /* generate size random numbers from -50 to 49 */
-
42  for (int i = 0; i < size; i++)
-
43  {
-
44  arr[i] = (rand() % 100) - 50; /* signed random numbers */
-
45  }
-
46  insertionSort(arr, size);
-
47  for (int i = 0; i < size - 1; ++i)
-
48  {
-
49  assert(arr[i] <= arr[i + 1]);
-
50  }
-
51  free(arr);
-
52 }
+
37{
+
38 const int size = rand() % 500; /* random array size */
+
39 int *arr = (int *)calloc(size, sizeof(int));
+
40
+
41 /* generate size random numbers from -50 to 49 */
+
42 for (int i = 0; i < size; i++)
+
43 {
+
44 arr[i] = (rand() % 100) - 50; /* signed random numbers */
+
45 }
+
46 insertionSort(arr, size);
+
47 for (int i = 0; i < size - 1; ++i)
+
48 {
+
49 assert(arr[i] <= arr[i + 1]);
+
50 }
+
51 free(arr);
+
52}
void insertionSort(int *arr, int size)
Insertion sort algorithm implements.
Definition: insertion_sort.c:16
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
#define calloc(elemCount, elemSize)
This macro replace the standard calloc function with calloc_dbg.
Definition: malloc_dbg.h:22
Here is the call graph for this function:
-
+
@@ -237,7 +270,7 @@ Here is the call graph for this function:
diff --git a/db/ddf/insertion__sort_8c.js b/db/ddf/insertion__sort_8c.js index 0af518e75..2839097f3 100644 --- a/db/ddf/insertion__sort_8c.js +++ b/db/ddf/insertion__sort_8c.js @@ -1,6 +1,5 @@ var insertion__sort_8c = [ [ "insertionSort", "db/ddf/insertion__sort_8c.html#a0d6c227641a5e0dae580b3a18df241fb", null ], - [ "main", "db/ddf/insertion__sort_8c.html#ac0f2228420376f4db7e1274f2b41667c", null ], [ "test", "db/ddf/insertion__sort_8c.html#aa8dca7b867074164d5f45b0f3851269d", null ] ]; \ No newline at end of file diff --git a/db/ddf/insertion__sort_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map b/db/ddf/insertion__sort_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map index df3d9e06b..c25dcb672 100644 --- a/db/ddf/insertion__sort_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map +++ b/db/ddf/insertion__sort_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map @@ -1,4 +1,4 @@ - + diff --git a/db/ddf/insertion__sort_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/db/ddf/insertion__sort_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg index 09e1a9834..4d5490cb8 100644 --- a/db/ddf/insertion__sort_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg +++ b/db/ddf/insertion__sort_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg @@ -1,14 +1,14 @@ - - + test - + Node1 @@ -22,16 +22,16 @@ Node2 - -insertionSort + +insertionSort Node1->Node2 - - + + diff --git a/db/de2/naval__battle_8c.html b/db/de2/naval__battle_8c.html index 0c06d65bf..323a5d298 100644 --- a/db/de2/naval__battle_8c.html +++ b/db/de2/naval__battle_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: games/naval_battle.c 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,22 +92,21 @@ $(document).ready(function(){initNavTree('db/de2/naval__battle_8c.html','../../'
-
-
naval_battle.c File Reference
+
naval_battle.c File Reference
-

naval_battle implementation in C using only the stdio.h for Standard Input and Output. +

naval_battle implementation in C using only the stdio.h for Standard Input and Output. More...

#include <stdio.h>
Include dependency graph for naval_battle.c:
-
+
- @@ -147,13 +146,13 @@ Functions

+

Functions

int validEntryLineColumn (int line, char column)
 for Standard Input Output More...
 

Detailed Description

-

naval_battle implementation in C using only the stdio.h for Standard Input and Output.

-
Author
Carlos Rafael
+

naval_battle implementation in C using only the stdio.h for Standard Input and Output.

+
Author
Carlos Rafael
-Herick Lima
+Herick Lima

Naval battle is a game, to be played by two people. It consists of knocking down the enemy ship, through shots , when hit the ship is revealed with the respective number of its size. Example: size 3 = 3 3 3 on the board. To play - boats over size 1, need direction; V -> vertical and H -> horizontal. Example Input 1 A H -> line 1, column A, direction H (Horizontal).

Function Documentation

- +

◆ calculateScore()

@@ -195,211 +194,211 @@ Functions
Returns
resulting score
-
443 {
-
444  int c = 0, b = 0, e = 0, d = 0;
-
445 
-
446  if (mat[line][column] == 10)
-
447  {
-
448  mat[line][column] = 50;
-
449  return 2;
-
450  }
-
451 
-
452  else if (mat[line][column] == 20)
-
453  {
-
454  if (mat[line + 1][column] == 20)
-
455  {
-
456  b = 1;
-
457  }
-
458 
-
459  if (mat[line - 1][column] == 20)
-
460  {
-
461  c = 1;
-
462  }
-
463 
-
464  if (mat[line][column + 1] == 20)
-
465  {
-
466  d = 1;
-
467  }
-
468 
-
469  if (mat[line][column - 1] == 20)
-
470  {
-
471  e = 1;
-
472  }
-
473 
-
474  if (b == 1)
-
475  {
-
476  if (mat[line + 1][column] == 20)
-
477  {
-
478  mat[line][column] = 50;
-
479  mat[line + 1][column] = 50;
-
480  return 4;
-
481  }
-
482  else
-
483  {
-
484  return 0;
-
485  }
-
486  }
-
487 
-
488  if (c == 1)
-
489  {
-
490  if (mat[line - 1][column] == 20)
-
491  {
-
492  mat[line][column] = 50;
-
493  mat[line - 1][column] = 50;
-
494  return 4;
-
495  }
-
496  else
-
497  {
-
498  return 0;
-
499  }
-
500  }
-
501 
-
502  if (d == 1)
-
503  {
-
504  if (mat[line][column + 1] == 20)
-
505  {
-
506  mat[line][column] = 50;
-
507  mat[line][column + 1] = 50;
-
508  return 4;
-
509  }
-
510  else
-
511  {
-
512  return 0;
-
513  }
-
514  }
-
515 
-
516  if (e == 1)
-
517  {
-
518  if (mat[line][column - 1] == 20)
-
519  {
-
520  mat[line][column] = 50;
-
521  mat[line][column - 1] = 50;
-
522  return 4;
-
523  }
-
524  else
-
525  {
-
526  return 0;
-
527  }
-
528  }
-
529  }
-
530 
-
531  else if (mat[line][column] == 30)
-
532  {
-
533  if (mat[line + 1][column] == 30)
-
534  {
-
535  b = 1;
-
536  }
-
537 
-
538  if (mat[line - 1][column] == 30)
-
539  {
-
540  c = 1;
-
541  }
-
542  if (mat[line][column + 1] == 30)
-
543  {
-
544  d = 1;
-
545  }
-
546 
-
547  if (mat[line][column - 1] == 30)
-
548  {
-
549  e = 1;
-
550  }
-
551 
-
552  if (b == 1 && c == 1)
-
553  {
-
554  if (mat[line + 1][column] == 30 && mat[line - 1][column] == 30)
-
555  {
-
556  mat[line][column] = 50;
-
557  mat[line + 1][column] = 50;
-
558  mat[line - 1][column] = 50;
-
559  return 7;
-
560  }
-
561  else
-
562  {
-
563  return 0;
-
564  }
-
565  }
-
566 
-
567  else if (d == 1 && e == 1)
-
568  {
-
569  if (mat[line][column + 1] == 30 && mat[line][column - 1] == 30)
-
570  {
-
571  mat[line][column] = 50;
-
572  mat[line][column - 1] = 50;
-
573  mat[line][column + 1] = 50;
-
574  return 7;
-
575  }
-
576  else
-
577  {
-
578  return 0;
-
579  }
-
580  }
-
581 
-
582  else if (d == 1)
-
583  {
-
584  if (mat[line][column + 1] == 30 && mat[line][column + 2] == 30)
-
585  {
-
586  mat[line][column] = 50;
-
587  mat[line][column + 1] = 50;
-
588  mat[line][column + 2] = 50;
-
589  return 7;
-
590  }
-
591  else
-
592  {
-
593  return 0;
-
594  }
-
595  }
-
596 
-
597  else if (e == 1)
-
598  {
-
599  if (mat[line][column - 1] == 30 && mat[line][column - 2] == 30)
-
600  {
-
601  mat[line][column] = 50;
-
602  mat[line][column - 1] = 50;
-
603  mat[line][column - 2] = 50;
-
604  return 7;
-
605  }
-
606  else
-
607  {
-
608  return 0;
-
609  }
-
610  }
-
611 
-
612  else if (c == 1)
-
613  {
-
614  if (mat[line - 1][column] == 30 && mat[line - 2][column] == 30)
-
615  {
-
616  mat[line][column] = 50;
-
617  mat[line - 1][column] = 50;
-
618  mat[line - 2][column] = 50;
-
619  return 7;
-
620  }
-
621  else
-
622  {
-
623  return 0;
-
624  }
-
625  }
-
626 
-
627  else if (b == 1)
-
628  {
-
629  if (mat[line + 1][column] == 30 && mat[line + 2][column] == 30)
-
630  {
-
631  mat[line][column] = 50;
-
632  mat[line + 1][column] = 50;
-
633  mat[line + 2][column] = 50;
-
634  return 7;
-
635  }
-
636  else
-
637  {
-
638  return 0;
-
639  }
-
640  }
-
641  }
-
642  return 0;
-
643 }
+
443{
+
444 int c = 0, b = 0, e = 0, d = 0;
+
445
+
446 if (mat[line][column] == 10)
+
447 {
+
448 mat[line][column] = 50;
+
449 return 2;
+
450 }
+
451
+
452 else if (mat[line][column] == 20)
+
453 {
+
454 if (mat[line + 1][column] == 20)
+
455 {
+
456 b = 1;
+
457 }
+
458
+
459 if (mat[line - 1][column] == 20)
+
460 {
+
461 c = 1;
+
462 }
+
463
+
464 if (mat[line][column + 1] == 20)
+
465 {
+
466 d = 1;
+
467 }
+
468
+
469 if (mat[line][column - 1] == 20)
+
470 {
+
471 e = 1;
+
472 }
+
473
+
474 if (b == 1)
+
475 {
+
476 if (mat[line + 1][column] == 20)
+
477 {
+
478 mat[line][column] = 50;
+
479 mat[line + 1][column] = 50;
+
480 return 4;
+
481 }
+
482 else
+
483 {
+
484 return 0;
+
485 }
+
486 }
+
487
+
488 if (c == 1)
+
489 {
+
490 if (mat[line - 1][column] == 20)
+
491 {
+
492 mat[line][column] = 50;
+
493 mat[line - 1][column] = 50;
+
494 return 4;
+
495 }
+
496 else
+
497 {
+
498 return 0;
+
499 }
+
500 }
+
501
+
502 if (d == 1)
+
503 {
+
504 if (mat[line][column + 1] == 20)
+
505 {
+
506 mat[line][column] = 50;
+
507 mat[line][column + 1] = 50;
+
508 return 4;
+
509 }
+
510 else
+
511 {
+
512 return 0;
+
513 }
+
514 }
+
515
+
516 if (e == 1)
+
517 {
+
518 if (mat[line][column - 1] == 20)
+
519 {
+
520 mat[line][column] = 50;
+
521 mat[line][column - 1] = 50;
+
522 return 4;
+
523 }
+
524 else
+
525 {
+
526 return 0;
+
527 }
+
528 }
+
529 }
+
530
+
531 else if (mat[line][column] == 30)
+
532 {
+
533 if (mat[line + 1][column] == 30)
+
534 {
+
535 b = 1;
+
536 }
+
537
+
538 if (mat[line - 1][column] == 30)
+
539 {
+
540 c = 1;
+
541 }
+
542 if (mat[line][column + 1] == 30)
+
543 {
+
544 d = 1;
+
545 }
+
546
+
547 if (mat[line][column - 1] == 30)
+
548 {
+
549 e = 1;
+
550 }
+
551
+
552 if (b == 1 && c == 1)
+
553 {
+
554 if (mat[line + 1][column] == 30 && mat[line - 1][column] == 30)
+
555 {
+
556 mat[line][column] = 50;
+
557 mat[line + 1][column] = 50;
+
558 mat[line - 1][column] = 50;
+
559 return 7;
+
560 }
+
561 else
+
562 {
+
563 return 0;
+
564 }
+
565 }
+
566
+
567 else if (d == 1 && e == 1)
+
568 {
+
569 if (mat[line][column + 1] == 30 && mat[line][column - 1] == 30)
+
570 {
+
571 mat[line][column] = 50;
+
572 mat[line][column - 1] = 50;
+
573 mat[line][column + 1] = 50;
+
574 return 7;
+
575 }
+
576 else
+
577 {
+
578 return 0;
+
579 }
+
580 }
+
581
+
582 else if (d == 1)
+
583 {
+
584 if (mat[line][column + 1] == 30 && mat[line][column + 2] == 30)
+
585 {
+
586 mat[line][column] = 50;
+
587 mat[line][column + 1] = 50;
+
588 mat[line][column + 2] = 50;
+
589 return 7;
+
590 }
+
591 else
+
592 {
+
593 return 0;
+
594 }
+
595 }
+
596
+
597 else if (e == 1)
+
598 {
+
599 if (mat[line][column - 1] == 30 && mat[line][column - 2] == 30)
+
600 {
+
601 mat[line][column] = 50;
+
602 mat[line][column - 1] = 50;
+
603 mat[line][column - 2] = 50;
+
604 return 7;
+
605 }
+
606 else
+
607 {
+
608 return 0;
+
609 }
+
610 }
+
611
+
612 else if (c == 1)
+
613 {
+
614 if (mat[line - 1][column] == 30 && mat[line - 2][column] == 30)
+
615 {
+
616 mat[line][column] = 50;
+
617 mat[line - 1][column] = 50;
+
618 mat[line - 2][column] = 50;
+
619 return 7;
+
620 }
+
621 else
+
622 {
+
623 return 0;
+
624 }
+
625 }
+
626
+
627 else if (b == 1)
+
628 {
+
629 if (mat[line + 1][column] == 30 && mat[line + 2][column] == 30)
+
630 {
+
631 mat[line][column] = 50;
+
632 mat[line + 1][column] = 50;
+
633 mat[line + 2][column] = 50;
+
634 return 7;
+
635 }
+
636 else
+
637 {
+
638 return 0;
+
639 }
+
640 }
+
641 }
+
642 return 0;
+
643}
- +

◆ canShoot()

@@ -441,20 +440,20 @@ Functions
Returns
if the position is valid for shooting
-
108 {
-
109  if (mat[line][column] == -2 || mat[line][column] == 10 ||
-
110  mat[line][column] == 20 || mat[line][column] == 30 ||
-
111  mat[line][column] == 50)
-
112  {
-
113  return 0;
-
114  }
-
115 
-
116  return 1;
-
117 }
+
108{
+
109 if (mat[line][column] == -2 || mat[line][column] == 10 ||
+
110 mat[line][column] == 20 || mat[line][column] == 30 ||
+
111 mat[line][column] == 50)
+
112 {
+
113 return 0;
+
114 }
+
115
+
116 return 1;
+
117}
- +

◆ main()

@@ -472,140 +471,140 @@ Functions

Main function.

Returns
0 on exit
-

the one with the most points wins, or the one who knocks down all boats first.

-
814 {
-
815  int Player1[10][10];
-
816  int Player2[10][10];
-
817  int plays = 1;
-
818  int pts1 = 0, pts2 = 0, a1 = 0, a2 = 0;
-
819  int line, col = 0, lin = 0;
-
820  char column;
-
821 
-
822  // filling matrix with 0
-
823  for (int i = 0; i < 10; i++)
-
824  {
-
825  for (int j = 0; j < 10; j++)
-
826  {
-
827  Player1[i][j] = 0;
-
828  Player2[i][j] = 0;
-
829  }
-
830  }
-
831 
-
832  // positioning boats
-
833  for (int i = 1; i <= 2; i++)
-
834  {
-
835  for (int j = 1; j <= 6; j++)
-
836  {
-
837  if (i == 1)
-
838  {
-
839  printPositioning(i, 1, j);
-
840  printsTray(Player1, 0);
-
841  positionBoat(Player1, 1);
-
842  }
-
843  else if (i == 2)
-
844  {
-
845  printPositioning(i, 1, j);
-
846  printsTray(Player2, 0);
-
847  positionBoat(Player2, 1);
-
848  }
-
849  }
-
850  for (int j = 1; j <= 4; j++)
-
851  {
-
852  if (i == 1)
-
853  {
-
854  printPositioning(i, 2, j);
-
855  printsTray(Player1, 0);
-
856  positionBoat(Player1, 2);
-
857  }
-
858  else if (i == 2)
-
859  {
-
860  printPositioning(i, 2, j);
-
861  printsTray(Player2, 0);
-
862  positionBoat(Player2, 2);
-
863  }
-
864  }
-
865  for (int j = 1; j <= 2; j++)
-
866  {
-
867  if (i == 1)
-
868  {
-
869  printPositioning(i, 3, j);
-
870  printsTray(Player1, 0);
-
871  positionBoat(Player1, 3);
-
872  }
-
873  else if (i == 2)
-
874  {
-
875  printPositioning(i, 3, j);
-
876  printsTray(Player2, 0);
-
877  positionBoat(Player2, 3);
-
878  }
-
879  }
-
880  }
-
881 
-
882  // starting the game
-
883  while (plays <= 40)
-
884  {
-
885  if (plays % 2 != 0)
-
886  {
-
887  printMessageScore(pts1, pts2);
-
888  printMessage("Player's turn 1");
-
889  printsTray(Player2, 1);
-
890  scanf("%d %c", &line, &column);
-
891 
-
892  while (validEntryLineColumn(line, column) != 1 ||
-
893  canShoot(Player2, line - 1, column - 65) != 1)
-
894  {
-
895  line = 0;
-
896  column = 'a';
-
897  printf("Position unavailable!\n");
-
898  scanf("%d %c", &line, &column);
-
899  }
-
900  lin = line - 1;
-
901  col = column - 65;
-
902  shoot(Player2, lin, col);
-
903  a1 = pts1;
-
904  pts1 += calculateScore(Player2, lin, col);
-
905 
-
906  if (a1 != pts1)
-
907  {
-
908  printMessage("Player 1 DROPPED A BOAT!");
-
909  }
-
910  }
-
911  else
-
912  {
-
913  printMessageScore(pts1, pts2);
-
914  printMessage("Player's turn 1");
-
915  printsTray(Player1, 1);
-
916  scanf("%d %c", &line, &column);
-
917 
-
918  while (validEntryLineColumn(line, column) != 1 ||
-
919  canShoot(Player1, line - 1, column - 65) != 1)
-
920  {
-
921  printf("Position unavailable!\n");
-
922  scanf("%d %c", &line, &column);
-
923  }
-
924  lin = line - 1;
-
925  col = column - 65;
-
926  shoot(Player1, lin, col);
-
927  a2 = pts2;
-
928  pts2 += calculateScore(Player1, lin, col);
-
929 
-
930  if (a2 != pts2)
-
931  {
-
932  printMessage("Player 2 DROPPED A BOAT!");
-
933  }
-
934  }
-
935 
-
936  plays++;
-
937  }
-
938  /**
-
939  * the one with the most points wins, or the one who knocks down all boats
-
940  * first.
-
941  */
-
942  printMessage("END GAME\n");
-
943  printMessageScore(pts1, pts2);
-
944 
-
945  return 0;
-
946 }
+

the one with the most points wins, or the one who knocks down all boats first.

+
814{
+
815 int Player1[10][10];
+
816 int Player2[10][10];
+
817 int plays = 1;
+
818 int pts1 = 0, pts2 = 0, a1 = 0, a2 = 0;
+
819 int line, col = 0, lin = 0;
+
820 char column;
+
821
+
822 // filling matrix with 0
+
823 for (int i = 0; i < 10; i++)
+
824 {
+
825 for (int j = 0; j < 10; j++)
+
826 {
+
827 Player1[i][j] = 0;
+
828 Player2[i][j] = 0;
+
829 }
+
830 }
+
831
+
832 // positioning boats
+
833 for (int i = 1; i <= 2; i++)
+
834 {
+
835 for (int j = 1; j <= 6; j++)
+
836 {
+
837 if (i == 1)
+
838 {
+
839 printPositioning(i, 1, j);
+
840 printsTray(Player1, 0);
+
841 positionBoat(Player1, 1);
+
842 }
+
843 else if (i == 2)
+
844 {
+
845 printPositioning(i, 1, j);
+
846 printsTray(Player2, 0);
+
847 positionBoat(Player2, 1);
+
848 }
+
849 }
+
850 for (int j = 1; j <= 4; j++)
+
851 {
+
852 if (i == 1)
+
853 {
+
854 printPositioning(i, 2, j);
+
855 printsTray(Player1, 0);
+
856 positionBoat(Player1, 2);
+
857 }
+
858 else if (i == 2)
+
859 {
+
860 printPositioning(i, 2, j);
+
861 printsTray(Player2, 0);
+
862 positionBoat(Player2, 2);
+
863 }
+
864 }
+
865 for (int j = 1; j <= 2; j++)
+
866 {
+
867 if (i == 1)
+
868 {
+
869 printPositioning(i, 3, j);
+
870 printsTray(Player1, 0);
+
871 positionBoat(Player1, 3);
+
872 }
+
873 else if (i == 2)
+
874 {
+
875 printPositioning(i, 3, j);
+
876 printsTray(Player2, 0);
+
877 positionBoat(Player2, 3);
+
878 }
+
879 }
+
880 }
+
881
+
882 // starting the game
+
883 while (plays <= 40)
+
884 {
+
885 if (plays % 2 != 0)
+
886 {
+
887 printMessageScore(pts1, pts2);
+
888 printMessage("Player's turn 1");
+
889 printsTray(Player2, 1);
+
890 scanf("%d %c", &line, &column);
+
891
+
892 while (validEntryLineColumn(line, column) != 1 ||
+
893 canShoot(Player2, line - 1, column - 65) != 1)
+
894 {
+
895 line = 0;
+
896 column = 'a';
+
897 printf("Position unavailable!\n");
+
898 scanf("%d %c", &line, &column);
+
899 }
+
900 lin = line - 1;
+
901 col = column - 65;
+
902 shoot(Player2, lin, col);
+
903 a1 = pts1;
+
904 pts1 += calculateScore(Player2, lin, col);
+
905
+
906 if (a1 != pts1)
+
907 {
+
908 printMessage("Player 1 DROPPED A BOAT!");
+
909 }
+
910 }
+
911 else
+
912 {
+
913 printMessageScore(pts1, pts2);
+
914 printMessage("Player's turn 1");
+
915 printsTray(Player1, 1);
+
916 scanf("%d %c", &line, &column);
+
917
+
918 while (validEntryLineColumn(line, column) != 1 ||
+
919 canShoot(Player1, line - 1, column - 65) != 1)
+
920 {
+
921 printf("Position unavailable!\n");
+
922 scanf("%d %c", &line, &column);
+
923 }
+
924 lin = line - 1;
+
925 col = column - 65;
+
926 shoot(Player1, lin, col);
+
927 a2 = pts2;
+
928 pts2 += calculateScore(Player1, lin, col);
+
929
+
930 if (a2 != pts2)
+
931 {
+
932 printMessage("Player 2 DROPPED A BOAT!");
+
933 }
+
934 }
+
935
+
936 plays++;
+
937 }
+
938 /**
+
939 * the one with the most points wins, or the one who knocks down all boats
+
940 * first.
+
941 */
+
942 printMessage("END GAME\n");
+
943 printMessageScore(pts1, pts2);
+
944
+
945 return 0;
+
946}
void shoot(int mat[10][10], int line, int column)
Function shoot Responsible for saying if he hit a boat.
Definition: naval_battle.c:411
void printMessageScore(int pts1, int pts2)
Function printMessageScore Responsible for printing the score messages.
Definition: naval_battle.c:280
void positionBoat(int mat[10][10], int boat)
Function positionBoat Responsible for placing the boats on the board, according to the size.
Definition: naval_battle.c:124
@@ -618,13 +617,13 @@ Functions
Here is the call graph for this function:
-
+
- +

◆ positionBoat()

@@ -658,153 +657,153 @@ Here is the call graph for this function:
-
125 {
-
126  int line, j;
-
127  char column, guide;
-
128 
-
129  if (boat == 1)
-
130  {
-
131  scanf("%d %c", &line, &column);
-
132 
-
133  while (validEntryLineColumn(line, column) != 1 ||
-
134  validatePosition(mat, boat, (line - 1), (column - 65), 'H') != 1)
-
135  {
-
136  printf("Position unavailable!\n");
-
137  scanf("%d %c", &line, &column);
-
138  }
-
139  }
-
140 
-
141  else
-
142  {
-
143  scanf("%d %c %c", &line, &column, &guide);
-
144 
-
145  while (validEntryLineColumn(line, column) == 0 ||
-
146  validatePosition(mat, boat, (line - 1), (column - 65), guide) ==
-
147  0)
-
148  {
-
149  printf("Position unavailable!\n");
-
150  scanf("%d %c %c", &line, &column, &guide);
-
151  }
-
152  }
-
153 
-
154  int aux = column - 'A';
-
155  line -= 1;
-
156 
-
157  if (boat == 1)
-
158  {
-
159  for (j = aux; j < (aux + boat); j++)
-
160  {
-
161  mat[line][j] = boat;
-
162  }
-
163 
-
164  for (int a = line - 1; a < (line + boat + 1); a++)
-
165  {
-
166  for (int b = aux - 1; b < (aux + boat + 1); b++)
-
167  {
-
168  if (a >= 0 && a <= 9 && b >= 0 && b <= 9)
-
169  {
-
170  if (mat[a][b] != boat)
-
171  {
-
172  mat[a][b] = -1;
-
173  }
-
174  }
-
175  }
-
176  }
-
177  }
-
178 
-
179  if (guide == 'H')
-
180  {
-
181  for (j = aux; j < (aux + boat); j++)
-
182  {
-
183  mat[line][j] = boat;
-
184  }
-
185  if (boat == 3)
-
186  {
-
187  for (int a = line - 1; a < (line + boat - 1); a++)
-
188  {
-
189  for (int b = aux - 1; b < (aux + boat + 1); b++)
-
190  {
-
191  if (a >= 0 && a <= 9 && b >= 0 && b <= 9)
-
192  {
-
193  if (mat[a][b] != boat)
-
194  {
-
195  mat[a][b] = -1;
-
196  }
-
197  }
-
198  }
-
199  }
-
200  }
-
201 
-
202  else
-
203  {
-
204  for (int a = line - 1; a < (line + boat); a++)
-
205  {
-
206  for (int b = aux - 1; b < (aux + boat + 1); b++)
-
207  {
-
208  if (a >= 0 && a <= 9 && b >= 0 && b <= 9)
-
209  {
-
210  if (mat[a][b] != boat)
-
211  {
-
212  mat[a][b] = -1;
-
213  }
-
214  }
-
215  }
-
216  }
-
217  }
-
218  }
-
219 
-
220  if (guide == 'V')
-
221  {
-
222  for (j = line; j < (line + boat); j++)
-
223  {
-
224  mat[j][aux] = boat;
-
225  }
-
226  if (boat == 3)
-
227  {
-
228  for (int a = line - 1; a < (line + boat + 1); a++)
-
229  {
-
230  for (int b = aux - 1; b < (aux + boat - 1); b++)
-
231  {
-
232  if (a >= 0 && a <= 9 && b >= 0 && b <= 9)
-
233  {
-
234  if (mat[a][b] != boat)
-
235  {
-
236  mat[a][b] = -1;
-
237  }
-
238  }
-
239  }
-
240  }
-
241  }
-
242 
-
243  else
-
244  {
-
245  for (int a = line - 1; a < (line + boat + 1); a++)
-
246  {
-
247  for (int b = aux - 1; b < (aux + boat); b++)
-
248  {
-
249  if (a >= 0 && a <= 9 && b >= 0 && b <= 9)
-
250  {
-
251  if (mat[a][b] != boat)
-
252  {
-
253  mat[a][b] = -1;
-
254  }
-
255  }
-
256  }
-
257  }
-
258  }
-
259  }
-
260 }
+
125{
+
126 int line, j;
+
127 char column, guide;
+
128
+
129 if (boat == 1)
+
130 {
+
131 scanf("%d %c", &line, &column);
+
132
+
133 while (validEntryLineColumn(line, column) != 1 ||
+
134 validatePosition(mat, boat, (line - 1), (column - 65), 'H') != 1)
+
135 {
+
136 printf("Position unavailable!\n");
+
137 scanf("%d %c", &line, &column);
+
138 }
+
139 }
+
140
+
141 else
+
142 {
+
143 scanf("%d %c %c", &line, &column, &guide);
+
144
+
145 while (validEntryLineColumn(line, column) == 0 ||
+
146 validatePosition(mat, boat, (line - 1), (column - 65), guide) ==
+
147 0)
+
148 {
+
149 printf("Position unavailable!\n");
+
150 scanf("%d %c %c", &line, &column, &guide);
+
151 }
+
152 }
+
153
+
154 int aux = column - 'A';
+
155 line -= 1;
+
156
+
157 if (boat == 1)
+
158 {
+
159 for (j = aux; j < (aux + boat); j++)
+
160 {
+
161 mat[line][j] = boat;
+
162 }
+
163
+
164 for (int a = line - 1; a < (line + boat + 1); a++)
+
165 {
+
166 for (int b = aux - 1; b < (aux + boat + 1); b++)
+
167 {
+
168 if (a >= 0 && a <= 9 && b >= 0 && b <= 9)
+
169 {
+
170 if (mat[a][b] != boat)
+
171 {
+
172 mat[a][b] = -1;
+
173 }
+
174 }
+
175 }
+
176 }
+
177 }
+
178
+
179 if (guide == 'H')
+
180 {
+
181 for (j = aux; j < (aux + boat); j++)
+
182 {
+
183 mat[line][j] = boat;
+
184 }
+
185 if (boat == 3)
+
186 {
+
187 for (int a = line - 1; a < (line + boat - 1); a++)
+
188 {
+
189 for (int b = aux - 1; b < (aux + boat + 1); b++)
+
190 {
+
191 if (a >= 0 && a <= 9 && b >= 0 && b <= 9)
+
192 {
+
193 if (mat[a][b] != boat)
+
194 {
+
195 mat[a][b] = -1;
+
196 }
+
197 }
+
198 }
+
199 }
+
200 }
+
201
+
202 else
+
203 {
+
204 for (int a = line - 1; a < (line + boat); a++)
+
205 {
+
206 for (int b = aux - 1; b < (aux + boat + 1); b++)
+
207 {
+
208 if (a >= 0 && a <= 9 && b >= 0 && b <= 9)
+
209 {
+
210 if (mat[a][b] != boat)
+
211 {
+
212 mat[a][b] = -1;
+
213 }
+
214 }
+
215 }
+
216 }
+
217 }
+
218 }
+
219
+
220 if (guide == 'V')
+
221 {
+
222 for (j = line; j < (line + boat); j++)
+
223 {
+
224 mat[j][aux] = boat;
+
225 }
+
226 if (boat == 3)
+
227 {
+
228 for (int a = line - 1; a < (line + boat + 1); a++)
+
229 {
+
230 for (int b = aux - 1; b < (aux + boat - 1); b++)
+
231 {
+
232 if (a >= 0 && a <= 9 && b >= 0 && b <= 9)
+
233 {
+
234 if (mat[a][b] != boat)
+
235 {
+
236 mat[a][b] = -1;
+
237 }
+
238 }
+
239 }
+
240 }
+
241 }
+
242
+
243 else
+
244 {
+
245 for (int a = line - 1; a < (line + boat + 1); a++)
+
246 {
+
247 for (int b = aux - 1; b < (aux + boat); b++)
+
248 {
+
249 if (a >= 0 && a <= 9 && b >= 0 && b <= 9)
+
250 {
+
251 if (mat[a][b] != boat)
+
252 {
+
253 mat[a][b] = -1;
+
254 }
+
255 }
+
256 }
+
257 }
+
258 }
+
259 }
+
260}
int validatePosition(int mat[10][10], int boat, int line, int column, char guide)
Function validatePosition Responsible for checking if the position can receive the boat.
Definition: naval_battle.c:43
Here is the call graph for this function:
-
+
- +

◆ printMessage()

@@ -827,17 +826,17 @@ Here is the call graph for this function:
-
267 {
-
268  printf("************************\n");
-
269  printf("*\n");
-
270  printf("* %s\n", msg);
-
271  printf("*\n");
-
272  printf("************************\n");
-
273 }
+
267{
+
268 printf("************************\n");
+
269 printf("*\n");
+
270 printf("* %s\n", msg);
+
271 printf("*\n");
+
272 printf("************************\n");
+
273}
- +

◆ printMessageScore()

@@ -871,18 +870,18 @@ Here is the call graph for this function:
-
281 {
-
282  printf("************************\n");
-
283  printf("*\n");
-
284  printf("* Player'S SCORE 1: %02d\n", pts1);
-
285  printf("* Player'S SCORE 2: %02d\n", pts2);
-
286  printf("*\n");
-
287  printf("************************\n");
-
288 }
+
281{
+
282 printf("************************\n");
+
283 printf("*\n");
+
284 printf("* Player'S SCORE 1: %02d\n", pts1);
+
285 printf("* Player'S SCORE 2: %02d\n", pts2);
+
286 printf("*\n");
+
287 printf("************************\n");
+
288}
- +

◆ printPositioning()

@@ -923,172 +922,172 @@ Here is the call graph for this function:
-
653 {
-
654  if (Player == 1)
-
655  {
-
656  char msg1[60] = "Player 1 - Position the size boat 1 (1/6)";
-
657  char msg2[60] = "Player 1 - Position the size boat 1 (2/6)";
-
658  char msg3[60] = "Player 1 - Position the size boat 1 (3/6)";
-
659  char msg4[60] = "Player 1 - Position the size boat 1 (4/6)";
-
660  char msg5[60] = "Player 1 - Position the size boat 1 (5/6)";
-
661  char msg6[60] = "Player 1 - Position the size boat 1 (6/6)";
-
662 
-
663  char msg7[60] = "Player 1 - Position the size boat 2 (1/4)";
-
664  char msg8[60] = "Player 1 - Position the size boat 2 (2/4)";
-
665  char msg9[60] = "Player 1 - Position the size boat 2 (3/4)";
-
666  char msg10[60] = "Player 1 - Position the size boat 2 (4/4)";
-
667 
-
668  char msg11[60] = "Player 1 - Position the size boat 3 (1/2)";
-
669  char msg12[60] = "Player 1 - Position the size boat 3 (2/2)";
-
670 
-
671  if (boat == 1)
-
672  {
-
673  if (nm == 1)
-
674  {
-
675  printMessage(msg1);
-
676  }
-
677  else if (nm == 2)
-
678  {
-
679  printMessage(msg2);
-
680  }
-
681  else if (nm == 3)
-
682  {
-
683  printMessage(msg3);
-
684  }
-
685 
-
686  else if (nm == 4)
-
687  {
-
688  printMessage(msg4);
-
689  }
-
690 
-
691  else if (nm == 5)
-
692  {
-
693  printMessage(msg5);
-
694  }
-
695 
-
696  else if (nm == 6)
-
697  {
-
698  printMessage(msg6);
-
699  }
-
700  }
-
701  else if (boat == 2)
-
702  {
-
703  if (nm == 1)
-
704  {
-
705  printMessage(msg7);
-
706  }
-
707  else if (nm == 2)
-
708  {
-
709  printMessage(msg8);
-
710  }
-
711  else if (nm == 3)
-
712  {
-
713  printMessage(msg9);
-
714  }
-
715  else if (nm == 4)
-
716  {
-
717  printMessage(msg10);
-
718  }
-
719  }
-
720  else if (boat == 3)
-
721  {
-
722  if (nm == 1)
-
723  {
-
724  printMessage(msg11);
-
725  }
-
726  if (nm == 2)
-
727  {
-
728  printMessage(msg12);
-
729  }
-
730  }
-
731  }
-
732 
-
733  if (Player == 2)
-
734  {
-
735  char msg1[60] = "Player 2 - Position the size boat 1 (1/6)";
-
736  char msg2[60] = "Player 2 - Position the size boat 1 (2/6)";
-
737  char msg3[60] = "Player 2 - Position the size boat 1 (3/6)";
-
738  char msg4[60] = "Player 2 - Position the size boat 1 (4/6)";
-
739  char msg5[60] = "Player 2 - Position the size boat 1 (5/6)";
-
740  char msg6[60] = "Player 2 - Position the size boat 1 (6/6)";
-
741 
-
742  char msg7[60] = "Player 2 - Position the size boat 2 (1/4)";
-
743  char msg8[60] = "Player 2 - Position the size boat 2 (2/4)";
-
744  char msg9[60] = "Player 2 - Position the size boat 2 (3/4)";
-
745  char msg10[60] = "Player 2 - Position the size boat 2 (4/4)";
-
746 
-
747  char msg11[60] = "Player 2 - Position the size boat 3 (1/2)";
-
748  char msg12[60] = "Player 2 - Position the size boat 3 (2/2)";
-
749 
-
750  if (boat == 1)
-
751  {
-
752  if (nm == 1)
-
753  {
-
754  printMessage(msg1);
-
755  }
-
756  else if (nm == 2)
-
757  {
-
758  printMessage(msg2);
-
759  }
-
760  else if (nm == 3)
-
761  {
-
762  printMessage(msg3);
-
763  }
-
764  else if (nm == 4)
-
765  {
-
766  printMessage(msg4);
-
767  }
-
768  else if (nm == 5)
-
769  {
-
770  printMessage(msg5);
-
771  }
-
772  else if (nm == 6)
-
773  {
-
774  printMessage(msg6);
-
775  }
-
776  }
-
777  else if (boat == 2)
-
778  {
-
779  if (nm == 1)
-
780  {
-
781  printMessage(msg7);
-
782  }
-
783  else if (nm == 2)
-
784  {
-
785  printMessage(msg8);
-
786  }
-
787  else if (nm == 3)
-
788  {
-
789  printMessage(msg9);
-
790  }
-
791  else if (nm == 4)
-
792  {
-
793  printMessage(msg10);
-
794  }
-
795  }
-
796  else if (boat == 3)
-
797  {
-
798  if (nm == 1)
-
799  {
-
800  printMessage(msg11);
-
801  }
-
802  else if (nm == 2)
-
803  {
-
804  printMessage(msg12);
-
805  }
-
806  }
-
807  }
-
808 }
+
653{
+
654 if (Player == 1)
+
655 {
+
656 char msg1[60] = "Player 1 - Position the size boat 1 (1/6)";
+
657 char msg2[60] = "Player 1 - Position the size boat 1 (2/6)";
+
658 char msg3[60] = "Player 1 - Position the size boat 1 (3/6)";
+
659 char msg4[60] = "Player 1 - Position the size boat 1 (4/6)";
+
660 char msg5[60] = "Player 1 - Position the size boat 1 (5/6)";
+
661 char msg6[60] = "Player 1 - Position the size boat 1 (6/6)";
+
662
+
663 char msg7[60] = "Player 1 - Position the size boat 2 (1/4)";
+
664 char msg8[60] = "Player 1 - Position the size boat 2 (2/4)";
+
665 char msg9[60] = "Player 1 - Position the size boat 2 (3/4)";
+
666 char msg10[60] = "Player 1 - Position the size boat 2 (4/4)";
+
667
+
668 char msg11[60] = "Player 1 - Position the size boat 3 (1/2)";
+
669 char msg12[60] = "Player 1 - Position the size boat 3 (2/2)";
+
670
+
671 if (boat == 1)
+
672 {
+
673 if (nm == 1)
+
674 {
+
675 printMessage(msg1);
+
676 }
+
677 else if (nm == 2)
+
678 {
+
679 printMessage(msg2);
+
680 }
+
681 else if (nm == 3)
+
682 {
+
683 printMessage(msg3);
+
684 }
+
685
+
686 else if (nm == 4)
+
687 {
+
688 printMessage(msg4);
+
689 }
+
690
+
691 else if (nm == 5)
+
692 {
+
693 printMessage(msg5);
+
694 }
+
695
+
696 else if (nm == 6)
+
697 {
+
698 printMessage(msg6);
+
699 }
+
700 }
+
701 else if (boat == 2)
+
702 {
+
703 if (nm == 1)
+
704 {
+
705 printMessage(msg7);
+
706 }
+
707 else if (nm == 2)
+
708 {
+
709 printMessage(msg8);
+
710 }
+
711 else if (nm == 3)
+
712 {
+
713 printMessage(msg9);
+
714 }
+
715 else if (nm == 4)
+
716 {
+
717 printMessage(msg10);
+
718 }
+
719 }
+
720 else if (boat == 3)
+
721 {
+
722 if (nm == 1)
+
723 {
+
724 printMessage(msg11);
+
725 }
+
726 if (nm == 2)
+
727 {
+
728 printMessage(msg12);
+
729 }
+
730 }
+
731 }
+
732
+
733 if (Player == 2)
+
734 {
+
735 char msg1[60] = "Player 2 - Position the size boat 1 (1/6)";
+
736 char msg2[60] = "Player 2 - Position the size boat 1 (2/6)";
+
737 char msg3[60] = "Player 2 - Position the size boat 1 (3/6)";
+
738 char msg4[60] = "Player 2 - Position the size boat 1 (4/6)";
+
739 char msg5[60] = "Player 2 - Position the size boat 1 (5/6)";
+
740 char msg6[60] = "Player 2 - Position the size boat 1 (6/6)";
+
741
+
742 char msg7[60] = "Player 2 - Position the size boat 2 (1/4)";
+
743 char msg8[60] = "Player 2 - Position the size boat 2 (2/4)";
+
744 char msg9[60] = "Player 2 - Position the size boat 2 (3/4)";
+
745 char msg10[60] = "Player 2 - Position the size boat 2 (4/4)";
+
746
+
747 char msg11[60] = "Player 2 - Position the size boat 3 (1/2)";
+
748 char msg12[60] = "Player 2 - Position the size boat 3 (2/2)";
+
749
+
750 if (boat == 1)
+
751 {
+
752 if (nm == 1)
+
753 {
+
754 printMessage(msg1);
+
755 }
+
756 else if (nm == 2)
+
757 {
+
758 printMessage(msg2);
+
759 }
+
760 else if (nm == 3)
+
761 {
+
762 printMessage(msg3);
+
763 }
+
764 else if (nm == 4)
+
765 {
+
766 printMessage(msg4);
+
767 }
+
768 else if (nm == 5)
+
769 {
+
770 printMessage(msg5);
+
771 }
+
772 else if (nm == 6)
+
773 {
+
774 printMessage(msg6);
+
775 }
+
776 }
+
777 else if (boat == 2)
+
778 {
+
779 if (nm == 1)
+
780 {
+
781 printMessage(msg7);
+
782 }
+
783 else if (nm == 2)
+
784 {
+
785 printMessage(msg8);
+
786 }
+
787 else if (nm == 3)
+
788 {
+
789 printMessage(msg9);
+
790 }
+
791 else if (nm == 4)
+
792 {
+
793 printMessage(msg10);
+
794 }
+
795 }
+
796 else if (boat == 3)
+
797 {
+
798 if (nm == 1)
+
799 {
+
800 printMessage(msg11);
+
801 }
+
802 else if (nm == 2)
+
803 {
+
804 printMessage(msg12);
+
805 }
+
806 }
+
807 }
+
808}
Here is the call graph for this function:
-
+
- +

◆ printsTray()

@@ -1122,65 +1121,65 @@ Here is the call graph for this function:
-
356 {
-
357  int logic;
-
358  char imp;
-
359 
-
360  printf(" ");
-
361  for (int i = 65; i < 75; i++)
-
362  {
-
363  printf("%c", i);
-
364  if (i < 74)
-
365  {
-
366  printf(" ");
-
367  }
-
368  }
-
369  printf("\n");
-
370 
-
371  for (int i = 0; i < 12; i++)
-
372  {
-
373  if (i > 0 && i < 11)
-
374  {
-
375  printf("%02d ", i);
-
376  }
-
377 
-
378  else
-
379  {
-
380  printf(" ");
-
381  }
-
382 
-
383  for (int j = 0; j < 12; j++)
-
384  {
-
385  if ((i > 0 && i < 11) && (j > 0 && j < 11))
-
386  {
-
387  logic = mat[i - 1][j - 1];
-
388  imp = printTable(logic, stage);
-
389  printf("%c", imp);
-
390  }
-
391  else
-
392  {
-
393  printf("#");
-
394  }
-
395 
-
396  if (j < 11)
-
397  {
-
398  printf(" ");
-
399  }
-
400  }
-
401  printf("\n");
-
402  }
-
403 }
+
356{
+
357 int logic;
+
358 char imp;
+
359
+
360 printf(" ");
+
361 for (int i = 65; i < 75; i++)
+
362 {
+
363 printf("%c", i);
+
364 if (i < 74)
+
365 {
+
366 printf(" ");
+
367 }
+
368 }
+
369 printf("\n");
+
370
+
371 for (int i = 0; i < 12; i++)
+
372 {
+
373 if (i > 0 && i < 11)
+
374 {
+
375 printf("%02d ", i);
+
376 }
+
377
+
378 else
+
379 {
+
380 printf(" ");
+
381 }
+
382
+
383 for (int j = 0; j < 12; j++)
+
384 {
+
385 if ((i > 0 && i < 11) && (j > 0 && j < 11))
+
386 {
+
387 logic = mat[i - 1][j - 1];
+
388 imp = printTable(logic, stage);
+
389 printf("%c", imp);
+
390 }
+
391 else
+
392 {
+
393 printf("#");
+
394 }
+
395
+
396 if (j < 11)
+
397 {
+
398 printf(" ");
+
399 }
+
400 }
+
401 printf("\n");
+
402 }
+
403}
char printTable(int logic, int stage)
Function printTable Responsible for printing the board.
Definition: naval_battle.c:296
Here is the call graph for this function:
-
+
- +

◆ printTable()

@@ -1215,62 +1214,62 @@ Here is the call graph for this function:
Returns
char for visual matrix
-
297 {
-
298  if (stage == 0)
-
299  {
-
300  if (logic == 0)
-
301  {
-
302  return '.';
-
303  }
-
304 
-
305  else if (logic == -1)
-
306  {
-
307  return '*';
-
308  }
-
309 
-
310  else if (logic == 1)
-
311  {
-
312  return '1';
-
313  }
-
314 
-
315  else if (logic == 2)
-
316  {
-
317  return '2';
-
318  }
-
319 
-
320  else
-
321  {
-
322  return '3';
-
323  }
-
324  }
-
325 
-
326  else
-
327  {
-
328  if (logic == 0 || logic == -1 || logic == 1 || logic == 2 || logic == 3)
-
329  {
-
330  return '.';
-
331  }
-
332 
-
333  else if (logic == -2)
-
334  {
-
335  return 'x';
-
336  }
-
337 
-
338  else if (logic == 10 || logic == 20 || logic == 30)
-
339  {
-
340  return 'N';
-
341  }
-
342 
-
343  else
-
344  {
-
345  return 'A';
-
346  }
-
347  }
-
348 }
+
297{
+
298 if (stage == 0)
+
299 {
+
300 if (logic == 0)
+
301 {
+
302 return '.';
+
303 }
+
304
+
305 else if (logic == -1)
+
306 {
+
307 return '*';
+
308 }
+
309
+
310 else if (logic == 1)
+
311 {
+
312 return '1';
+
313 }
+
314
+
315 else if (logic == 2)
+
316 {
+
317 return '2';
+
318 }
+
319
+
320 else
+
321 {
+
322 return '3';
+
323 }
+
324 }
+
325
+
326 else
+
327 {
+
328 if (logic == 0 || logic == -1 || logic == 1 || logic == 2 || logic == 3)
+
329 {
+
330 return '.';
+
331 }
+
332
+
333 else if (logic == -2)
+
334 {
+
335 return 'x';
+
336 }
+
337
+
338 else if (logic == 10 || logic == 20 || logic == 30)
+
339 {
+
340 return 'N';
+
341 }
+
342
+
343 else
+
344 {
+
345 return 'A';
+
346 }
+
347 }
+
348}
- +

◆ shoot()

@@ -1311,31 +1310,31 @@ Here is the call graph for this function:
-
412 {
-
413  if (mat[line][column] == 0 || mat[line][column] == -1)
-
414  {
-
415  mat[line][column] = -2;
-
416  }
-
417 
-
418  else if (mat[line][column] == 1)
-
419  {
-
420  mat[line][column] = 10;
-
421  }
-
422 
-
423  else if (mat[line][column] == 2)
-
424  {
-
425  mat[line][column] = 20;
-
426  }
-
427 
-
428  else if (mat[line][column] == 3)
-
429  {
-
430  mat[line][column] = 30;
-
431  }
-
432 }
+
412{
+
413 if (mat[line][column] == 0 || mat[line][column] == -1)
+
414 {
+
415 mat[line][column] = -2;
+
416 }
+
417
+
418 else if (mat[line][column] == 1)
+
419 {
+
420 mat[line][column] = 10;
+
421 }
+
422
+
423 else if (mat[line][column] == 2)
+
424 {
+
425 mat[line][column] = 20;
+
426 }
+
427
+
428 else if (mat[line][column] == 3)
+
429 {
+
430 mat[line][column] = 30;
+
431 }
+
432}
- +

◆ validatePosition()

@@ -1390,63 +1389,63 @@ Here is the call graph for this function:
Returns
if the position is valid
-
45 {
-
46  int cont = 0;
-
47  int i, j;
-
48 
-
49  if (line < 0 || line > 9 || column < 0 || column > 9 ||
-
50  (guide != 'H' && guide != 'V') || boat < 1 || boat > 3)
-
51  {
-
52  return 0;
-
53  }
-
54 
-
55  if (guide == 'H')
-
56  {
-
57  if ((10 - column) < boat)
-
58  {
-
59  return 0;
-
60  }
-
61  else
-
62  {
-
63  for (j = column; j < (column + boat); j++)
-
64  {
-
65  if (mat[line][j] == 0)
-
66  {
-
67  cont++;
-
68  }
-
69  }
-
70  }
-
71  }
-
72 
-
73  if (guide == 'V')
-
74  {
-
75  if ((10 - line) < boat)
-
76  {
-
77  return 0;
-
78  }
-
79 
-
80  else
-
81  {
-
82  for (i = line; i < (line + boat); i++)
-
83  {
-
84  if (mat[i][column] == 0)
-
85  {
-
86  cont++;
-
87  }
-
88  }
-
89  }
-
90  }
-
91 
-
92  if (cont == boat)
-
93  {
-
94  return 1;
-
95  }
-
96  return 0;
-
97 }
+
45{
+
46 int cont = 0;
+
47 int i, j;
+
48
+
49 if (line < 0 || line > 9 || column < 0 || column > 9 ||
+
50 (guide != 'H' && guide != 'V') || boat < 1 || boat > 3)
+
51 {
+
52 return 0;
+
53 }
+
54
+
55 if (guide == 'H')
+
56 {
+
57 if ((10 - column) < boat)
+
58 {
+
59 return 0;
+
60 }
+
61 else
+
62 {
+
63 for (j = column; j < (column + boat); j++)
+
64 {
+
65 if (mat[line][j] == 0)
+
66 {
+
67 cont++;
+
68 }
+
69 }
+
70 }
+
71 }
+
72
+
73 if (guide == 'V')
+
74 {
+
75 if ((10 - line) < boat)
+
76 {
+
77 return 0;
+
78 }
+
79
+
80 else
+
81 {
+
82 for (i = line; i < (line + boat); i++)
+
83 {
+
84 if (mat[i][column] == 0)
+
85 {
+
86 cont++;
+
87 }
+
88 }
+
89 }
+
90 }
+
91
+
92 if (cont == boat)
+
93 {
+
94 return 1;
+
95 }
+
96 return 0;
+
97}
- +

◆ validEntryLineColumn()

@@ -1473,7 +1472,7 @@ Here is the call graph for this function:

for Standard Input Output

-

Function validEntryLineColumn Responsible for validating entries, for positioning boats

Parameters
+

Function validEntryLineColumn Responsible for validating entries, for positioning boats

Parameters
@@ -1481,14 +1480,14 @@ Here is the call graph for this function:
Returns
if the row and column are valid
-
26 {
-
27  if ((line >= 1 && line <= 10) && (column >= 65 && column <= 74))
-
28  {
-
29  return 1;
-
30  }
-
31 
-
32  return 0;
-
33 }
+
26{
+
27 if ((line >= 1 && line <= 10) && (column >= 65 && column <= 74))
+
28 {
+
29 return 1;
+
30 }
+
31
+
32 return 0;
+
33}
@@ -1498,7 +1497,7 @@ Here is the call graph for this function: diff --git a/db/de2/naval__battle_8c_a3f7d3dc5931fba6164e73057859094d9_cgraph.map b/db/de2/naval__battle_8c_a3f7d3dc5931fba6164e73057859094d9_cgraph.map index 264d52548..6147a73e5 100644 --- a/db/de2/naval__battle_8c_a3f7d3dc5931fba6164e73057859094d9_cgraph.map +++ b/db/de2/naval__battle_8c_a3f7d3dc5931fba6164e73057859094d9_cgraph.map @@ -1,5 +1,5 @@ - - - + + + diff --git a/db/de2/naval__battle_8c_a3f7d3dc5931fba6164e73057859094d9_cgraph.svg b/db/de2/naval__battle_8c_a3f7d3dc5931fba6164e73057859094d9_cgraph.svg index a8a7f799c..5c184a6b3 100644 --- a/db/de2/naval__battle_8c_a3f7d3dc5931fba6164e73057859094d9_cgraph.svg +++ b/db/de2/naval__battle_8c_a3f7d3dc5931fba6164e73057859094d9_cgraph.svg @@ -1,20 +1,20 @@ - - + positionBoat - + Node1 - -positionBoat + +positionBoat @@ -22,31 +22,31 @@ Node2 - -validatePosition + +validatePosition Node1->Node2 - - + + Node3 - -validEntryLineColumn + +validEntryLineColumn Node1->Node3 - - + + diff --git a/db/de2/naval__battle_8c_a5c84d83e31ca6a320b6ea8081402686a_cgraph.map b/db/de2/naval__battle_8c_a5c84d83e31ca6a320b6ea8081402686a_cgraph.map index b49808567..07f45553c 100644 --- a/db/de2/naval__battle_8c_a5c84d83e31ca6a320b6ea8081402686a_cgraph.map +++ b/db/de2/naval__battle_8c_a5c84d83e31ca6a320b6ea8081402686a_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/db/de2/naval__battle_8c_a5c84d83e31ca6a320b6ea8081402686a_cgraph.svg b/db/de2/naval__battle_8c_a5c84d83e31ca6a320b6ea8081402686a_cgraph.svg index 3efa8e3be..2c3450b77 100644 --- a/db/de2/naval__battle_8c_a5c84d83e31ca6a320b6ea8081402686a_cgraph.svg +++ b/db/de2/naval__battle_8c_a5c84d83e31ca6a320b6ea8081402686a_cgraph.svg @@ -1,20 +1,20 @@ - - + printPositioning - + Node1 - -printPositioning + +printPositioning @@ -22,16 +22,16 @@ Node2 - -printMessage + +printMessage Node1->Node2 - - + + diff --git a/db/de2/naval__battle_8c_ad527fa96e729742a231c4535e112526a_cgraph.map b/db/de2/naval__battle_8c_ad527fa96e729742a231c4535e112526a_cgraph.map index 44b7387a5..1c87df6ab 100644 --- a/db/de2/naval__battle_8c_ad527fa96e729742a231c4535e112526a_cgraph.map +++ b/db/de2/naval__battle_8c_ad527fa96e729742a231c4535e112526a_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/db/de2/naval__battle_8c_ad527fa96e729742a231c4535e112526a_cgraph.svg b/db/de2/naval__battle_8c_ad527fa96e729742a231c4535e112526a_cgraph.svg index 98f898301..c6969f209 100644 --- a/db/de2/naval__battle_8c_ad527fa96e729742a231c4535e112526a_cgraph.svg +++ b/db/de2/naval__battle_8c_ad527fa96e729742a231c4535e112526a_cgraph.svg @@ -1,20 +1,20 @@ - - + printsTray - + Node1 - -printsTray + +printsTray @@ -22,16 +22,16 @@ Node2 - -printTable + +printTable Node1->Node2 - - + + diff --git a/db/de2/naval__battle_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/db/de2/naval__battle_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map index 808393799..725ab83f2 100644 --- a/db/de2/naval__battle_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map +++ b/db/de2/naval__battle_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -1,14 +1,14 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/db/de2/naval__battle_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/db/de2/naval__battle_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index d0ca6dff1..d40089da2 100644 --- a/db/de2/naval__battle_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/db/de2/naval__battle_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,14 +1,14 @@ - - + main - + Node1 @@ -22,178 +22,178 @@ Node2 - -calculateScore + +calculateScore Node1->Node2 - - + + Node3 - -canShoot + +canShoot Node1->Node3 - - + + Node4 - -positionBoat + +positionBoat Node1->Node4 - - + + Node6 - -validEntryLineColumn + +validEntryLineColumn Node1->Node6 - - + + Node7 - -printMessage + +printMessage Node1->Node7 - - + + Node8 - -printMessageScore + +printMessageScore Node1->Node8 - - + + Node9 - -printPositioning + +printPositioning Node1->Node9 - - + + Node10 - -printsTray + +printsTray Node1->Node10 - - + + Node12 - -shoot + +shoot Node1->Node12 - - + + Node5 - -validatePosition + +validatePosition Node4->Node5 - - + + Node4->Node6 - - + + Node9->Node7 - - + + Node11 - -printTable + +printTable Node10->Node11 - - + + diff --git a/db/def/decimal__to__binary__recursion_8c__incl.map b/db/def/decimal__to__binary__recursion_8c__incl.map index 8c3e927db..058856978 100644 --- a/db/def/decimal__to__binary__recursion_8c__incl.map +++ b/db/def/decimal__to__binary__recursion_8c__incl.map @@ -1,4 +1,4 @@ - - + + diff --git a/db/def/decimal__to__binary__recursion_8c__incl.svg b/db/def/decimal__to__binary__recursion_8c__incl.svg index ee22073fc..f3bf017cd 100644 --- a/db/def/decimal__to__binary__recursion_8c__incl.svg +++ b/db/def/decimal__to__binary__recursion_8c__incl.svg @@ -1,21 +1,21 @@ - - + conversions/decimal_to_binary_recursion.c - + Node1 - + conversions/decimal -_to_binary_recursion.c +_to_binary_recursion.c @@ -23,16 +23,16 @@ Node2 - -assert.h + +assert.h Node1->Node2 - - + + diff --git a/db/dff/durand__kerner__roots_8c__incl.map b/db/dff/durand__kerner__roots_8c__incl.map index 60a242ed4..4982a7a03 100644 --- a/db/dff/durand__kerner__roots_8c__incl.map +++ b/db/dff/durand__kerner__roots_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/db/dff/durand__kerner__roots_8c__incl.svg b/db/dff/durand__kerner__roots_8c__incl.svg index de3ef5651..09e4156bc 100644 --- a/db/dff/durand__kerner__roots_8c__incl.svg +++ b/db/dff/durand__kerner__roots_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - -numerical_methods/durand + +numerical_methods/durand _kerner_roots.c diff --git a/dc/d18/structsudoku.html b/dc/d18/structsudoku.html index 6df275617..23f8c1fe6 100644 --- a/dc/d18/structsudoku.html +++ b/dc/d18/structsudoku.html @@ -2,8 +2,8 @@ - - + +Algorithms_in_C: sudoku Struct Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ @@ -42,21 +41,22 @@
linematrix row
columnmatrix column
-
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,31 +92,30 @@ $(document).ready(function(){initNavTree('dc/d18/structsudoku.html','../../'); i
-
-
sudoku Struct Reference
+
sudoku Struct Reference

Structure to hold the matrix and dimensions. More...

- - + - + - +

+

Data Fields

-uint8_t * a
+uint8_t * a
 matrix as a flattened 1D row-major array
 
-uint8_t N
+uint8_t N
 number of elements
 
-uint8_t N2
+uint8_t N2
 block of elements
 

Detailed Description

-

Structure to hold the matrix and dimensions.

+

Structure to hold the matrix and dimensions.


The documentation for this struct was generated from the following file: @@ -126,7 +125,7 @@ uint8_t 
    - +
diff --git a/dc/d23/problem__23_2sol2_8c__incl.map b/dc/d23/problem__23_2sol2_8c__incl.map index 41401ac6e..5e50d0ea7 100644 --- a/dc/d23/problem__23_2sol2_8c__incl.map +++ b/dc/d23/problem__23_2sol2_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/dc/d23/problem__23_2sol2_8c__incl.svg b/dc/d23/problem__23_2sol2_8c__incl.svg index 022f75a4e..660101205 100644 --- a/dc/d23/problem__23_2sol2_8c__incl.svg +++ b/dc/d23/problem__23_2sol2_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - -project_euler/problem + +project_euler/problem _23/sol2.c diff --git a/dc/d2e/lu__decompose_8c.html b/dc/d2e/lu__decompose_8c.html index 23c0641ea..588f50dc9 100644 --- a/dc/d2e/lu__decompose_8c.html +++ b/dc/d2e/lu__decompose_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: numerical_methods/lu_decompose.c 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/d2e/lu__decompose_8c.html','../../'
-
-
lu_decompose.c File Reference
+
lu_decompose.c File Reference
-

LU decomposition of a square matrix +

LU decomposition of a square matrix More...

#include <stdio.h>
#include <stdlib.h>
@@ -109,25 +108,63 @@ Include dependency graph for lu_decompose.c:
- - - + + - - + +

+

Functions

int lu_decomposition (double **A, double **L, double **U, int mat_size)
 Perform LU decomposition on matrix. More...
 
-void display (double **A, int N)
 Function to display square matrix.
void display (double **A, int N)
 Function to display square matrix. More...
 
-int main (int argc, char **argv)
 Main function.
int main (int argc, char **argv)
 Main function. More...
 

Detailed Description

-

LU decomposition of a square matrix

-
Author
Krishna Vedala
+

LU decomposition of a square matrix

+
Author
Krishna Vedala

Function Documentation

- + +

◆ display()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void display (double ** A,
int N 
)
+
+ +

Function to display square matrix.

+
67{
+
68 for (int i = 0; i < N; i++)
+
69 {
+
70 for (int j = 0; j < N; j++)
+
71 {
+
72 printf("% 3.3g \t", A[i][j]);
+
73 }
+
74 putchar('\n');
+
75 }
+
76}
+
+
+
+

◆ lu_decomposition()

@@ -175,51 +212,140 @@ int 
21 {
-
22  int row, col, j;
-
23 
-
24  // regularize each row
-
25  for (row = 0; row < mat_size; row++)
-
26  {
-
27  // Upper triangular matrix
-
28 #ifdef _OPENMP
-
29 #pragma omp for
-
30 #endif
-
31  for (col = row; col < mat_size; col++)
-
32  {
-
33  // Summation of L[i,j] * U[j,k]
-
34  double lu_sum = 0.;
-
35  for (j = 0; j < row; j++) lu_sum += L[row][j] * U[j][col];
-
36 
-
37  // Evaluate U[i,k]
-
38  U[row][col] = A[row][col] - lu_sum;
-
39  }
-
40 
-
41  // Lower triangular matrix
-
42 #ifdef _OPENMP
-
43 #pragma omp for
-
44 #endif
-
45  for (col = row; col < mat_size; col++)
-
46  {
-
47  if (row == col)
-
48  {
-
49  L[row][col] = 1.;
-
50  continue;
-
51  }
-
52 
-
53  // Summation of L[i,j] * U[j,k]
-
54  double lu_sum = 0.;
-
55  for (j = 0; j < row; j++) lu_sum += L[col][j] * U[j][row];
-
56 
-
57  // Evaluate U[i,k]
-
58  L[col][row] = (A[col][row] - lu_sum) / U[row][row];
-
59  }
-
60  }
-
61 
-
62  return 0;
-
63 }
+
21{
+
22 int row, col, j;
+
23
+
24 // regularize each row
+
25 for (row = 0; row < mat_size; row++)
+
26 {
+
27 // Upper triangular matrix
+
28#ifdef _OPENMP
+
29#pragma omp for
+
30#endif
+
31 for (col = row; col < mat_size; col++)
+
32 {
+
33 // Summation of L[i,j] * U[j,k]
+
34 double lu_sum = 0.;
+
35 for (j = 0; j < row; j++) lu_sum += L[row][j] * U[j][col];
+
36
+
37 // Evaluate U[i,k]
+
38 U[row][col] = A[row][col] - lu_sum;
+
39 }
+
40
+
41 // Lower triangular matrix
+
42#ifdef _OPENMP
+
43#pragma omp for
+
44#endif
+
45 for (col = row; col < mat_size; col++)
+
46 {
+
47 if (row == col)
+
48 {
+
49 L[row][col] = 1.;
+
50 continue;
+
51 }
+
52
+
53 // Summation of L[i,j] * U[j,k]
+
54 double lu_sum = 0.;
+
55 for (j = 0; j < row; j++) lu_sum += L[col][j] * U[j][row];
+
56
+
57 // Evaluate U[i,k]
+
58 L[col][row] = (A[col][row] - lu_sum) / U[row][row];
+
59 }
+
60 }
+
61
+
62 return 0;
+
63}
Definition: list.h:8
+
+
+ +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char ** argv 
)
+
+ +

Main function.

+
80{
+
81 int mat_size = 3; // default matrix size
+
82 const int range = 10;
+
83 const int range2 = range >> 1;
+
84
+
85 if (argc == 2)
+
86 mat_size = atoi(argv[1]);
+
87
+
88 srand(time(NULL)); // random number initializer
+
89
+
90 /* Create a square matrix with random values */
+
91 double **A = (double **)malloc(mat_size * sizeof(double *));
+
92 double **L = (double **)malloc(mat_size * sizeof(double *)); // output
+
93 double **U = (double **)malloc(mat_size * sizeof(double *)); // output
+
94 for (int i = 0; i < mat_size; i++)
+
95 {
+
96 // calloc so that all valeus are '0' by default
+
97 A[i] = (double *)calloc(mat_size, sizeof(double));
+
98 L[i] = (double *)calloc(mat_size, sizeof(double));
+
99 U[i] = (double *)calloc(mat_size, sizeof(double));
+
100 for (int j = 0; j < mat_size; j++)
+
101 /* create random values in the limits [-range2, range-1] */
+
102 A[i][j] = (double)(rand() % range - range2);
+
103 }
+
104
+
105 lu_decomposition(A, L, U, mat_size);
+
106
+
107 printf("A = \n");
+
108 display(A, mat_size);
+
109 printf("\nL = \n");
+
110 display(L, mat_size);
+
111 printf("\nU = \n");
+
112 display(U, mat_size);
+
113
+
114 /* Free dynamically allocated memory */
+
115 for (int i = 0; i < mat_size; i++)
+
116 {
+
117 free(A[i]);
+
118 free(L[i]);
+
119 free(U[i]);
+
120 }
+
121 free(A);
+
122 free(L);
+
123 free(U);
+
124
+
125 return 0;
+
126}
+
void display(double **A, int N)
Function to display square matrix.
Definition: lu_decompose.c:66
+
int lu_decomposition(double **A, double **L, double **U, int mat_size)
Perform LU decomposition on matrix.
Definition: lu_decompose.c:20
+
#define malloc(bytes)
This macro replace the standard malloc function with malloc_dbg.
Definition: malloc_dbg.h:18
+
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
+
#define calloc(elemCount, elemSize)
This macro replace the standard calloc function with calloc_dbg.
Definition: malloc_dbg.h:22
+
Definition: prime_factoriziation.c:25
+
+Here is the call graph for this function:
+
+
+
+
+
@@ -228,7 +354,7 @@ int  diff --git a/dc/d2e/lu__decompose_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map b/dc/d2e/lu__decompose_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map new file mode 100644 index 000000000..1623eaf85 --- /dev/null +++ b/dc/d2e/lu__decompose_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/dc/d2e/lu__decompose_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 b/dc/d2e/lu__decompose_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 new file mode 100644 index 000000000..cd2143b16 --- /dev/null +++ b/dc/d2e/lu__decompose_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 @@ -0,0 +1 @@ +383e7fc803b53313f94b4bc589d45c4e \ No newline at end of file diff --git a/dc/d2e/lu__decompose_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg b/dc/d2e/lu__decompose_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg new file mode 100644 index 000000000..64e7a812f --- /dev/null +++ b/dc/d2e/lu__decompose_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg @@ -0,0 +1,52 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +display + + + + + +Node1->Node2 + + + + + +Node3 + + +lu_decomposition + + + + + +Node1->Node3 + + + + + diff --git a/dc/d32/problem__5_2sol1_8c.html b/dc/d32/problem__5_2sol1_8c.html index 7ca34600d..2bf3c8c54 100644 --- a/dc/d32/problem__5_2sol1_8c.html +++ b/dc/d32/problem__5_2sol1_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_5/sol1.c 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,23 +92,22 @@ $(document).ready(function(){initNavTree('dc/d32/problem__5_2sol1_8c.html','../.
-
-
sol1.c File Reference
+
sol1.c File Reference
-

Problem 5 solution - Naive algorithm (slowest) +

Problem 5 solution - Naive algorithm (slowest) More...

#include <stdio.h>
#include <stdlib.h>
Include dependency graph for sol1.c:
-
+
- @@ -118,12 +117,12 @@ Functions

+

Functions

static char check_number (unsigned long long n)
 Pretty naive implementation. More...
 

Detailed Description

-

Problem 5 solution - Naive algorithm (slowest)

+

Problem 5 solution - Naive algorithm (slowest)

See also
Faster: problem_5/sol2.c
Fastest: problem_5/sol3.c

Function Documentation

- +

◆ check_number()

@@ -148,7 +147,7 @@ Fastest:

Pretty naive implementation.

-

Just checks every number if it's devisable by 1 through 20

Parameters
+

Just checks every number if it's devisable by 1 through 20

Parameters
nnumber to check
@@ -157,21 +156,21 @@ Fastest:
Returns
0 if not divisible
1 if divisible
-
19 {
-
20  for (unsigned long long i = 1; i <= 20; ++i)
-
21  {
-
22  if (n % i != 0)
-
23  {
-
24  return 0;
-
25  }
-
26  }
-
27 
-
28  return 1;
-
29 }
+
19{
+
20 for (unsigned long long i = 1; i <= 20; ++i)
+
21 {
+
22 if (n % i != 0)
+
23 {
+
24 return 0;
+
25 }
+
26 }
+
27
+
28 return 1;
+
29}
- +

◆ main()

@@ -189,23 +188,23 @@ Fastest:
Returns
0 on exit
-
37 {
-
38  for (unsigned long long n = 1;; ++n)
-
39  {
-
40  if (check_number(n))
-
41  {
-
42  printf("Result: %llu\n", n);
-
43  break;
-
44  }
-
45  }
-
46 
-
47  return 0;
-
48 }
+
37{
+
38 for (unsigned long long n = 1;; ++n)
+
39 {
+
40 if (check_number(n))
+
41 {
+
42 printf("Result: %llu\n", n);
+
43 break;
+
44 }
+
45 }
+
46
+
47 return 0;
+
48}
static char check_number(unsigned long long n)
Pretty naive implementation.
Definition: sol1.c:18
Here is the call graph for this function:
-
+
@@ -217,7 +216,7 @@ Here is the call graph for this function:
diff --git a/dc/d32/problem__5_2sol1_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map b/dc/d32/problem__5_2sol1_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map index 0c780abf8..43e46e15a 100644 --- a/dc/d32/problem__5_2sol1_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map +++ b/dc/d32/problem__5_2sol1_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map @@ -1,4 +1,4 @@ - + diff --git a/dc/d32/problem__5_2sol1_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg b/dc/d32/problem__5_2sol1_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg index 89b8d2725..3af42325e 100644 --- a/dc/d32/problem__5_2sol1_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg +++ b/dc/d32/problem__5_2sol1_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg @@ -1,14 +1,14 @@ - - + main - + Node1 @@ -22,16 +22,16 @@ Node2 - -check_number + +check_number Node1->Node2 - - + + diff --git a/dc/d39/selection__sort__recursive_8c.html b/dc/d39/selection__sort__recursive_8c.html index 80c3110de..a81bcc837 100644 --- a/dc/d39/selection__sort__recursive_8c.html +++ b/dc/d39/selection__sort__recursive_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: sorting/selection_sort_recursive.c 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/d39/selection__sort__recursive_8c.h
-
-
selection_sort_recursive.c File Reference
+
selection_sort_recursive.c File Reference
-

Selection Sort implementation using recursion. +

Selection Sort implementation using recursion. More...

#include <assert.h>
#include <stdio.h>
@@ -111,7 +110,7 @@ Include dependency graph for selection_sort_recursive.c:
- @@ -130,10 +129,10 @@ Functions

+

Functions

void swap (int8_t *first, int8_t *second)
 for assert More...
 

Detailed Description

-

Selection Sort implementation using recursion.

-
Author
Dhruv Pasricha
+

Selection Sort implementation using recursion.

+
Author
Dhruv Pasricha

Function Documentation

- +

◆ findIndex()

@@ -168,27 +167,33 @@ Functions
Returns
min_index index of an element having a minimum value
-
33 {
-
34  if (size == 1)
-
35  {
-
36  return 0;
-
37  }
-
38 
-
39  // marking recursive call to reach starting element
-
40  uint8_t min_index = findIndex(arr, size - 1);
-
41 
-
42  if (arr[size - 1] < arr[min_index])
-
43  {
-
44  min_index = size - 1;
-
45  }
-
46 
-
47  return min_index;
-
48 }
+
33{
+
34 if (size == 1)
+
35 {
+
36 return 0;
+
37 }
+
38
+
39 // marking recursive call to reach starting element
+
40 uint8_t min_index = findIndex(arr, size - 1);
+
41
+
42 if (arr[size - 1] < arr[min_index])
+
43 {
+
44 min_index = size - 1;
+
45 }
+
46
+
47 return min_index;
+
48}
uint8_t findIndex(const int8_t *arr, const uint8_t size)
Returns the index having minimum value using recursion.
Definition: selection_sort_recursive.c:32
-
+
+Here is the call graph for this function:
+
+
- + +
+
+

◆ main()

@@ -206,24 +211,24 @@ Functions

Main function.

Returns
0 on exit
-
103 {
-
104  /* Intializes random number generator */
-
105  srand(time(NULL));
-
106 
-
107  test(); // run self-test implementations
-
108  return 0;
-
109 }
+
103{
+
104 /* Intializes random number generator */
+
105 srand(time(NULL));
+
106
+
107 test(); // run self-test implementations
+
108 return 0;
+
109}
static void test()
Self-test implementations.
Definition: selection_sort_recursive.c:80
Here is the call graph for this function:
-
+
- +

◆ selectionSort()

@@ -258,36 +263,36 @@ Here is the call graph for this function:
Returns
void
-
57 {
-
58  if (size <= 1)
-
59  {
-
60  return;
-
61  }
-
62 
-
63  /* findIndex(arr, size) returned the index having min value*/
-
64  uint8_t min_index = findIndex(arr, size);
-
65  /* arr[min_index] is the minimum value in the array*/
-
66 
-
67  if (min_index != 0)
-
68  {
-
69  swap(&arr[0], &arr[min_index]);
-
70  }
-
71 
-
72  /*sorted the remaining array recursively*/
-
73  selectionSort(arr + 1, size - 1);
-
74 }
+
57{
+
58 if (size <= 1)
+
59 {
+
60 return;
+
61 }
+
62
+
63 /* findIndex(arr, size) returned the index having min value*/
+
64 uint8_t min_index = findIndex(arr, size);
+
65 /* arr[min_index] is the minimum value in the array*/
+
66
+
67 if (min_index != 0)
+
68 {
+
69 swap(&arr[0], &arr[min_index]);
+
70 }
+
71
+
72 /*sorted the remaining array recursively*/
+
73 selectionSort(arr + 1, size - 1);
+
74}
void selectionSort(int8_t *arr, const uint8_t size)
Selection Sort algorithm implemented using recursion.
Definition: selection_sort_recursive.c:56
void swap(int8_t *first, int8_t *second)
for assert
Definition: selection_sort_recursive.c:19
Here is the call graph for this function:
-
+
- +

◆ swap()

@@ -314,23 +319,23 @@ Here is the call graph for this function:

for assert

-

for IO operations for dynamic memory allocation for random numbers generation for uint8_t, int8_t

-

Swapped two numbers using pointer

Parameters
+

for IO operations for dynamic memory allocation for random numbers generation for uint8_t, int8_t

+

Swapped two numbers using pointer

Parameters
firstpointer of first number
secondpointer of second number
-
20 {
-
21  int8_t temp = *first;
-
22  *first = *second;
-
23  *second = temp;
-
24 }
+
20{
+
21 int8_t temp = *first;
+
22 *first = *second;
+
23 *second = temp;
+
24}
- +

◆ test()

@@ -356,28 +361,28 @@ Here is the call graph for this function:

Self-test implementations.

Returns
void
-
81 {
-
82  const uint8_t size = 10;
-
83  int8_t *arr = (int8_t *)calloc(size, sizeof(int8_t));
-
84 
-
85  /* generate size random numbers from 0 to 100 */
-
86  for (uint8_t i = 0; i < size; i++)
-
87  {
-
88  arr[i] = rand() % 100;
-
89  }
-
90  selectionSort(arr, size);
-
91  for (uint8_t i = 0; i < size - 1; ++i)
-
92  {
-
93  assert(arr[i] <= arr[i + 1]);
-
94  }
-
95  free(arr);
-
96 }
+
81{
+
82 const uint8_t size = 10;
+
83 int8_t *arr = (int8_t *)calloc(size, sizeof(int8_t));
+
84
+
85 /* generate size random numbers from 0 to 100 */
+
86 for (uint8_t i = 0; i < size; i++)
+
87 {
+
88 arr[i] = rand() % 100;
+
89 }
+
90 selectionSort(arr, size);
+
91 for (uint8_t i = 0; i < size - 1; ++i)
+
92 {
+
93 assert(arr[i] <= arr[i + 1]);
+
94 }
+
95 free(arr);
+
96}
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
#define calloc(elemCount, elemSize)
This macro replace the standard calloc function with calloc_dbg.
Definition: malloc_dbg.h:22
Here is the call graph for this function:
-
+
@@ -389,7 +394,7 @@ Here is the call graph for this function:
diff --git a/dc/d39/selection__sort__recursive_8c_a3f04d850b94a34dcaaed0e7bc7475241_cgraph.map b/dc/d39/selection__sort__recursive_8c_a3f04d850b94a34dcaaed0e7bc7475241_cgraph.map index 7fc11bbb8..8529c90e9 100644 --- a/dc/d39/selection__sort__recursive_8c_a3f04d850b94a34dcaaed0e7bc7475241_cgraph.map +++ b/dc/d39/selection__sort__recursive_8c_a3f04d850b94a34dcaaed0e7bc7475241_cgraph.map @@ -1,5 +1,5 @@ - - - + + + diff --git a/dc/d39/selection__sort__recursive_8c_a3f04d850b94a34dcaaed0e7bc7475241_cgraph.md5 b/dc/d39/selection__sort__recursive_8c_a3f04d850b94a34dcaaed0e7bc7475241_cgraph.md5 index 97b7f3994..6c8d623de 100644 --- a/dc/d39/selection__sort__recursive_8c_a3f04d850b94a34dcaaed0e7bc7475241_cgraph.md5 +++ b/dc/d39/selection__sort__recursive_8c_a3f04d850b94a34dcaaed0e7bc7475241_cgraph.md5 @@ -1 +1 @@ -f4681c42b3e41fe9aed717f9d904df07 \ No newline at end of file +6ff54d33e366916b4fe9f6fbc2a70a7f \ No newline at end of file diff --git a/dc/d39/selection__sort__recursive_8c_a3f04d850b94a34dcaaed0e7bc7475241_cgraph.svg b/dc/d39/selection__sort__recursive_8c_a3f04d850b94a34dcaaed0e7bc7475241_cgraph.svg index 09c1d2574..c6f2d196d 100644 --- a/dc/d39/selection__sort__recursive_8c_a3f04d850b94a34dcaaed0e7bc7475241_cgraph.svg +++ b/dc/d39/selection__sort__recursive_8c_a3f04d850b94a34dcaaed0e7bc7475241_cgraph.svg @@ -1,14 +1,14 @@ - - - + + selectionSort - + Node1 @@ -18,35 +18,47 @@ + + +Node1->Node1 + + + Node2 - -findIndex + +findIndex Node1->Node2 - - + + Node3 - -swap + +swap - + Node1->Node3 - - + + + + + +Node2->Node2 + + diff --git a/dc/d39/selection__sort__recursive_8c_aa2bc8bdd2e8ce289a6b8ef528fd1a534_cgraph.map b/dc/d39/selection__sort__recursive_8c_aa2bc8bdd2e8ce289a6b8ef528fd1a534_cgraph.map new file mode 100644 index 000000000..9f61dd36d --- /dev/null +++ b/dc/d39/selection__sort__recursive_8c_aa2bc8bdd2e8ce289a6b8ef528fd1a534_cgraph.map @@ -0,0 +1,3 @@ + + + diff --git a/dc/d39/selection__sort__recursive_8c_aa2bc8bdd2e8ce289a6b8ef528fd1a534_cgraph.md5 b/dc/d39/selection__sort__recursive_8c_aa2bc8bdd2e8ce289a6b8ef528fd1a534_cgraph.md5 new file mode 100644 index 000000000..b77fee419 --- /dev/null +++ b/dc/d39/selection__sort__recursive_8c_aa2bc8bdd2e8ce289a6b8ef528fd1a534_cgraph.md5 @@ -0,0 +1 @@ +668bd1e72833328f9dc6136e65754bb2 \ No newline at end of file diff --git a/dc/d39/selection__sort__recursive_8c_aa2bc8bdd2e8ce289a6b8ef528fd1a534_cgraph.svg b/dc/d39/selection__sort__recursive_8c_aa2bc8bdd2e8ce289a6b8ef528fd1a534_cgraph.svg new file mode 100644 index 000000000..d24f24d81 --- /dev/null +++ b/dc/d39/selection__sort__recursive_8c_aa2bc8bdd2e8ce289a6b8ef528fd1a534_cgraph.svg @@ -0,0 +1,28 @@ + + + + + + +findIndex + + + +Node1 + + +findIndex + + + + + +Node1->Node1 + + + + + diff --git a/dc/d39/selection__sort__recursive_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map b/dc/d39/selection__sort__recursive_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map index 1ebb13bb3..2e6537ad1 100644 --- a/dc/d39/selection__sort__recursive_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map +++ b/dc/d39/selection__sort__recursive_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map @@ -1,6 +1,6 @@ - - - - + + + + diff --git a/dc/d39/selection__sort__recursive_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 b/dc/d39/selection__sort__recursive_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 index 3f6671633..6b5151513 100644 --- a/dc/d39/selection__sort__recursive_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 +++ b/dc/d39/selection__sort__recursive_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 @@ -1 +1 @@ -86fdae773b6bc230651291b8346e2dd4 \ No newline at end of file +5b5d7c9b2ccd3321cff8eac9faef4ef3 \ No newline at end of file diff --git a/dc/d39/selection__sort__recursive_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/dc/d39/selection__sort__recursive_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg index f10ebd772..1aea033ab 100644 --- a/dc/d39/selection__sort__recursive_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg +++ b/dc/d39/selection__sort__recursive_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg @@ -1,14 +1,14 @@ - - - + + test - + Node1 @@ -33,35 +33,47 @@ + + +Node2->Node2 + + + Node3 - -findIndex + +findIndex Node2->Node3 - - + + Node4 - -swap + +swap - + Node2->Node4 - - + + + + + +Node3->Node3 + + diff --git a/dc/d39/selection__sort__recursive_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/dc/d39/selection__sort__recursive_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map index 6bd7c3a8c..887223082 100644 --- a/dc/d39/selection__sort__recursive_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map +++ b/dc/d39/selection__sort__recursive_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -1,7 +1,7 @@ - - - - - + + + + + diff --git a/dc/d39/selection__sort__recursive_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/dc/d39/selection__sort__recursive_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 index 2b97a8b26..8054ed991 100644 --- a/dc/d39/selection__sort__recursive_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 +++ b/dc/d39/selection__sort__recursive_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -1 +1 @@ -7d93a75acb8d6e4ad80d5b53de00bd8c \ No newline at end of file +a134745b8f2042e7d4836240bc730413 \ No newline at end of file diff --git a/dc/d39/selection__sort__recursive_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/dc/d39/selection__sort__recursive_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index ae45a73ce..a76d48742 100644 --- a/dc/d39/selection__sort__recursive_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/dc/d39/selection__sort__recursive_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,14 +1,14 @@ - - - + + main - + Node1 @@ -48,35 +48,47 @@ + + +Node3->Node3 + + + Node4 - -findIndex + +findIndex Node3->Node4 - - + + Node5 - -swap + +swap - + Node3->Node5 - - + + + + + +Node4->Node4 + + diff --git a/dc/d41/geometry__datatypes_8h__dep__incl.map b/dc/d41/geometry__datatypes_8h__dep__incl.map index aa9ee00bc..89588e5d1 100644 --- a/dc/d41/geometry__datatypes_8h__dep__incl.map +++ b/dc/d41/geometry__datatypes_8h__dep__incl.map @@ -1,5 +1,5 @@ - - - + + + diff --git a/dc/d41/geometry__datatypes_8h__dep__incl.svg b/dc/d41/geometry__datatypes_8h__dep__incl.svg index 52ef7874e..a1286ec6b 100644 --- a/dc/d41/geometry__datatypes_8h__dep__incl.svg +++ b/dc/d41/geometry__datatypes_8h__dep__incl.svg @@ -1,20 +1,20 @@ - - + geometry/geometry_datatypes.h - + Node1 - -geometry/geometry_datatypes.h + +geometry/geometry_datatypes.h @@ -22,31 +22,31 @@ Node2 - -geometry/quaternions.c + +geometry/quaternions.c Node1->Node2 - - + + Node3 - -geometry/vectors_3d.c + +geometry/vectors_3d.c Node1->Node3 - - + + diff --git a/dc/d47/realtime__stats_8c.html b/dc/d47/realtime__stats_8c.html index 9edd38329..859a524f8 100644 --- a/dc/d47/realtime__stats_8c.html +++ b/dc/d47/realtime__stats_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: numerical_methods/realtime_stats.c 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/d47/realtime__stats_8c.html','../..
-
-
realtime_stats.c File Reference
+
realtime_stats.c File Reference
@@ -109,7 +108,7 @@ Include dependency graph for realtime_stats.c:
- @@ -120,17 +119,85 @@ Functions - - + +

+

Functions

void stats_computer1 (float x, float *mean, float *variance, float *std)
 continuous mean and variance computance using first value as an approximation for the mean. More...
void test_function (const float *test_data, const int number_of_samples)
 Test the algorithm implementation. More...
 
-int main (int argc, char **argv)
 Main function.
int main (int argc, char **argv)
 Main function. More...
 

Detailed Description

-

Compute statistics for data entered in rreal-time.

-
Author
Krishna Vedala
+

Compute statistics for data entered in rreal-time.

+
Author
Krishna Vedala

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.

Function Documentation

- + +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char ** argv 
)
+
+ +

Main function.

+
129{
+
130 const float test_data1[] = {3, 4, 5, -1.4, -3.6, 1.9, 1.};
+
131 test_function(test_data1, sizeof(test_data1) / sizeof(test_data1[0]));
+
132
+
133 float s1_mean = 0.f, s1_variance = 0.f, s1_std = 0.f;
+
134 float s2_mean = 0.f, s2_variance = 0.f, s2_std = 0.f;
+
135
+
136 printf("Enter data. Any non-numeric data will terminate the data input.\n");
+
137
+
138 while (1)
+
139 {
+
140 float val;
+
141 printf("Enter number: ");
+
142
+
143 // check for failure to read input. Happens for
+
144 // non-numeric data
+
145 if (!scanf("%f", &val))
+
146 break;
+
147
+
148 stats_computer1(val, &s1_mean, &s1_variance, &s1_std);
+
149 stats_computer2(val, &s2_mean, &s2_variance, &s2_std);
+
150
+
151 printf("\tMethod 1:\tMean: %.4f\t Variance: %.4f\t Std: %.4f\n",
+
152 s1_mean, s1_variance, s1_std);
+
153 printf("\tMethod 2:\tMean: %.4f\t Variance: %.4f\t Std: %.4f\n",
+
154 s2_mean, s2_variance, s2_std);
+
155 }
+
156
+
157 return 0;
+
158}
+
void stats_computer2(float x, float *mean, float *variance, float *std)
continuous mean and variance computance using Welford's algorithm (very accurate)
Definition: realtime_stats.c:61
+
void stats_computer1(float x, float *mean, float *variance, float *std)
continuous mean and variance computance using first value as an approximation for the mean.
Definition: realtime_stats.c:24
+
void test_function(const float *test_data, const int number_of_samples)
Test the algorithm implementation.
Definition: realtime_stats.c:92
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+

◆ stats_computer1()

@@ -169,7 +236,7 @@ int 

continuous mean and variance computance using first value as an approximation for the mean.

-

If the first number is much far form the mean, the algorithm becomes very inaccurate to compute variance and standard deviation.

Parameters
+

If the first number is much far form the mean, the algorithm becomes very inaccurate to compute variance and standard deviation.

Parameters
@@ -178,37 +245,37 @@ int  @@ -42,21 +41,22 @@
[in]xnew value added to data set
[out]meanif not NULL, mean returns mean of data set
25 {
-
26  /* following variables declared static becuase they need to be remembered
-
27  * when updating for next sample, when received.
-
28  */
-
29  static unsigned int n = 0;
-
30  static float Ex = 0.f, Ex2 = 0.f;
-
31  static float K = 0.f;
-
32 
-
33  if (n == 0)
-
34  K = x;
-
35  n++;
-
36  float tmp = x - K;
-
37  Ex += tmp;
-
38  Ex2 += tmp * tmp;
-
39 
-
40  /* return sample mean computed till last sample */
-
41  if (mean != NULL)
-
42  *mean = K + Ex / n;
-
43 
-
44  /* return data variance computed till last sample */
-
45  if (variance != NULL)
-
46  *variance = (Ex2 - (Ex * Ex) / n) / (n - 1);
-
47 
-
48  /* return sample standard deviation computed till last sample */
-
49  if (std != NULL)
-
50  *std = sqrtf(*variance);
-
51 }
+
25{
+
26 /* following variables declared static becuase they need to be remembered
+
27 * when updating for next sample, when received.
+
28 */
+
29 static unsigned int n = 0;
+
30 static float Ex = 0.f, Ex2 = 0.f;
+
31 static float K = 0.f;
+
32
+
33 if (n == 0)
+
34 K = x;
+
35 n++;
+
36 float tmp = x - K;
+
37 Ex += tmp;
+
38 Ex2 += tmp * tmp;
+
39
+
40 /* return sample mean computed till last sample */
+
41 if (mean != NULL)
+
42 *mean = K + Ex / n;
+
43
+
44 /* return data variance computed till last sample */
+
45 if (variance != NULL)
+
46 *variance = (Ex2 - (Ex * Ex) / n) / (n - 1);
+
47
+
48 /* return sample standard deviation computed till last sample */
+
49 if (std != NULL)
+
50 *std = sqrtf(*variance);
+
51}
- +

◆ stats_computer2()

@@ -256,35 +323,35 @@ int 
62 {
-
63  /* following variables declared static becuase they need to be remembered
-
64  * when updating for next sample, when received.
-
65  */
-
66  static unsigned int n = 0;
-
67  static float mu = 0, M = 0;
-
68 
-
69  n++;
-
70  float delta = x - mu;
-
71  mu += delta / n;
-
72  float delta2 = x - mu;
-
73  M += delta * delta2;
-
74 
-
75  /* return sample mean computed till last sample */
-
76  if (mean != NULL)
-
77  *mean = mu;
-
78 
-
79  /* return data variance computed till last sample */
-
80  if (variance != NULL)
-
81  *variance = M / n;
-
82 
-
83  /* return sample standard deviation computed till last sample */
-
84  if (std != NULL)
-
85  *std = sqrtf(*variance);
-
86 }
+
62{
+
63 /* following variables declared static becuase they need to be remembered
+
64 * when updating for next sample, when received.
+
65 */
+
66 static unsigned int n = 0;
+
67 static float mu = 0, M = 0;
+
68
+
69 n++;
+
70 float delta = x - mu;
+
71 mu += delta / n;
+
72 float delta2 = x - mu;
+
73 M += delta * delta2;
+
74
+
75 /* return sample mean computed till last sample */
+
76 if (mean != NULL)
+
77 *mean = mu;
+
78
+
79 /* return data variance computed till last sample */
+
80 if (variance != NULL)
+
81 *variance = M / n;
+
82
+
83 /* return sample standard deviation computed till last sample */
+
84 if (std != NULL)
+
85 *std = sqrtf(*variance);
+
86}
- +

◆ test_function()

@@ -318,45 +385,43 @@ int 
93 {
-
94  float ref_mean = 0.f, ref_variance = 0.f;
-
95  float s1_mean = 0.f, s1_variance = 0.f, s1_std = 0.f;
-
96  float s2_mean = 0.f, s2_variance = 0.f, s2_std = 0.f;
-
97 
-
98  for (int i = 0; i < number_of_samples; i++)
-
99  {
-
100  stats_computer1(test_data[i], &s1_mean, &s1_variance, &s1_std);
-
101  stats_computer2(test_data[i], &s2_mean, &s2_variance, &s2_std);
-
102  ref_mean += test_data[i];
-
103  }
-
104  ref_mean /= number_of_samples;
-
105 
-
106  for (int i = 0; i < number_of_samples; i++)
-
107  {
-
108  float temp = test_data[i] - ref_mean;
-
109  ref_variance += temp * temp;
-
110  }
-
111  ref_variance /= number_of_samples;
-
112 
-
113  printf("<<<<<<<< Test Function >>>>>>>>\n");
-
114  printf("Expected: Mean: %.4f\t Variance: %.4f\n", ref_mean, ref_variance);
-
115  printf("\tMethod 1:\tMean: %.4f\t Variance: %.4f\t Std: %.4f\n", s1_mean,
-
116  s1_variance, s1_std);
-
117  printf("\tMethod 2:\tMean: %.4f\t Variance: %.4f\t Std: %.4f\n", s2_mean,
-
118  s2_variance, s2_std);
-
119 
-
120  assert(fabs(s1_mean - ref_mean) < 0.01);
-
121  assert(fabs(s2_mean - ref_mean) < 0.01);
-
122  assert(fabs(s2_variance - ref_variance) < 0.01);
-
123 
-
124  printf("(Tests passed)\n\n");
-
125 }
-
void stats_computer2(float x, float *mean, float *variance, float *std)
continuous mean and variance computance using Welford's algorithm (very accurate)
Definition: realtime_stats.c:61
-
void stats_computer1(float x, float *mean, float *variance, float *std)
continuous mean and variance computance using first value as an approximation for the mean.
Definition: realtime_stats.c:24
+
93{
+
94 float ref_mean = 0.f, ref_variance = 0.f;
+
95 float s1_mean = 0.f, s1_variance = 0.f, s1_std = 0.f;
+
96 float s2_mean = 0.f, s2_variance = 0.f, s2_std = 0.f;
+
97
+
98 for (int i = 0; i < number_of_samples; i++)
+
99 {
+
100 stats_computer1(test_data[i], &s1_mean, &s1_variance, &s1_std);
+
101 stats_computer2(test_data[i], &s2_mean, &s2_variance, &s2_std);
+
102 ref_mean += test_data[i];
+
103 }
+
104 ref_mean /= number_of_samples;
+
105
+
106 for (int i = 0; i < number_of_samples; i++)
+
107 {
+
108 float temp = test_data[i] - ref_mean;
+
109 ref_variance += temp * temp;
+
110 }
+
111 ref_variance /= number_of_samples;
+
112
+
113 printf("<<<<<<<< Test Function >>>>>>>>\n");
+
114 printf("Expected: Mean: %.4f\t Variance: %.4f\n", ref_mean, ref_variance);
+
115 printf("\tMethod 1:\tMean: %.4f\t Variance: %.4f\t Std: %.4f\n", s1_mean,
+
116 s1_variance, s1_std);
+
117 printf("\tMethod 2:\tMean: %.4f\t Variance: %.4f\t Std: %.4f\n", s2_mean,
+
118 s2_variance, s2_std);
+
119
+
120 assert(fabs(s1_mean - ref_mean) < 0.01);
+
121 assert(fabs(s2_mean - ref_mean) < 0.01);
+
122 assert(fabs(s2_variance - ref_variance) < 0.01);
+
123
+
124 printf("(Tests passed)\n\n");
+
125}
Here is the call graph for this function:
-
+
@@ -368,7 +433,7 @@ Here is the call graph for this function:
diff --git a/dc/d47/realtime__stats_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map b/dc/d47/realtime__stats_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map new file mode 100644 index 000000000..a98264400 --- /dev/null +++ b/dc/d47/realtime__stats_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/dc/d47/realtime__stats_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 b/dc/d47/realtime__stats_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 new file mode 100644 index 000000000..a2d4d7349 --- /dev/null +++ b/dc/d47/realtime__stats_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 @@ -0,0 +1 @@ +8a0a5faee20a0e4a8ef20b4aac760e46 \ No newline at end of file diff --git a/dc/d47/realtime__stats_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg b/dc/d47/realtime__stats_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg new file mode 100644 index 000000000..6692cf075 --- /dev/null +++ b/dc/d47/realtime__stats_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg @@ -0,0 +1,79 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +stats_computer1 + + + + + +Node1->Node2 + + + + + +Node3 + + +stats_computer2 + + + + + +Node1->Node3 + + + + + +Node4 + + +test_function + + + + + +Node1->Node4 + + + + + +Node4->Node2 + + + + + +Node4->Node3 + + + + + diff --git a/dc/d47/realtime__stats_8c_aa54c915581fcc495489175a4386d59fd_cgraph.map b/dc/d47/realtime__stats_8c_aa54c915581fcc495489175a4386d59fd_cgraph.map index 18ad54445..6128475ad 100644 --- a/dc/d47/realtime__stats_8c_aa54c915581fcc495489175a4386d59fd_cgraph.map +++ b/dc/d47/realtime__stats_8c_aa54c915581fcc495489175a4386d59fd_cgraph.map @@ -1,5 +1,5 @@ - - + + diff --git a/dc/d47/realtime__stats_8c_aa54c915581fcc495489175a4386d59fd_cgraph.svg b/dc/d47/realtime__stats_8c_aa54c915581fcc495489175a4386d59fd_cgraph.svg index 86185b81c..bfe37ed66 100644 --- a/dc/d47/realtime__stats_8c_aa54c915581fcc495489175a4386d59fd_cgraph.svg +++ b/dc/d47/realtime__stats_8c_aa54c915581fcc495489175a4386d59fd_cgraph.svg @@ -1,14 +1,14 @@ - - + test_function - + Node1 @@ -22,31 +22,31 @@ Node2 - -stats_computer1 + +stats_computer1 Node1->Node2 - - + + Node3 - -stats_computer2 + +stats_computer2 Node1->Node3 - - + + diff --git a/dc/d52/problem__16_2sol1_8c__incl.map b/dc/d52/problem__16_2sol1_8c__incl.map index 54411f80c..32162b68a 100644 --- a/dc/d52/problem__16_2sol1_8c__incl.map +++ b/dc/d52/problem__16_2sol1_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/dc/d52/problem__16_2sol1_8c__incl.svg b/dc/d52/problem__16_2sol1_8c__incl.svg index bd3e401e1..9d5e4ec7f 100644 --- a/dc/d52/problem__16_2sol1_8c__incl.svg +++ b/dc/d52/problem__16_2sol1_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - -project_euler/problem + +project_euler/problem _16/sol1.c diff --git a/dc/d55/problem__14_2sol1_8c__incl.map b/dc/d55/problem__14_2sol1_8c__incl.map index 8b91c0bb4..fe05674b3 100644 --- a/dc/d55/problem__14_2sol1_8c__incl.map +++ b/dc/d55/problem__14_2sol1_8c__incl.map @@ -1,5 +1,5 @@ - - - + + + diff --git a/dc/d55/problem__14_2sol1_8c__incl.svg b/dc/d55/problem__14_2sol1_8c__incl.svg index 06245d61e..704bda8da 100644 --- a/dc/d55/problem__14_2sol1_8c__incl.svg +++ b/dc/d55/problem__14_2sol1_8c__incl.svg @@ -1,21 +1,21 @@ - - + project_euler/problem_14/sol1.c - + Node1 - + project_euler/problem -_14/sol1.c +_14/sol1.c @@ -23,31 +23,31 @@ Node2 - -stdio.h + +stdio.h Node1->Node2 - - + + Node3 - -stdlib.h + +stdlib.h Node1->Node3 - - + + diff --git a/dc/d5f/qr__decompose_8h__dep__incl.map b/dc/d5f/qr__decompose_8h__dep__incl.map index 4f67408f1..81053fa94 100644 --- a/dc/d5f/qr__decompose_8h__dep__incl.map +++ b/dc/d5f/qr__decompose_8h__dep__incl.map @@ -1,5 +1,5 @@ - - - + + + diff --git a/dc/d5f/qr__decompose_8h__dep__incl.svg b/dc/d5f/qr__decompose_8h__dep__incl.svg index e9573ddbf..af8cb9c1a 100644 --- a/dc/d5f/qr__decompose_8h__dep__incl.svg +++ b/dc/d5f/qr__decompose_8h__dep__incl.svg @@ -1,21 +1,21 @@ - - + numerical_methods/qr_decompose.h - + Node1 - -numerical_methods/qr -_decompose.h + +numerical_methods/qr +_decompose.h @@ -23,33 +23,33 @@ Node2 - + numerical_methods/qr -_decomposition.c +_decomposition.c Node1->Node2 - - + + Node3 - -numerical_methods/qr -_eigen_values.c + +numerical_methods/qr +_eigen_values.c Node1->Node3 - - + + diff --git a/dc/d63/problem__8_2sol1_8c.html b/dc/d63/problem__8_2sol1_8c.html index 02fea4ef5..b3b8b5ea8 100644 --- a/dc/d63/problem__8_2sol1_8c.html +++ b/dc/d63/problem__8_2sol1_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_8/sol1.c 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() {
@@ -92,37 +92,35 @@ $(document).ready(function(){initNavTree('dc/d63/problem__8_2sol1_8c.html','../.
-
-
sol1.c File Reference
+
sol1.c File Reference
-

Problem 8 solution +

Problem 8 solution More...

#include <stdio.h>
#include <stdlib.h>
Include dependency graph for sol1.c:
-
+
- - - + +

+

Functions

long long int get_product (FILE *fp, long start_pos, int num_digits)
 Compute the product of two numbers in a file. More...
 
-int main (int argc, char *argv[])
 Main function.
int main (int argc, char *argv[])
 Main function. More...
 

Detailed Description

-

Problem 8 solution

-
Author
Krishna Vedala
+

Problem 8 solution

+
Author
Krishna Vedala

Function Documentation

- +

◆ get_product()

@@ -164,54 +162,145 @@ int 
Returns
expected product
-
17 {
-
18  char ch = ' '; /* temporary variable to store character read from file */
-
19  unsigned char num = 0; /* temporary variable to store digit read */
-
20  long long int prod = 1; /* product accumulator */
-
21  int count =
-
22  0; /* we use this variable to count number of bytes of file read */
-
23 
-
24  /* accumulate product for num_digits */
-
25  for (int i = 0; i < num_digits; i++, count++)
-
26  {
-
27  /* get character from file */
-
28  ch = getc(fp);
-
29 
-
30  /* the ASCII codes of digits is between 0x30 and 0x39.
-
31  * any character not in this range implies an invalid character
-
32  */
-
33  if (ch < 0x30 || ch > 0x39)
-
34  {
-
35  if (ch == EOF)
-
36  return 0;
-
37  i--;
-
38  continue;
-
39  }
-
40 
-
41  num = ch - 0x30; /* convert character digit to number */
-
42  if (num == 0)
-
43  {
-
44  /* If number is zero, we can skip the next 'num_digits'
-
45  * because this '0' will repeat in the next 'num_digit'
-
46  * multiplications. Hence, we also do not update the file position
-
47  */
-
48  /* NOTE: this is not needed but helps get results faster :) */
-
49  return 0;
-
50  }
-
51 
-
52  prod *= num; /* accumulate product */
-
53  }
-
54 
-
55  /* set file position to the next starting character + 1 */
-
56  fseek(fp, -count + 1, SEEK_CUR);
-
57 
-
58  return prod;
-
59 }
+
17{
+
18 char ch = ' '; /* temporary variable to store character read from file */
+
19 unsigned char num = 0; /* temporary variable to store digit read */
+
20 long long int prod = 1; /* product accumulator */
+
21 int count =
+
22 0; /* we use this variable to count number of bytes of file read */
+
23
+
24 /* accumulate product for num_digits */
+
25 for (int i = 0; i < num_digits; i++, count++)
+
26 {
+
27 /* get character from file */
+
28 ch = getc(fp);
+
29
+
30 /* the ASCII codes of digits is between 0x30 and 0x39.
+
31 * any character not in this range implies an invalid character
+
32 */
+
33 if (ch < 0x30 || ch > 0x39)
+
34 {
+
35 if (ch == EOF)
+
36 return 0;
+
37 i--;
+
38 continue;
+
39 }
+
40
+
41 num = ch - 0x30; /* convert character digit to number */
+
42 if (num == 0)
+
43 {
+
44 /* If number is zero, we can skip the next 'num_digits'
+
45 * because this '0' will repeat in the next 'num_digit'
+
46 * multiplications. Hence, we also do not update the file position
+
47 */
+
48 /* NOTE: this is not needed but helps get results faster :) */
+
49 return 0;
+
50 }
+
51
+
52 prod *= num; /* accumulate product */
+
53 }
+
54
+
55 /* set file position to the next starting character + 1 */
+
56 fseek(fp, -count + 1, SEEK_CUR);
+
57
+
58 return prod;
+
59}
int count(int *arr, const int size)
Count func counts the number of prime numbers.
Definition: prime_seive.c:42
Here is the call graph for this function:
-
+
+
+
+ +
+
+ +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char * argv[] 
)
+
+ +

Main function.

+
63{
+
64 int position = 0;
+
65 int num_digits = 4;
+
66 long long int prod, max_prod = 0;
+
67
+
68 /* if second command-line argument is ge=iven,
+
69 * use it as the number of digits to compute
+
70 * successive product for
+
71 */
+
72 if (argc == 2)
+
73 num_digits = atoi(argv[1]);
+
74
+
75 /* open file to read digits from */
+
76 FILE *fp = fopen("digits.txt", "rt");
+
77 if (!fp)
+
78 {
+
79 perror("Unable to open file");
+
80 return -1;
+
81 }
+
82
+
83 /* loop through all digits in the file */
+
84 do
+
85 {
+
86 /* get product of 'num_digits' from current position in file */
+
87 prod = get_product(fp, ftell(fp), num_digits);
+
88
+
89 if (prod > max_prod)
+
90 {
+
91 max_prod = prod;
+
92 position = ftell(fp) - 1;
+
93 }
+
94 } while (!feof(fp)); /* loop till end of file is reached */
+
95
+
96 printf("Maximum product: %lld\t Location: %d^th position\n\t", max_prod,
+
97 position);
+
98 fseek(fp, position,
+
99 SEEK_SET); /* move cursor to identified position in file */
+
100 /* loop through all digits */
+
101 for (; num_digits > 0; num_digits--)
+
102 {
+
103 char ch = getc(fp); /* get character */
+
104 /* skip invalid character */
+
105 if (ch < 0x30 || ch > 0x39)
+
106 continue;
+
107 if (num_digits > 1)
+
108 printf("%c x ", ch);
+
109 else
+
110 printf("%c = %lld\n", ch, max_prod);
+
111 }
+
112
+
113 fclose(fp); /* close file */
+
114
+
115 return 0;
+
116}
+
long long int get_product(FILE *fp, long start_pos, int num_digits)
Compute the product of two numbers in a file.
Definition: sol1.c:16
+
+Here is the call graph for this function:
+
+
@@ -223,7 +312,7 @@ Here is the call graph for this function:
diff --git a/dc/d63/problem__8_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map b/dc/d63/problem__8_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map new file mode 100644 index 000000000..089f4bbce --- /dev/null +++ b/dc/d63/problem__8_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/dc/d63/problem__8_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 b/dc/d63/problem__8_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 new file mode 100644 index 000000000..486882071 --- /dev/null +++ b/dc/d63/problem__8_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 @@ -0,0 +1 @@ +3792774b26067093bd8ce4ffd4c9edce \ No newline at end of file diff --git a/dc/d63/problem__8_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg b/dc/d63/problem__8_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg new file mode 100644 index 000000000..79eba9578 --- /dev/null +++ b/dc/d63/problem__8_2sol1_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg @@ -0,0 +1,52 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +get_product + + + + + +Node1->Node2 + + + + + +Node3 + + +count + + + + + +Node2->Node3 + + + + + diff --git a/dc/d63/problem__8_2sol1_8c_a9ffc8845f17b01a353767a40a3adf7bd_cgraph.map b/dc/d63/problem__8_2sol1_8c_a9ffc8845f17b01a353767a40a3adf7bd_cgraph.map index e429a04a0..d641c9e62 100644 --- a/dc/d63/problem__8_2sol1_8c_a9ffc8845f17b01a353767a40a3adf7bd_cgraph.map +++ b/dc/d63/problem__8_2sol1_8c_a9ffc8845f17b01a353767a40a3adf7bd_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/dc/d63/problem__8_2sol1_8c_a9ffc8845f17b01a353767a40a3adf7bd_cgraph.svg b/dc/d63/problem__8_2sol1_8c_a9ffc8845f17b01a353767a40a3adf7bd_cgraph.svg index 5a7dc845f..205a51d02 100644 --- a/dc/d63/problem__8_2sol1_8c_a9ffc8845f17b01a353767a40a3adf7bd_cgraph.svg +++ b/dc/d63/problem__8_2sol1_8c_a9ffc8845f17b01a353767a40a3adf7bd_cgraph.svg @@ -1,20 +1,20 @@ - - + get_product - + Node1 - -get_product + +get_product @@ -22,16 +22,16 @@ Node2 - -count + +count Node1->Node2 - - + + diff --git a/dc/d64/md__coding_guidelines.html b/dc/d64/md__coding_guidelines.html index 22b5ea188..59b41d890 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/d77/struct__big__int.html b/dc/d77/struct__big__int.html index 4a1cb1d22..c3baf71be 100644 --- a/dc/d77/struct__big__int.html +++ b/dc/d77/struct__big__int.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: _big_int 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() {
@@ -92,8 +92,7 @@ $(document).ready(function(){initNavTree('dc/d77/struct__big__int.html','../../'
-
-
_big_int Struct Reference
+
_big_int Struct Reference
@@ -102,27 +101,27 @@ $(document).ready(function(){initNavTree('dc/d77/struct__big__int.html','../../'
Collaboration diagram for _big_int:
-
+
[legend]
- - + - + - +

+

Data Fields

-char value
+char value
 tens place (single digit)
 
-struct _big_int * next_digit
+struct _big_int * next_digit
 hundreds place
 
-struct _big_int * prev_digit
+struct _big_int * prev_digit
 units place
 

Detailed Description

-

store arbitratily large integer values as a linked list of digits.

+

store arbitratily large integer values as a linked list of digits.


The documentation for this struct was generated from the following file:
  • project_euler/problem_20/sol1.c
@@ -132,7 +131,7 @@ struct _big_int * diff --git a/dc/d80/cantor__set_8c.html b/dc/d80/cantor__set_8c.html index 25ba1b9ea..ef743921d 100644 --- a/dc/d80/cantor__set_8c.html +++ b/dc/d80/cantor__set_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: misc/cantor_set.c 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/d80/cantor__set_8c.html','../../'); Data Structures | Typedefs | Functions
-
-
cantor_set.c File Reference
+
cantor_set.c File Reference
-

Program to generate Cantor ternary set +

Program to generate Cantor ternary set More...

#include <stdio.h>
#include <stdlib.h>
@@ -111,20 +110,20 @@ Include dependency graph for cantor_set.c:
-

+

Data Structures

struct  _cantor_set
 structure to define Cantor set More...
 
- - +

+

Typedefs

-typedef struct _cantor_set CantorSet
+typedef struct _cantor_set CantorSet
 structure to define Cantor set
 
- @@ -135,15 +134,14 @@ Functions - - + +

+

Functions

void propagate (CantorSet *head)
 Iterative constructor of all sets in the current level. More...
void free_memory (CantorSet *head)
 Clear memory allocated by propagate function. More...
 
-int main (int argc, char const *argv[])
 Main function.
int main (int argc, char const *argv[])
 Main function. More...
 

Detailed Description

-

Program to generate Cantor ternary set

+

Program to generate Cantor ternary set

Function Documentation

- +

◆ free_memory()

@@ -166,21 +164,105 @@ int 
73 {
-
74  if (!head)
-
75  return;
-
76 
-
77  if (head->next)
-
78  free_memory(head->next);
-
79 
-
80  free(head);
-
81 }
+
73{
+
74 if (!head)
+
75 return;
+
76
+
77 if (head->next)
+
78 free_memory(head->next);
+
79
+
80 free(head);
+
81}
void free_memory(CantorSet *head)
Clear memory allocated by propagate function.
Definition: cantor_set.c:72
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
-
+
+Here is the call graph for this function:
+
+
- + +
+
+ +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char const * argv[] 
)
+
+ +

Main function.

+
85{
+
86 int start_num, end_num, levels;
+
87
+
88 if (argc < 2)
+
89 {
+
90 printf("Enter 3 arguments: start_num \t end_num \t levels\n");
+
91 scanf("%d %d %d", &start_num, &end_num, &levels);
+
92 }
+
93 else
+
94 {
+
95 start_num = atoi(argv[1]);
+
96 end_num = atoi(argv[2]);
+
97 levels = atoi(argv[3]);
+
98 }
+
99
+
100 if (start_num < 0 || end_num < 0 || levels < 0)
+
101 {
+
102 fprintf(stderr, "All numbers must be positive\n");
+
103 return -1;
+
104 }
+
105
+
106 CantorSet head = {.start = start_num, .end = end_num, .next = NULL};
+
107
+
108 // loop to propagate each level from top to bottom
+
109 for (int i = 0; i < levels; i++)
+
110 {
+
111 printf("Level %d\t", i);
+
112 print(&head);
+
113 propagate(&head);
+
114 printf("\n");
+
115 }
+
116 printf("Level %d\t", levels);
+
117 print(&head);
+
118
+
119 // delete all memory allocated
+
120 free_memory(head.next);
+
121
+
122 return 0;
+
123}
+
void propagate(CantorSet *head)
Iterative constructor of all sets in the current level.
Definition: cantor_set.c:23
+
void print(CantorSet *head)
Print sets in the current range to stdout
Definition: cantor_set.c:55
+
structure to define Cantor set
Definition: cantor_set.c:12
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+

◆ print()

@@ -203,23 +285,22 @@ int 
56 {
-
57  CantorSet *temp = head;
-
58  while (temp != NULL) // print while a valid set is found
-
59  {
-
60  printf("\t");
-
61  printf("[%lf] -- ", temp->start);
-
62  printf("[%lf]", temp->end);
-
63  temp = temp->next;
-
64  }
-
65 
-
66  printf("\n");
-
67 }
-
structure to define Cantor set
Definition: cantor_set.c:12
+
56{
+
57 CantorSet *temp = head;
+
58 while (temp != NULL) // print while a valid set is found
+
59 {
+
60 printf("\t");
+
61 printf("[%lf] -- ", temp->start);
+
62 printf("[%lf]", temp->end);
+
63 temp = temp->next;
+
64 }
+
65
+
66 printf("\n");
+
67}
- +

◆ propagate()

@@ -236,46 +317,45 @@ int 

Iterative constructor of all sets in the current level.

-

This function dynamically allocates memory when creating new sets. These are freed by the function free_memory.

Parameters
+

This function dynamically allocates memory when creating new sets. These are freed by the function free_memory.

Parameters
headpointer to interval set instance to update
-
24 {
-
25  // if input is NULL, ignore the process
-
26  if (head == NULL)
-
27  return;
-
28 
-
29  CantorSet *temp = head; // local pointer to track propagation
-
30 
-
31  // create new node for the new set
- -
33 
-
34  // get 1/3rd of interval
-
35  double diff = (((temp->end) - (temp->start)) / 3);
-
36 
-
37  // update interval ranges
-
38  newNode->end = temp->end;
-
39  temp->end = ((temp->start) + diff);
-
40  newNode->start = (newNode->end) - diff;
-
41 
-
42  // update pointer to next set in this level
-
43  newNode->next = temp->next;
-
44 
-
45  // point to next set
-
46  temp->next = newNode;
-
47 
-
48  // create next set
-
49  propagate(temp->next->next);
-
50 }
-
node * newNode(int data)
The node constructor, which receives the key value input and returns a node pointer.
Definition: binary_search_tree.c:28
-
void propagate(CantorSet *head)
Iterative constructor of all sets in the current level.
Definition: cantor_set.c:23
+
24{
+
25 // if input is NULL, ignore the process
+
26 if (head == NULL)
+
27 return;
+
28
+
29 CantorSet *temp = head; // local pointer to track propagation
+
30
+
31 // create new node for the new set
+ +
33
+
34 // get 1/3rd of interval
+
35 double diff = (((temp->end) - (temp->start)) / 3);
+
36
+
37 // update interval ranges
+
38 newNode->end = temp->end;
+
39 temp->end = ((temp->start) + diff);
+
40 newNode->start = (newNode->end) - diff;
+
41
+
42 // update pointer to next set in this level
+
43 newNode->next = temp->next;
+
44
+
45 // point to next set
+
46 temp->next = newNode;
+
47
+
48 // create next set
+
49 propagate(temp->next->next);
+
50}
+
node * newNode(int data)
The node constructor, which receives the key value input and returns a node pointer.
Definition: binary_search_tree.c:28
#define malloc(bytes)
This macro replace the standard malloc function with malloc_dbg.
Definition: malloc_dbg.h:18
Here is the call graph for this function:
-
+
@@ -287,7 +367,7 @@ Here is the call graph for this function:
diff --git a/dc/d80/cantor__set_8c_a1f156d2b53b80305bd2fa3ff5fdf3c97_cgraph.map b/dc/d80/cantor__set_8c_a1f156d2b53b80305bd2fa3ff5fdf3c97_cgraph.map index 9af0a0131..35ab92db3 100644 --- a/dc/d80/cantor__set_8c_a1f156d2b53b80305bd2fa3ff5fdf3c97_cgraph.map +++ b/dc/d80/cantor__set_8c_a1f156d2b53b80305bd2fa3ff5fdf3c97_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/dc/d80/cantor__set_8c_a1f156d2b53b80305bd2fa3ff5fdf3c97_cgraph.md5 b/dc/d80/cantor__set_8c_a1f156d2b53b80305bd2fa3ff5fdf3c97_cgraph.md5 index 53c8542da..7307256e2 100644 --- a/dc/d80/cantor__set_8c_a1f156d2b53b80305bd2fa3ff5fdf3c97_cgraph.md5 +++ b/dc/d80/cantor__set_8c_a1f156d2b53b80305bd2fa3ff5fdf3c97_cgraph.md5 @@ -1 +1 @@ -92d1a64ce841bc00c9274c6bc2fe3017 \ No newline at end of file +742cd13a8eec53bcab0c8ece270daf02 \ No newline at end of file diff --git a/dc/d80/cantor__set_8c_a1f156d2b53b80305bd2fa3ff5fdf3c97_cgraph.svg b/dc/d80/cantor__set_8c_a1f156d2b53b80305bd2fa3ff5fdf3c97_cgraph.svg index 70218d86f..0d838695d 100644 --- a/dc/d80/cantor__set_8c_a1f156d2b53b80305bd2fa3ff5fdf3c97_cgraph.svg +++ b/dc/d80/cantor__set_8c_a1f156d2b53b80305bd2fa3ff5fdf3c97_cgraph.svg @@ -1,37 +1,43 @@ - - - + + propagate - + Node1 - -propagate + +propagate + + +Node1->Node1 + + + Node2 - - -newNode + + +newNode Node1->Node2 - - + + diff --git a/dc/d80/cantor__set_8c_a85df3c64a683100ac6246e1e034df43d_cgraph.map b/dc/d80/cantor__set_8c_a85df3c64a683100ac6246e1e034df43d_cgraph.map new file mode 100644 index 000000000..274a029b8 --- /dev/null +++ b/dc/d80/cantor__set_8c_a85df3c64a683100ac6246e1e034df43d_cgraph.map @@ -0,0 +1,3 @@ + + + diff --git a/dc/d80/cantor__set_8c_a85df3c64a683100ac6246e1e034df43d_cgraph.md5 b/dc/d80/cantor__set_8c_a85df3c64a683100ac6246e1e034df43d_cgraph.md5 new file mode 100644 index 000000000..e2eb9a4fb --- /dev/null +++ b/dc/d80/cantor__set_8c_a85df3c64a683100ac6246e1e034df43d_cgraph.md5 @@ -0,0 +1 @@ +253fb2fdba7ea23ab15d080c6673220f \ No newline at end of file diff --git a/dc/d80/cantor__set_8c_a85df3c64a683100ac6246e1e034df43d_cgraph.svg b/dc/d80/cantor__set_8c_a85df3c64a683100ac6246e1e034df43d_cgraph.svg new file mode 100644 index 000000000..65f9eaa56 --- /dev/null +++ b/dc/d80/cantor__set_8c_a85df3c64a683100ac6246e1e034df43d_cgraph.svg @@ -0,0 +1,28 @@ + + + + + + +free_memory + + + +Node1 + + +free_memory + + + + + +Node1->Node1 + + + + + diff --git a/dc/d80/cantor__set_8c_abf9e6b7e6f15df4b525a2e7705ba3089_cgraph.map b/dc/d80/cantor__set_8c_abf9e6b7e6f15df4b525a2e7705ba3089_cgraph.map new file mode 100644 index 000000000..ec0d83ca3 --- /dev/null +++ b/dc/d80/cantor__set_8c_abf9e6b7e6f15df4b525a2e7705ba3089_cgraph.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/dc/d80/cantor__set_8c_abf9e6b7e6f15df4b525a2e7705ba3089_cgraph.md5 b/dc/d80/cantor__set_8c_abf9e6b7e6f15df4b525a2e7705ba3089_cgraph.md5 new file mode 100644 index 000000000..18e9b773e --- /dev/null +++ b/dc/d80/cantor__set_8c_abf9e6b7e6f15df4b525a2e7705ba3089_cgraph.md5 @@ -0,0 +1 @@ +4522875e857a670a8be9693cb0a4bb41 \ No newline at end of file diff --git a/dc/d80/cantor__set_8c_abf9e6b7e6f15df4b525a2e7705ba3089_cgraph.svg b/dc/d80/cantor__set_8c_abf9e6b7e6f15df4b525a2e7705ba3089_cgraph.svg new file mode 100644 index 000000000..5fbb44ec2 --- /dev/null +++ b/dc/d80/cantor__set_8c_abf9e6b7e6f15df4b525a2e7705ba3089_cgraph.svg @@ -0,0 +1,94 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +free_memory + + + + + +Node1->Node2 + + + + + +Node3 + + +print + + + + + +Node1->Node3 + + + + + +Node4 + + +propagate + + + + + +Node1->Node4 + + + + + +Node2->Node2 + + + + + +Node4->Node4 + + + + + +Node5 + + +newNode + + + + + +Node4->Node5 + + + + + diff --git a/dc/d80/collatz_8c.html b/dc/d80/collatz_8c.html index ab7301c71..565a855d5 100644 --- a/dc/d80/collatz_8c.html +++ b/dc/d80/collatz_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: misc/collatz.c 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/d80/collatz_8c.html','../../'); ini
-
-
collatz.c File Reference
+
collatz.c File Reference
-

Implementation of Collatz' conjecture +

Implementation of Collatz' conjecture More...

#include <stdio.h>
#include <stdlib.h>
@@ -108,23 +107,76 @@ Include dependency graph for collatz.c:
- - - + +

+

Functions

-int main (int argc, char *argv[])
 Main function.
int main (int argc, char *argv[])
 Main function. More...
 

Detailed Description

-

Implementation of Collatz' conjecture

-

Collatz conjecture: a series for a number \(n\) in which if \(n\) even then the next number is \(\frac{n}{2}\) ,but if n is odd then the next number is \(3n+1\). This series continues till \(n\) reaches 1

-
+

Implementation of Collatz' conjecture

+

Collatz conjecture: a series for a number \(n\) in which if \(n\) even then the next number is \(\frac{n}{2}\) ,but if n is odd then the next number is \(3n+1\). This series continues till \(n\) reaches 1

+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char * argv[] 
)
+
+ +

Main function.

+
17{
+
18 unsigned long long n, curr_no, num_steps = 0;
+
19 if (argc == 2)
+
20 n = strtoull(argv[1], NULL, 10);
+
21 else
+
22 {
+
23 printf("Enter starting number: ");
+
24 scanf("%lu", &n); // input number
+
25 }
+
26
+
27 curr_no = n; // curr_no stores input number n
+
28 while (curr_no != 1) // loop till series reaches 1
+
29 {
+
30 num_steps++;
+
31 printf("%llu->", curr_no);
+
32 if (curr_no % 2 == 0) // condition for even number
+
33 curr_no = curr_no / 2;
+
34 else
+
35 curr_no = (curr_no * 3) + 1; // condition for odd number
+
36 }
+
37 printf("1\nNumber of steps: %llu\n", num_steps);
+
38 return 0;
+
39}
+
+
+
+ diff --git a/dc/d9a/group__quats.html b/dc/d9a/group__quats.html index 45b80f560..5643bd98f 100644 --- a/dc/d9a/group__quats.html +++ b/dc/d9a/group__quats.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: 3D Quaternion operations @@ -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,17 @@ $(document).ready(function(){initNavTree('dc/d9a/group__quats.html','../../'); i Data Structures | Typedefs | Functions -
-
3D Quaternion operations
+
3D Quaternion operations
Collaboration diagram for 3D Quaternion operations:
-
+
- @@ -114,18 +113,18 @@ Data Structures

+

Data Structures

struct  quaternion_
 a Quaternion type represented using a scalar \(w\) or \(q_0\) and a 3D vector \(\left(q_1,q_2,q_3\right)\) More...
 3D Euler or Tait-Bryan angles (in radian) More...
 
- - + - +

+

Typedefs

-typedef struct quaternion_ quaternion
+typedef struct quaternion_ quaternion
 a Quaternion type represented using a scalar \(w\) or \(q_0\) and a 3D vector \(\left(q_1,q_2,q_3\right)\)
 
-typedef struct euler_ euler
+typedef struct euler_ euler
 3D Euler or Tait-Bryan angles (in radian)
 
- @@ -139,7 +138,7 @@ Functions

+

Functions

quaternion quat_from_euler (const euler *in_euler)
 Function to convert given Euler angles to a quaternion. More...

Detailed Description

Function Documentation

- +

◆ euler_from_quat()

@@ -166,25 +165,25 @@ Functions
Returns
converted euler angles
-
89 {
-
90  euler out_euler;
-
91  if (!in_quat) // if null
-
92  {
-
93  fprintf(stderr, "%s: Invalid input.", __func__);
-
94  return out_euler;
-
95  }
-
96 
-
97  out_euler.roll = atan2f(
-
98  2.f * (in_quat->w * in_quat->q1 + in_quat->q2 * in_quat->q3),
-
99  1.f - 2.f * (in_quat->q1 * in_quat->q1 + in_quat->q2 * in_quat->q2));
-
100  out_euler.pitch =
-
101  asinf(2.f * (in_quat->w * in_quat->q2 + in_quat->q1 * in_quat->q3));
-
102  out_euler.yaw = atan2f(
-
103  2.f * (in_quat->w * in_quat->q3 + in_quat->q1 * in_quat->q2),
-
104  1.f - 2.f * (in_quat->q2 * in_quat->q2 + in_quat->q3 * in_quat->q3));
-
105 
-
106  return out_euler;
-
107 }
+
89{
+
90 euler out_euler;
+
91 if (!in_quat) // if null
+
92 {
+
93 fprintf(stderr, "%s: Invalid input.", __func__);
+
94 return out_euler;
+
95 }
+
96
+
97 out_euler.roll = atan2f(
+
98 2.f * (in_quat->w * in_quat->q1 + in_quat->q2 * in_quat->q3),
+
99 1.f - 2.f * (in_quat->q1 * in_quat->q1 + in_quat->q2 * in_quat->q2));
+
100 out_euler.pitch =
+
101 asinf(2.f * (in_quat->w * in_quat->q2 + in_quat->q1 * in_quat->q3));
+
102 out_euler.yaw = atan2f(
+
103 2.f * (in_quat->w * in_quat->q3 + in_quat->q1 * in_quat->q2),
+
104 1.f - 2.f * (in_quat->q2 * in_quat->q2 + in_quat->q3 * in_quat->q3));
+
105
+
106 return out_euler;
+
107}
3D Euler or Tait-Bryan angles (in radian)
Definition: geometry_datatypes.h:81
float roll
or bank = rotation about X axis
Definition: geometry_datatypes.h:84
float pitch
or elevation = rotation about Y axis
Definition: geometry_datatypes.h:89
@@ -193,7 +192,7 @@ Functions
- +

◆ quat_from_euler()

@@ -220,36 +219,36 @@ Functions
Returns
converted quaternion
-
48 {
-
49  quaternion out_quat;
-
50 
-
51  if (!in_euler) // if null
-
52  {
-
53  fprintf(stderr, "%s: Invalid input.", __func__);
-
54  return out_quat;
-
55  }
-
56 
-
57  quaternion temp;
-
58 
-
59  float cy = cosf(in_euler->yaw * 0.5f);
-
60  float sy = sinf(in_euler->yaw * 0.5f);
-
61  float cp = cosf(in_euler->pitch * 0.5f);
-
62  float sp = sinf(in_euler->pitch * 0.5f);
-
63  float cr = cosf(in_euler->roll * 0.5f);
-
64  float sr = sinf(in_euler->roll * 0.5f);
-
65 
-
66  temp.w = cr * cp * cy + sr * sp * sy;
-
67  temp.q1 = sr * cp * cy - cr * sp * sy;
-
68  temp.q2 = cr * sp * cy + sr * cp * sy;
-
69  temp.q3 = cr * cp * sy - sr * sp * cy;
-
70 
-
71  return temp;
-
72 }
+
48{
+
49 quaternion out_quat;
+
50
+
51 if (!in_euler) // if null
+
52 {
+
53 fprintf(stderr, "%s: Invalid input.", __func__);
+
54 return out_quat;
+
55 }
+
56
+
57 quaternion temp;
+
58
+
59 float cy = cosf(in_euler->yaw * 0.5f);
+
60 float sy = sinf(in_euler->yaw * 0.5f);
+
61 float cp = cosf(in_euler->pitch * 0.5f);
+
62 float sp = sinf(in_euler->pitch * 0.5f);
+
63 float cr = cosf(in_euler->roll * 0.5f);
+
64 float sr = sinf(in_euler->roll * 0.5f);
+
65
+
66 temp.w = cr * cp * cy + sr * sp * sy;
+
67 temp.q1 = sr * cp * cy - cr * sp * sy;
+
68 temp.q2 = cr * sp * cy + sr * cp * sy;
+
69 temp.q3 = cr * cp * sy - sr * sp * cy;
+
70
+
71 return temp;
+
72}
a Quaternion type represented using a scalar or and a 3D vector
Definition: geometry_datatypes.h:61
- +

◆ quaternion_multiply()

@@ -287,25 +286,25 @@ Functions
Returns
resultant quaternion
-
131 {
-
132  quaternion out_quat;
-
133  if (!in_quat1 || !in_quat2) // if null
-
134  {
-
135  fprintf(stderr, "%s: Invalid input.", __func__);
-
136  return out_quat;
-
137  }
-
138 
-
139  out_quat.w = in_quat1->w * in_quat2->w - in_quat1->q1 * in_quat2->q1 -
-
140  in_quat1->q2 * in_quat2->q2 - in_quat1->q3 * in_quat2->q3;
-
141  out_quat.q1 = in_quat1->w * in_quat2->q1 + in_quat1->q1 * in_quat2->w +
-
142  in_quat1->q2 * in_quat2->q3 - in_quat1->q3 * in_quat2->q2;
-
143  out_quat.q2 = in_quat1->w * in_quat2->q2 - in_quat1->q1 * in_quat2->q3 +
-
144  in_quat1->q2 * in_quat2->w + in_quat1->q3 * in_quat2->q1;
-
145  out_quat.q3 = in_quat1->w * in_quat2->q3 + in_quat1->q1 * in_quat2->q2 -
-
146  in_quat1->q2 * in_quat2->q1 + in_quat1->q3 * in_quat2->w;
-
147 
-
148  return out_quat;
-
149 }
+
131{
+
132 quaternion out_quat;
+
133 if (!in_quat1 || !in_quat2) // if null
+
134 {
+
135 fprintf(stderr, "%s: Invalid input.", __func__);
+
136 return out_quat;
+
137 }
+
138
+
139 out_quat.w = in_quat1->w * in_quat2->w - in_quat1->q1 * in_quat2->q1 -
+
140 in_quat1->q2 * in_quat2->q2 - in_quat1->q3 * in_quat2->q3;
+
141 out_quat.q1 = in_quat1->w * in_quat2->q1 + in_quat1->q1 * in_quat2->w +
+
142 in_quat1->q2 * in_quat2->q3 - in_quat1->q3 * in_quat2->q2;
+
143 out_quat.q2 = in_quat1->w * in_quat2->q2 - in_quat1->q1 * in_quat2->q3 +
+
144 in_quat1->q2 * in_quat2->w + in_quat1->q3 * in_quat2->q1;
+
145 out_quat.q3 = in_quat1->w * in_quat2->q3 + in_quat1->q1 * in_quat2->q2 -
+
146 in_quat1->q2 * in_quat2->q1 + in_quat1->q3 * in_quat2->w;
+
147
+
148 return out_quat;
+
149}
@@ -314,7 +313,7 @@ Functions diff --git a/dc/d9a/group__quats.js b/dc/d9a/group__quats.js index 7de006514..10a1006e0 100644 --- a/dc/d9a/group__quats.js +++ b/dc/d9a/group__quats.js @@ -3,9 +3,6 @@ var group__quats = [ "quaternion_", "de/d58/structquaternion__.html", [ [ "dual", "de/d58/structquaternion__.html#a596abbab688731119c1f23b26a7ac17a", null ], [ "q0", "de/d58/structquaternion__.html#a37819eb7d76c65c37a9c2a63f01f65b2", null ], - [ "q1", "de/d58/structquaternion__.html#a3b00276b56da72911199baf48814b3f6", null ], - [ "q2", "de/d58/structquaternion__.html#a627574208aad1215fde8fcf9cb3f36e4", null ], - [ "q3", "de/d58/structquaternion__.html#a2ce1409f1d683aa40eade31d60ded530", null ], [ "w", "de/d58/structquaternion__.html#a835e2ba72517fbb29d0d4e3cb4c2914f", null ] ] ], [ "euler_", "d2/de8/structeuler__.html", [ diff --git a/dc/d9a/group__quats.map b/dc/d9a/group__quats.map index f674597bf..b611ff01d 100644 --- a/dc/d9a/group__quats.map +++ b/dc/d9a/group__quats.map @@ -1,4 +1,4 @@ - - + + diff --git a/dc/d9a/group__quats.md5 b/dc/d9a/group__quats.md5 index b297b8672..2769af6ac 100644 --- a/dc/d9a/group__quats.md5 +++ b/dc/d9a/group__quats.md5 @@ -1 +1 @@ -99e2e2ab123caa159c04afaa8f29aae7 \ No newline at end of file +889918cb8ff946330ce6dc8f0d9acf37 \ No newline at end of file diff --git a/dc/d9a/group__quats.svg b/dc/d9a/group__quats.svg index 440c5c9b2..7f175e626 100644 --- a/dc/d9a/group__quats.svg +++ b/dc/d9a/group__quats.svg @@ -1,38 +1,38 @@ - - + 3D Quaternion operations - - - -Node1 - - -3D Quaternion operations - - - + - + Node2 - + Library for 3D Vectors & Quaternions + + +Node1 + + +3D Quaternion operations + + + Node2->Node1 - - + + diff --git a/dc/db4/md__r_e_v_i_e_w_e_r__c_o_d_e.html b/dc/db4/md__r_e_v_i_e_w_e_r__c_o_d_e.html index 2dfa0d844..15595a9d6 100644 --- a/dc/db4/md__r_e_v_i_e_w_e_r__c_o_d_e.html +++ b/dc/db4/md__r_e_v_i_e_w_e_r__c_o_d_e.html @@ -2,8 +2,8 @@ - - + + 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/dbe/poly__add_8c__incl.svg b/dc/dbe/poly__add_8c__incl.svg index 398ecbbc5..586d472ee 100644 --- a/dc/dbe/poly__add_8c__incl.svg +++ b/dc/dbe/poly__add_8c__incl.svg @@ -1,7 +1,7 @@ - + + + + diff --git a/dc/dc7/sentinel__linear__search_8c__incl.md5 b/dc/dc7/sentinel__linear__search_8c__incl.md5 new file mode 100644 index 000000000..70b559f36 --- /dev/null +++ b/dc/dc7/sentinel__linear__search_8c__incl.md5 @@ -0,0 +1 @@ +0628b2134105cab82262c720a264ba70 \ No newline at end of file diff --git a/dc/dc7/sentinel__linear__search_8c__incl.svg b/dc/dc7/sentinel__linear__search_8c__incl.svg new file mode 100644 index 000000000..7a6aa8659 --- /dev/null +++ b/dc/dc7/sentinel__linear__search_8c__incl.svg @@ -0,0 +1,53 @@ + + + + + + +searching/sentinel_linear_search.c + + + +Node1 + + +searching/sentinel +_linear_search.c + + + + + +Node2 + + +stdio.h + + + + + +Node1->Node2 + + + + + +Node3 + + +assert.h + + + + + +Node1->Node3 + + + + + diff --git a/dc/dc9/bubble__sort__recursion_8c__incl.map b/dc/dc9/bubble__sort__recursion_8c__incl.map index 62c6bb2a0..e57eaf871 100644 --- a/dc/dc9/bubble__sort__recursion_8c__incl.map +++ b/dc/dc9/bubble__sort__recursion_8c__incl.map @@ -1,8 +1,8 @@ - + - - - - + + + + diff --git a/dc/dc9/bubble__sort__recursion_8c__incl.svg b/dc/dc9/bubble__sort__recursion_8c__incl.svg index 449dce531..aac9780d1 100644 --- a/dc/dc9/bubble__sort__recursion_8c__incl.svg +++ b/dc/dc9/bubble__sort__recursion_8c__incl.svg @@ -1,21 +1,21 @@ - - + sorting/bubble_sort_recursion.c - + Node1 - -sorting/bubble_sort -_recursion.c + +sorting/bubble_sort +_recursion.c @@ -31,68 +31,68 @@ Node1->Node2 - - + + Node3 - -stdbool.h + +stdbool.h Node1->Node3 - - + + Node4 - -stdio.h + +stdio.h Node1->Node4 - - + + Node5 - -stdlib.h + +stdlib.h Node1->Node5 - - + + Node6 - -time.h + +time.h Node1->Node6 - - + + diff --git a/dc/dc9/infix__to__postfix_8c__incl.svg b/dc/dc9/infix__to__postfix_8c__incl.svg index 497e94f67..02411dbb2 100644 --- a/dc/dc9/infix__to__postfix_8c__incl.svg +++ b/dc/dc9/infix__to__postfix_8c__incl.svg @@ -1,7 +1,7 @@ - - + diff --git a/dc/dd4/kohonen__som__topology_8c__incl.svg b/dc/dd4/kohonen__som__topology_8c__incl.svg index cd00f8a1a..7484e0e27 100644 --- a/dc/dd4/kohonen__som__topology_8c__incl.svg +++ b/dc/dd4/kohonen__som__topology_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - -machine_learning/kohonen + +machine_learning/kohonen _som_topology.c diff --git a/dc/dd5/problem__7_2sol2_8c__incl.map b/dc/dd5/problem__7_2sol2_8c__incl.map index cf6ed4f26..5a51aafd8 100644 --- a/dc/dd5/problem__7_2sol2_8c__incl.map +++ b/dc/dd5/problem__7_2sol2_8c__incl.map @@ -1,4 +1,4 @@ - - + + diff --git a/dc/dd5/problem__7_2sol2_8c__incl.svg b/dc/dd5/problem__7_2sol2_8c__incl.svg index 243041294..a04e48579 100644 --- a/dc/dd5/problem__7_2sol2_8c__incl.svg +++ b/dc/dd5/problem__7_2sol2_8c__incl.svg @@ -1,21 +1,21 @@ - - + project_euler/problem_7/sol2.c - + Node1 - + project_euler/problem -_7/sol2.c +_7/sol2.c @@ -23,16 +23,16 @@ Node2 - -stdio.h + +stdio.h Node1->Node2 - - + + diff --git a/dc/de3/hash__set_8h_source.html b/dc/de3/hash__set_8h_source.html index cec2a74c5..c037df9f0 100644 --- a/dc/de3/hash__set_8h_source.html +++ b/dc/de3/hash__set_8h_source.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: data_structures/hash_set/hash_set.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,43 +90,42 @@ $(document).ready(function(){initNavTree('dc/de3/hash__set_8h_source.html','../.
-
-
hash_set.h
+
hash_set.h
-
1 #ifndef __HASH_SET__
-
2 #define __HASH_SET__
-
3 
-
4 #define DEFAULT_HASH_SET_CAPACITY 1 << 10
-
5 
-
6 typedef struct
-
7 {
-
8  unsigned capacity;
-
9  unsigned length;
-
10  void **values;
-
11  void **keys;
-
12 } hash_set_t;
-
13 
-
14 extern hash_set_t *init_hash_set();
-
15 
-
16 extern unsigned add(hash_set_t *set, void *value);
-
17 
-
18 unsigned put(hash_set_t *set, long long hash, void *value);
-
19 
-
20 extern int contains(hash_set_t *set, void *value);
-
21 
-
22 int contains_hash(hash_set_t *set, long long hash);
-
23 
-
24 extern void delete (hash_set_t *set, void *value);
-
25 
-
26 extern long long hash(void *value);
-
27 
-
28 extern unsigned retrieve_index_from_hash(const long long hash,
-
29  const unsigned capacity);
-
30 
-
31 extern void resize(hash_set_t *set);
-
32 
-
33 #endif
+
1#ifndef __HASH_SET__
+
2#define __HASH_SET__
+
3
+
4#define DEFAULT_HASH_SET_CAPACITY 1 << 10
+
5
+
6typedef struct
+
7{
+
8 unsigned capacity;
+
9 unsigned length;
+
10 void **values;
+
11 void **keys;
+ +
13
+
14extern hash_set_t *init_hash_set();
+
15
+
16extern unsigned add(hash_set_t *set, void *value);
+
17
+
18unsigned put(hash_set_t *set, long long hash, void *value);
+
19
+
20extern int contains(hash_set_t *set, void *value);
+
21
+
22int contains_hash(hash_set_t *set, long long hash);
+
23
+
24extern void delete (hash_set_t *set, void *value);
+
25
+
26extern long long hash(void *value);
+
27
+
28extern unsigned retrieve_index_from_hash(const long long hash,
+
29 const unsigned capacity);
+
30
+
31extern void resize(hash_set_t *set);
+
32
+
33#endif
Definition: hash_set.h:7
@@ -134,7 +133,7 @@ $(document).ready(function(){initNavTree('dc/de3/hash__set_8h_source.html','../. diff --git a/dc/de5/structsubset.html b/dc/de5/structsubset.html index 3f2f8e28d..e911da890 100644 --- a/dc/de5/structsubset.html +++ b/dc/de5/structsubset.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: subset 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() {
@@ -92,17 +92,16 @@ $(document).ready(function(){initNavTree('dc/de5/structsubset.html','../../'); i
-
-
subset Struct Reference
+
subset Struct Reference
- - -

+

Data Fields

+
int parent
 
+
int rank
 
@@ -115,7 +114,7 @@ int rank diff --git a/dc/de5/structsubset.js b/dc/de5/structsubset.js deleted file mode 100644 index 245ea423f..000000000 --- a/dc/de5/structsubset.js +++ /dev/null @@ -1,5 +0,0 @@ -var structsubset = -[ - [ "parent", "dc/de5/structsubset.html#ad8f7d99dc56f8ce3f0c3aaf4a633373a", null ], - [ "rank", "dc/de5/structsubset.html#a2cc3bbda6f758afb7bf8067eb8f07a10", null ] -]; \ No newline at end of file diff --git a/dd/d06/structsegment__tree.html b/dd/d06/structsegment__tree.html index d9c166560..5646baea0 100644 --- a/dd/d06/structsegment__tree.html +++ b/dd/d06/structsegment__tree.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: segment_tree 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() {
@@ -92,39 +92,38 @@ $(document).ready(function(){initNavTree('dd/d06/structsegment__tree.html','../.
-
-
segment_tree Struct Reference
+
segment_tree Struct Reference

This structures holds all the data that is required by a segment tree. More...

- - + - + - + - + - +

+

Data Fields

-void * root
+void * root
 the root of formed segment tree
 
-void * identity
+void * identity
 identity element for combine function
 
-size_t elem_size
+size_t elem_size
 size in bytes of each data element
 
-size_t length
+size_t length
 total size of array which segment tree represents
 
-combine_function combine
+combine_function combine
 the function to be used to combine two node's data to form parent's data
 

Detailed Description

-

This structures holds all the data that is required by a segment tree.

+

This structures holds all the data that is required by a segment tree.


The documentation for this struct was generated from the following file: @@ -134,7 +133,7 @@ size_t 
diff --git a/dd/d06/structterm__coll__graph.svg b/dd/d06/structterm__coll__graph.svg index 77ea66f51..bef9017dd 100644 --- a/dd/d06/structterm__coll__graph.svg +++ b/dd/d06/structterm__coll__graph.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C: numerical_methods/newton_raphson_root.c 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('dd/d08/newton__raphson__root_8c.html', -
-
newton_raphson_root.c File Reference
+
newton_raphson_root.c File Reference
@@ -113,14 +112,14 @@ Include dependency graph for newton_raphson_root.c:
- - +

+

Macros

-#define ACCURACY   1e-10
+#define ACCURACY   1e-10
 solution accuracy
 
- @@ -128,16 +127,15 @@ Functions - - + +

+

Functions

double complex func (double complex x)
 Return value of the function to find the root for. More...
double complex d_func (double complex x)
 Return first order derivative of the function. More...
 
-int main (int argc, char **argv)
 main function
int main (int argc, char **argv)
 main function More...
 

Detailed Description

-

Find approximate solution for \(f(x) = 0\) using Newton-Raphson interpolation algorithm.

-
Author
Krishna Vedala
+

Find approximate solution for \(f(x) = 0\) using Newton-Raphson interpolation algorithm.

+
Author
Krishna Vedala

Function Documentation

- +

◆ d_func()

@@ -154,12 +152,12 @@ int 

Return first order derivative of the function.

-

\(f'(x)\)

-
32 { return 2. * x; }
+

\(f'(x)\)

+
32{ return 2. * x; }
- +

◆ func()

@@ -176,12 +174,90 @@ int 

Return value of the function to find the root for.

-

\(f(x)\)

-
23 {
-
24  return x * x - 3.; /* x^2 = 3 - solution is sqrt(3) */
-
25  // return x * x - 2.; /* x^2 = 2 - solution is sqrt(2) */
-
26 }
+

\(f(x)\)

+
23{
+
24 return x * x - 3.; /* x^2 = 3 - solution is sqrt(3) */
+
25 // return x * x - 2.; /* x^2 = 2 - solution is sqrt(2) */
+
26}
+
+
+ +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char ** argv 
)
+
+ +

main function

+
38{
+
39 double delta = 1;
+
40 double complex cdelta = 1;
+
41
+
42 /* initialize random seed: */
+
43 srand(time(NULL));
+
44
+
45 /* random initial approximation */
+
46 double complex root = (rand() % 100 - 50) + (rand() % 100 - 50) * I;
+
47
+
48 unsigned long counter = 0;
+
49 /* iterate till a convergence is reached */
+
50 while (delta > ACCURACY && counter < ULONG_MAX)
+
51 {
+
52 cdelta = func(root) / d_func(root);
+
53 root += -cdelta;
+
54 counter++;
+
55 delta = fabs(cabs(cdelta));
+
56
+
57#if defined(DEBUG) || !defined(NDEBUG)
+
58 if (counter % 50 == 0)
+
59 {
+
60 double r = creal(root);
+
61 double c = cimag(root);
+
62
+
63 printf("Iter %5lu: Root: %4.4g%c%4.4gi\t\tdelta: %.4g\n", counter,
+
64 r, c >= 0 ? '+' : '-', c >= 0 ? c : -c, delta);
+
65 }
+
66#endif
+
67 }
+
68
+
69 double r = creal(root);
+
70 double c = fabs(cimag(root)) < ACCURACY ? 0 : cimag(root);
+
71
+
72 printf("Iter %5lu: Root: %4.4g%c%4.4gi\t\tdelta: %.4g\n", counter, r,
+
73 c >= 0 ? '+' : '-', c >= 0 ? c : -c, delta);
+
74
+
75 return 0;
+
76}
+
double complex func(double complex x)
Return value of the function to find the root for.
Definition: newton_raphson_root.c:22
+
double complex d_func(double complex x)
Return first order derivative of the function.
Definition: newton_raphson_root.c:32
+
#define ACCURACY
solution accuracy
Definition: newton_raphson_root.c:16
+
+Here is the call graph for this function:
+
+
+
+
+
@@ -190,7 +266,7 @@ int  diff --git a/dd/d08/newton__raphson__root_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map b/dd/d08/newton__raphson__root_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map new file mode 100644 index 000000000..3beec9f46 --- /dev/null +++ b/dd/d08/newton__raphson__root_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/dd/d08/newton__raphson__root_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 b/dd/d08/newton__raphson__root_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 new file mode 100644 index 000000000..ff32ddd67 --- /dev/null +++ b/dd/d08/newton__raphson__root_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 @@ -0,0 +1 @@ +6b6777fc85fa7df85dbc53d29d6b093f \ No newline at end of file diff --git a/dd/d08/newton__raphson__root_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg b/dd/d08/newton__raphson__root_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg new file mode 100644 index 000000000..b40607389 --- /dev/null +++ b/dd/d08/newton__raphson__root_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg @@ -0,0 +1,52 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +d_func + + + + + +Node1->Node2 + + + + + +Node3 + + +func + + + + + +Node1->Node3 + + + + + diff --git a/dd/d10/struct_stack.html b/dd/d10/struct_stack.html index 39bfda72e..4bbd4e25f 100644 --- a/dd/d10/struct_stack.html +++ b/dd/d10/struct_stack.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Stack 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() {
@@ -92,40 +92,53 @@ $(document).ready(function(){initNavTree('dd/d10/struct_stack.html','../../'); i
-
-
Stack Struct Reference
+
Stack Struct Reference

for printf() and scanf() More...

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

+

Data Fields

+
char arr [10]
 
-int tos
+int tos
 
-

static array of integers

+

static array of integers


 
+
+char stack [10]
 array stack
 
+int top
 stores index of the top element
 
int arr [MAX_SIZE]
 
-int top
 
+int8_t stack [20]
 array stack
 

Detailed Description

-

for printf() and scanf()

-

a globally declared structure with an array and an variable that points to the topmost index of the array

+

for printf() and scanf()

+

for IO operations for strlen() for isdigit() for exit() for int8_t for assert

+

for IO operations for strlen(), strcmp() for isalnum() for exit() for uint16_t, int16_t for assert

+

a globally declared structure with an array and an variable that points to the topmost index of the array

+

array implementation of stack using structure


The documentation for this struct was generated from the following files:
@@ -133,7 +146,7 @@ int top diff --git a/dd/d10/struct_stack.js b/dd/d10/struct_stack.js index d676f363b..96d7ff9ff 100644 --- a/dd/d10/struct_stack.js +++ b/dd/d10/struct_stack.js @@ -1,7 +1,7 @@ var struct_stack = [ - [ "arr", "dd/d10/struct_stack.html#a2a9b92a4668113debfb801b39a41fea2", null ], - [ "arr", "dd/d10/struct_stack.html#a6cd56fb14cbfe1d0e76e3b1a1bbbde28", null ], + [ "stack", "dd/d10/struct_stack.html#a856ca6f4a9ffde43f0cb3b43cb4d044d", null ], + [ "stack", "dd/d10/struct_stack.html#aa16cf0b36f9735ed00bde97a5013adaa", null ], [ "top", "dd/d10/struct_stack.html#ad62fb36816185f3eef3a6f735a61f54a", null ], [ "tos", "dd/d10/struct_stack.html#ac2dbef151bc913684a90b06836725ef9", null ] ]; \ No newline at end of file diff --git a/dd/d11/test__malloc__dbg_8c.html b/dd/d11/test__malloc__dbg_8c.html index d0c76db4c..eeadfee8b 100644 --- a/dd/d11/test__malloc__dbg_8c.html +++ b/dd/d11/test__malloc__dbg_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: developer_tools/test_malloc_dbg.c 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('dd/d11/test__malloc__dbg_8c.html','../
-
-
test_malloc_dbg.c File Reference
+
test_malloc_dbg.c File Reference
@@ -105,22 +104,22 @@ $(document).ready(function(){initNavTree('dd/d11/test__malloc__dbg_8c.html','../
Include dependency graph for test_malloc_dbg.c:
-
+
-

+

Functions

int main (int argc, char *argv[])
 For IO operations if needed. More...
 

Detailed Description

-

File used to test the malloc_dbg, calloc_dbg and free_dbg functions.

-

This file only have a main function that calls malloc, calloc and free. When the program exits, memory leaks must be printed.

Author
tinouduart33
+

File used to test the malloc_dbg, calloc_dbg and free_dbg functions.

+

This file only have a main function that calls malloc, calloc and free. When the program exits, memory leaks must be printed.

Author
tinouduart33
See also
malloc_dbg.c, malloc_dbg.h

Function Documentation

- +

◆ main()

@@ -147,8 +146,8 @@ Functions

For IO operations if needed.

-

For the EXIT_SUCCESS macro and the "real" malloc, calloc and free functions. For the macros malloc, calloc and free and the malloc_dbg, calloc_dbg and free_dbg functions.

-

Main function

Parameters
+

For the EXIT_SUCCESS macro and the "real" malloc, calloc and free functions. For the macros malloc, calloc and free and the malloc_dbg, calloc_dbg and free_dbg functions.

+

Main function

Parameters
@@ -156,15 +155,15 @@ Functions
Returns
0 on exit
-
23 {
-
24  int* iptr = malloc(10 * sizeof(int));
-
25  char* cptr = calloc(256, sizeof(char));
-
26 
-
27  free(iptr);
-
28  // free(cptr);
-
29 
-
30  return 0;
-
31 }
+
23{
+
24 int* iptr = malloc(10 * sizeof(int));
+
25 char* cptr = calloc(256, sizeof(char));
+
26
+
27 free(iptr);
+
28 // free(cptr);
+
29
+
30 return 0;
+
31}
#define malloc(bytes)
This macro replace the standard malloc function with malloc_dbg.
Definition: malloc_dbg.h:18
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
#define calloc(elemCount, elemSize)
This macro replace the standard calloc function with calloc_dbg.
Definition: malloc_dbg.h:22
@@ -177,7 +176,7 @@ Functions diff --git a/dd/d24/problem__19_2sol1_8c__incl.map b/dd/d24/problem__19_2sol1_8c__incl.map index 7126ffb87..10728f47b 100644 --- a/dd/d24/problem__19_2sol1_8c__incl.map +++ b/dd/d24/problem__19_2sol1_8c__incl.map @@ -1,4 +1,4 @@ - - + + diff --git a/dd/d24/problem__19_2sol1_8c__incl.svg b/dd/d24/problem__19_2sol1_8c__incl.svg index d980e9aeb..1ed18c8d8 100644 --- a/dd/d24/problem__19_2sol1_8c__incl.svg +++ b/dd/d24/problem__19_2sol1_8c__incl.svg @@ -1,21 +1,21 @@ - - + project_euler/problem_19/sol1.c - + Node1 - + project_euler/problem -_19/sol1.c +_19/sol1.c @@ -23,16 +23,16 @@ Node2 - -stdio.h + +stdio.h Node1->Node2 - - + + diff --git a/dd/d29/doubly__linked__list_8c.html b/dd/d29/doubly__linked__list_8c.html index 6b3d8002d..d770a7a8e 100644 --- a/dd/d29/doubly__linked__list_8c.html +++ b/dd/d29/doubly__linked__list_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: data_structures/linked_list/doubly_linked_list.c File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@
@@ -42,21 +41,22 @@
argcnumber of arguments (not used)
argvlist of arguments (not used)
-
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,36 +94,35 @@ $(document).ready(function(){initNavTree('dd/d29/doubly__linked__list_8c.html',' Data Structures | Typedefs | Functions -
-
doubly_linked_list.c File Reference
+
doubly_linked_list.c File Reference
-

Implementation of Doubly linked list +

Implementation of Doubly linked list More...

#include <stdio.h>
#include <stdlib.h>
Include dependency graph for doubly_linked_list.c:
-
+
-

+

Data Structures

struct  list
 Doubly linked list struct. More...
 
- - +

+

Typedefs

-typedef struct list List
+typedef struct list List
 Doubly linked list struct.
 
- @@ -148,12 +147,12 @@ Functions

+

Functions

List * create (double value)
 Create list function, a new list containing one node will be created. More...
 

Detailed Description

-

Implementation of Doubly linked list

-

A doubly linked list is a data structure with a sequence of components called nodes. Within that nodes there are three elements: a value recorded, a pointer to the next node, and a pointer to the previous node.

-

In this implementation, the functions of creating the list, inserting by position, deleting by position, searching for value, printing the list, and an example of how the list works were coded.

-
Author
Gabriel Mota Bromonschenkel Lima
+

Implementation of Doubly linked list

+

A doubly linked list is a data structure with a sequence of components called nodes. Within that nodes there are three elements: a value recorded, a pointer to the next node, and a pointer to the previous node.

+

In this implementation, the functions of creating the list, inserting by position, deleting by position, searching for value, printing the list, and an example of how the list works were coded.

+
Author
Gabriel Mota Bromonschenkel Lima

Function Documentation

- +

◆ create()

@@ -177,13 +176,13 @@ Functions
Returns
new_list the list created
-
93 {
-
94  List *new_list = (List *)malloc(sizeof(List));
-
95  new_list->value = value;
-
96  new_list->next = NULL;
-
97  new_list->prev = NULL;
-
98  return new_list;
-
99 }
+
93{
+
94 List *new_list = (List *)malloc(sizeof(List));
+
95 new_list->value = value;
+
96 new_list->next = NULL;
+
97 new_list->prev = NULL;
+
98 return new_list;
+
99}
#define malloc(bytes)
This macro replace the standard malloc function with malloc_dbg.
Definition: malloc_dbg.h:18
Doubly linked list struct.
Definition: doubly_linked_list.c:24
struct list * prev
directing to other nodes or NULL
Definition: doubly_linked_list.c:26
@@ -191,7 +190,7 @@ Functions
- +

◆ delete()

@@ -226,64 +225,64 @@ Functions
Returns
list the input list with deleted values or the same list
-
180 {
-
181  // list NULL case
-
182  if (list == NULL)
-
183  return list;
-
184 
-
185  // position existing case
-
186  if (pos > 0)
-
187  {
-
188  List *cpy = list, *tmp = cpy;
-
189  int flag = 1, index = 1, size = 0;
-
190 
-
191  while (tmp != NULL)
-
192  {
-
193  size++;
-
194  tmp = tmp->next;
-
195  }
-
196 
-
197  // first position case
-
198  if (pos == 1)
-
199  {
-
200  if (size == 1)
-
201  return NULL;
-
202  cpy = cpy->next;
-
203  cpy->prev = NULL;
-
204  return cpy;
-
205  }
-
206 
-
207  // position existing in list range case
-
208  if (size + 2 > pos)
-
209  {
-
210  while (cpy->next != NULL && index < pos)
-
211  {
-
212  flag++;
-
213  index++;
-
214  cpy = cpy->next;
-
215  }
-
216 
-
217  if (flag == pos)
-
218  {
-
219  // position into list with no poiting for NULL
-
220  if (cpy->next != NULL)
-
221  {
-
222  cpy->prev->next = cpy->next;
-
223  cpy->next->prev = cpy->prev;
-
224  }
-
225 
-
226  // last position case
-
227  else
-
228  cpy->prev->next = NULL;
-
229  }
-
230  }
-
231  return list;
-
232  }
-
233 }
+
180{
+
181 // list NULL case
+
182 if (list == NULL)
+
183 return list;
+
184
+
185 // position existing case
+
186 if (pos > 0)
+
187 {
+
188 List *cpy = list, *tmp = cpy;
+
189 int flag = 1, index = 1, size = 0;
+
190
+
191 while (tmp != NULL)
+
192 {
+
193 size++;
+
194 tmp = tmp->next;
+
195 }
+
196
+
197 // first position case
+
198 if (pos == 1)
+
199 {
+
200 if (size == 1)
+
201 return NULL;
+
202 cpy = cpy->next;
+
203 cpy->prev = NULL;
+
204 return cpy;
+
205 }
+
206
+
207 // position existing in list range case
+
208 if (size + 2 > pos)
+
209 {
+
210 while (cpy->next != NULL && index < pos)
+
211 {
+
212 flag++;
+
213 index++;
+
214 cpy = cpy->next;
+
215 }
+
216
+
217 if (flag == pos)
+
218 {
+
219 // position into list with no poiting for NULL
+
220 if (cpy->next != NULL)
+
221 {
+
222 cpy->prev->next = cpy->next;
+
223 cpy->next->prev = cpy->prev;
+
224 }
+
225
+
226 // last position case
+
227 else
+
228 cpy->prev->next = NULL;
+
229 }
+
230 }
+
231 return list;
+
232 }
+
233}
- +

◆ example()

@@ -300,30 +299,30 @@ Functions

Example function.

Returns
void
-
270 {
-
271  List *my_list = NULL;
-
272  double node_value = 0;
-
273  int searching;
-
274 
-
275  my_list = create(node_value);
-
276  my_list = insert(my_list, 3, 1);
-
277  my_list = insert(my_list, 5, 3);
-
278  my_list = insert(my_list, 10, 3);
-
279  my_list = insert(my_list, 20, 3);
-
280 
-
281  print(my_list);
-
282  searching = search(my_list, 20);
-
283  printf("\n%d\n", searching);
-
284 
-
285  my_list = delete (my_list, 1);
-
286  my_list = delete (my_list, 1);
-
287  my_list = delete (my_list, 1);
-
288  my_list = delete (my_list, 1);
-
289 
-
290  print(my_list);
-
291  searching = search(my_list, 20);
-
292  printf("\n%d\n", searching);
-
293 }
+
270{
+
271 List *my_list = NULL;
+
272 double node_value = 0;
+
273 int searching;
+
274
+
275 my_list = create(node_value);
+
276 my_list = insert(my_list, 3, 1);
+
277 my_list = insert(my_list, 5, 3);
+
278 my_list = insert(my_list, 10, 3);
+
279 my_list = insert(my_list, 20, 3);
+
280
+
281 print(my_list);
+
282 searching = search(my_list, 20);
+
283 printf("\n%d\n", searching);
+
284
+
285 my_list = delete (my_list, 1);
+
286 my_list = delete (my_list, 1);
+
287 my_list = delete (my_list, 1);
+
288 my_list = delete (my_list, 1);
+
289
+
290 print(my_list);
+
291 searching = search(my_list, 20);
+
292 printf("\n%d\n", searching);
+
293}
List * insert(List *list, double value, int pos)
Insertion by position into the list function.
Definition: doubly_linked_list.c:108
void print(List *list)
Print list function.
Definition: doubly_linked_list.c:256
List * create(double value)
Create list function, a new list containing one node will be created.
Definition: doubly_linked_list.c:92
@@ -331,13 +330,13 @@ Functions
Here is the call graph for this function:
-
+
- +

◆ insert()

@@ -379,69 +378,69 @@ Here is the call graph for this function:
Returns
list the input list with a node more or the same list
-
109 {
-
110  // list NULL case
-
111  if (list == NULL)
-
112  {
-
113  list = create(value);
-
114  return list;
-
115  }
-
116 
-
117  // position existing case
-
118  if (pos > 0)
-
119  {
-
120  List *cpy = list, *tmp = cpy;
-
121  int flag = 1, index = 1, size = 0;
-
122 
-
123  while (tmp != NULL)
-
124  {
-
125  size++;
-
126  tmp = tmp->next;
-
127  }
-
128 
-
129  // first position case
-
130  if (pos == 1)
-
131  {
-
132  List *new_node = create(value);
-
133  new_node->next = cpy;
-
134  cpy->prev = new_node;
-
135  list = new_node;
-
136  return list;
-
137  }
-
138 
-
139  // position existing in list range case
-
140  if (size + 2 > pos)
-
141  {
-
142  while (cpy->next != NULL && index < pos)
-
143  {
-
144  flag++;
-
145  index++;
-
146  cpy = cpy->next;
-
147  }
-
148 
-
149  List *new_node = (List *)malloc(sizeof(List));
-
150  new_node->value = value;
-
151 
-
152  // position into list with no poiting for NULL
-
153  if (flag == pos)
-
154  {
-
155  cpy->prev->next = new_node;
-
156  new_node->next = cpy;
-
157  new_node->prev = cpy->prev;
-
158  cpy->prev = new_node;
-
159  }
-
160 
-
161  // last position case
-
162  if (flag < pos)
-
163  {
-
164  new_node->next = cpy->next;
-
165  new_node->prev = cpy;
-
166  cpy->next = new_node;
-
167  }
-
168  }
-
169  return list;
-
170  }
-
171 }
+
109{
+
110 // list NULL case
+
111 if (list == NULL)
+
112 {
+
113 list = create(value);
+
114 return list;
+
115 }
+
116
+
117 // position existing case
+
118 if (pos > 0)
+
119 {
+
120 List *cpy = list, *tmp = cpy;
+
121 int flag = 1, index = 1, size = 0;
+
122
+
123 while (tmp != NULL)
+
124 {
+
125 size++;
+
126 tmp = tmp->next;
+
127 }
+
128
+
129 // first position case
+
130 if (pos == 1)
+
131 {
+
132 List *new_node = create(value);
+
133 new_node->next = cpy;
+
134 cpy->prev = new_node;
+
135 list = new_node;
+
136 return list;
+
137 }
+
138
+
139 // position existing in list range case
+
140 if (size + 2 > pos)
+
141 {
+
142 while (cpy->next != NULL && index < pos)
+
143 {
+
144 flag++;
+
145 index++;
+
146 cpy = cpy->next;
+
147 }
+
148
+
149 List *new_node = (List *)malloc(sizeof(List));
+
150 new_node->value = value;
+
151
+
152 // position into list with no poiting for NULL
+
153 if (flag == pos)
+
154 {
+
155 cpy->prev->next = new_node;
+
156 new_node->next = cpy;
+
157 new_node->prev = cpy->prev;
+
158 cpy->prev = new_node;
+
159 }
+
160
+
161 // last position case
+
162 if (flag < pos)
+
163 {
+
164 new_node->next = cpy->next;
+
165 new_node->prev = cpy;
+
166 cpy->next = new_node;
+
167 }
+
168 }
+
169 return list;
+
170 }
+
171}
Here is the call graph for this function:
@@ -451,7 +450,7 @@ Here is the call graph for this function:
- +

◆ main()

@@ -469,23 +468,23 @@ Here is the call graph for this function:

Main function.

Returns
0 on exit
-
80 {
-
81  // examples for better understanding
-
82  example();
-
83  // code here
-
84  return 0;
-
85 }
+
80{
+
81 // examples for better understanding
+
82 example();
+
83 // code here
+
84 return 0;
+
85}
void example()
Example function.
Definition: doubly_linked_list.c:269
Here is the call graph for this function:
-
+
- +

◆ print()

@@ -509,17 +508,23 @@ Here is the call graph for this function:
Returns
void
-
257 {
-
258  if (list != NULL)
-
259  {
-
260  printf("%f\t", list->value);
-
261  print(list->next);
-
262  }
-
263 }
-
+
257{
+
258 if (list != NULL)
+
259 {
+
260 printf("%f\t", list->value);
+
261 print(list->next);
+
262 }
+
263}
+
+Here is the call graph for this function:
+
+
- + +
+
+

◆ search()

@@ -556,14 +561,20 @@ Here is the call graph for this function:
Returns
1 if the looked up value exists
0 if the looked up value doesn't exist
-
243 {
-
244  if (list == NULL)
-
245  return 0;
-
246  if (list->value == value)
-
247  return 1;
-
248  search(list->next, value);
-
249 }
-
+
243{
+
244 if (list == NULL)
+
245 return 0;
+
246 if (list->value == value)
+
247 return 1;
+
248 search(list->next, value);
+
249}
+
+Here is the call graph for this function:
+
+
+
+
+
@@ -572,7 +583,7 @@ Here is the call graph for this function: diff --git a/dd/d29/doubly__linked__list_8c_a04ac29c396dc8335a5827927183c9918_cgraph.svg b/dd/d29/doubly__linked__list_8c_a04ac29c396dc8335a5827927183c9918_cgraph.svg index 08b439a97..acf610e58 100644 --- a/dd/d29/doubly__linked__list_8c_a04ac29c396dc8335a5827927183c9918_cgraph.svg +++ b/dd/d29/doubly__linked__list_8c_a04ac29c396dc8335a5827927183c9918_cgraph.svg @@ -1,7 +1,7 @@ - + +
diff --git a/dd/d29/doubly__linked__list_8c_a1fadec32fc369a8dcfbcd766e166efa0_cgraph.md5 b/dd/d29/doubly__linked__list_8c_a1fadec32fc369a8dcfbcd766e166efa0_cgraph.md5 new file mode 100644 index 000000000..fb6e4aeed --- /dev/null +++ b/dd/d29/doubly__linked__list_8c_a1fadec32fc369a8dcfbcd766e166efa0_cgraph.md5 @@ -0,0 +1 @@ +4f484c8fa045056f09b71f5cd0c0fa55 \ No newline at end of file diff --git a/dd/d29/doubly__linked__list_8c_a1fadec32fc369a8dcfbcd766e166efa0_cgraph.svg b/dd/d29/doubly__linked__list_8c_a1fadec32fc369a8dcfbcd766e166efa0_cgraph.svg new file mode 100644 index 000000000..fffd3142a --- /dev/null +++ b/dd/d29/doubly__linked__list_8c_a1fadec32fc369a8dcfbcd766e166efa0_cgraph.svg @@ -0,0 +1,28 @@ + + + + + + +print + + + +Node1 + + +print + + + + + +Node1->Node1 + + + + + diff --git a/dd/d29/doubly__linked__list_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/dd/d29/doubly__linked__list_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map index c32f914c7..232c64b27 100644 --- a/dd/d29/doubly__linked__list_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map +++ b/dd/d29/doubly__linked__list_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -1,8 +1,8 @@ - - - - - - + + + + + + diff --git a/dd/d29/doubly__linked__list_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/dd/d29/doubly__linked__list_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 index 9492d850a..a265c584e 100644 --- a/dd/d29/doubly__linked__list_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 +++ b/dd/d29/doubly__linked__list_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -1 +1 @@ -b71d87d87c0fe65c5cc40e871a29d664 \ No newline at end of file +633575d3b94604f3973e944485b52043 \ No newline at end of file diff --git a/dd/d29/doubly__linked__list_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/dd/d29/doubly__linked__list_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index 964e62a95..d9a151605 100644 --- a/dd/d29/doubly__linked__list_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/dd/d29/doubly__linked__list_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,20 +1,20 @@ - - - + + main - + Node1 - -main + +main @@ -22,82 +22,94 @@ Node2 - -example + +example Node1->Node2 - - + + Node3 - -create + +create Node2->Node3 - - + + Node4 - -insert + +insert Node2->Node4 - - + + Node5 - -print + +print Node2->Node5 - - + + Node6 - -search + +search - + Node2->Node6 - - + + Node4->Node3 - - + + + + + +Node5->Node5 + + + + + +Node6->Node6 + + diff --git a/dd/d29/doubly__linked__list_8c_aedd04074dbc6af0de89051f97209311b_cgraph.map b/dd/d29/doubly__linked__list_8c_aedd04074dbc6af0de89051f97209311b_cgraph.map new file mode 100644 index 000000000..39180f352 --- /dev/null +++ b/dd/d29/doubly__linked__list_8c_aedd04074dbc6af0de89051f97209311b_cgraph.map @@ -0,0 +1,3 @@ + + + diff --git a/dd/d29/doubly__linked__list_8c_aedd04074dbc6af0de89051f97209311b_cgraph.md5 b/dd/d29/doubly__linked__list_8c_aedd04074dbc6af0de89051f97209311b_cgraph.md5 new file mode 100644 index 000000000..80e7f5d0a --- /dev/null +++ b/dd/d29/doubly__linked__list_8c_aedd04074dbc6af0de89051f97209311b_cgraph.md5 @@ -0,0 +1 @@ +13f33eee8fa456c4f2474be12b47093b \ No newline at end of file diff --git a/dd/d29/doubly__linked__list_8c_aedd04074dbc6af0de89051f97209311b_cgraph.svg b/dd/d29/doubly__linked__list_8c_aedd04074dbc6af0de89051f97209311b_cgraph.svg new file mode 100644 index 000000000..13208c502 --- /dev/null +++ b/dd/d29/doubly__linked__list_8c_aedd04074dbc6af0de89051f97209311b_cgraph.svg @@ -0,0 +1,28 @@ + + + + + + +search + + + +Node1 + + +search + + + + + +Node1->Node1 + + + + + diff --git a/dd/d29/doubly__linked__list_8c_afa2b50f4716fc3b42221a72e676e1422_cgraph.map b/dd/d29/doubly__linked__list_8c_afa2b50f4716fc3b42221a72e676e1422_cgraph.map index 26b35edcd..53b63b41f 100644 --- a/dd/d29/doubly__linked__list_8c_afa2b50f4716fc3b42221a72e676e1422_cgraph.map +++ b/dd/d29/doubly__linked__list_8c_afa2b50f4716fc3b42221a72e676e1422_cgraph.map @@ -1,7 +1,7 @@ - - - - - + + + + + diff --git a/dd/d29/doubly__linked__list_8c_afa2b50f4716fc3b42221a72e676e1422_cgraph.md5 b/dd/d29/doubly__linked__list_8c_afa2b50f4716fc3b42221a72e676e1422_cgraph.md5 index e0e603859..be0db9436 100644 --- a/dd/d29/doubly__linked__list_8c_afa2b50f4716fc3b42221a72e676e1422_cgraph.md5 +++ b/dd/d29/doubly__linked__list_8c_afa2b50f4716fc3b42221a72e676e1422_cgraph.md5 @@ -1 +1 @@ -0a7df6bcd28838328d10f6747c2e3629 \ No newline at end of file +bd8cf28e2f37eed6693f1a30552e20ce \ No newline at end of file diff --git a/dd/d29/doubly__linked__list_8c_afa2b50f4716fc3b42221a72e676e1422_cgraph.svg b/dd/d29/doubly__linked__list_8c_afa2b50f4716fc3b42221a72e676e1422_cgraph.svg index 2682faeb2..8a4028983 100644 --- a/dd/d29/doubly__linked__list_8c_afa2b50f4716fc3b42221a72e676e1422_cgraph.svg +++ b/dd/d29/doubly__linked__list_8c_afa2b50f4716fc3b42221a72e676e1422_cgraph.svg @@ -1,20 +1,20 @@ - - - + + example - + Node1 - -example + +example @@ -22,67 +22,79 @@ Node2 - -create + +create Node1->Node2 - - + + Node3 - -insert + +insert Node1->Node3 - - + + Node4 - -print + +print Node1->Node4 - - + + Node5 - -search + +search - + Node1->Node5 - - + + Node3->Node2 - - + + + + + +Node4->Node4 + + + + + +Node5->Node5 + + diff --git a/dd/d2f/udp__server_8c__incl.map b/dd/d2f/udp__server_8c__incl.map index e6460360c..ebdbd32cb 100644 --- a/dd/d2f/udp__server_8c__incl.map +++ b/dd/d2f/udp__server_8c__incl.map @@ -1,12 +1,12 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/dd/d2f/udp__server_8c__incl.svg b/dd/d2f/udp__server_8c__incl.svg index 490084388..37aa70a8c 100644 --- a/dd/d2f/udp__server_8c__incl.svg +++ b/dd/d2f/udp__server_8c__incl.svg @@ -1,7 +1,7 @@ - @@ -46,7 +46,7 @@ if (edges && edges.length) { @@ -54,13 +54,13 @@ var sectionId = 'dynsection-0'; client_server/udp_server.c - + Node1 - -client_server/udp_server.c + +client_server/udp_server.c @@ -68,136 +68,136 @@ var sectionId = 'dynsection-0'; Node2 - -arpa/inet.h + +arpa/inet.h Node1->Node2 - - + + Node3 - -netdb.h + +netdb.h Node1->Node3 - - + + Node4 - -netinet/in.h + +netinet/in.h Node1->Node4 - - + + Node5 - -sys/socket.h + +sys/socket.h Node1->Node5 - - + + Node6 - -sys/types.h + +sys/types.h Node1->Node6 - - + + Node7 - -unistd.h + +unistd.h Node1->Node7 - - + + Node8 - -stdio.h + +stdio.h Node1->Node8 - - + + Node9 - -stdlib.h + +stdlib.h Node1->Node9 - - + + Node10 - -string.h + +string.h Node1->Node10 - - + + diff --git a/dd/d2f/udp__server_8c__incl_org.svg b/dd/d2f/udp__server_8c__incl_org.svg index 5ea752749..d523b3398 100644 --- a/dd/d2f/udp__server_8c__incl_org.svg +++ b/dd/d2f/udp__server_8c__incl_org.svg @@ -1,20 +1,20 @@ - - + client_server/udp_server.c - + Node1 - -client_server/udp_server.c + +client_server/udp_server.c @@ -22,136 +22,136 @@ Node2 - -arpa/inet.h + +arpa/inet.h Node1->Node2 - - + + Node3 - -netdb.h + +netdb.h Node1->Node3 - - + + Node4 - -netinet/in.h + +netinet/in.h Node1->Node4 - - + + Node5 - -sys/socket.h + +sys/socket.h Node1->Node5 - - + + Node6 - -sys/types.h + +sys/types.h Node1->Node6 - - + + Node7 - -unistd.h + +unistd.h Node1->Node7 - - + + Node8 - -stdio.h + +stdio.h Node1->Node8 - - + + Node9 - -stdlib.h + +stdlib.h Node1->Node9 - - + + Node10 - -string.h + +string.h Node1->Node10 - - + + diff --git a/dd/d3d/tcp__half__duplex__server_8c__incl.map b/dd/d3d/tcp__half__duplex__server_8c__incl.map new file mode 100644 index 000000000..f927d16f8 --- /dev/null +++ b/dd/d3d/tcp__half__duplex__server_8c__incl.map @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/dd/d3d/tcp__half__duplex__server_8c__incl.md5 b/dd/d3d/tcp__half__duplex__server_8c__incl.md5 new file mode 100644 index 000000000..2b6d7d692 --- /dev/null +++ b/dd/d3d/tcp__half__duplex__server_8c__incl.md5 @@ -0,0 +1 @@ +9887ee5388f5b16487ca7e21ac5b3cd4 \ No newline at end of file diff --git a/dd/d3d/tcp__half__duplex__server_8c__incl.svg b/dd/d3d/tcp__half__duplex__server_8c__incl.svg new file mode 100644 index 000000000..6c53f9724 --- /dev/null +++ b/dd/d3d/tcp__half__duplex__server_8c__incl.svg @@ -0,0 +1,246 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +client_server/tcp_half_duplex_server.c + + + +Node1 + + +client_server/tcp_half +_duplex_server.c + + + + + +Node2 + + +netdb.h + + + + + +Node1->Node2 + + + + + +Node3 + + +netinet/in.h + + + + + +Node1->Node3 + + + + + +Node4 + + +stdint.h + + + + + +Node1->Node4 + + + + + +Node5 + + +stdio.h + + + + + +Node1->Node5 + + + + + +Node6 + + +stdlib.h + + + + + +Node1->Node6 + + + + + +Node7 + + +string.h + + + + + +Node1->Node7 + + + + + +Node8 + + +sys/socket.h + + + + + +Node1->Node8 + + + + + +Node9 + + +sys/types.h + + + + + +Node1->Node9 + + + + + +Node10 + + +unistd.h + + + + + +Node1->Node10 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dd/d3d/tcp__half__duplex__server_8c__incl_org.svg b/dd/d3d/tcp__half__duplex__server_8c__incl_org.svg new file mode 100644 index 000000000..500ae40f2 --- /dev/null +++ b/dd/d3d/tcp__half__duplex__server_8c__incl_org.svg @@ -0,0 +1,158 @@ + + + + + + +client_server/tcp_half_duplex_server.c + + + +Node1 + + +client_server/tcp_half +_duplex_server.c + + + + + +Node2 + + +netdb.h + + + + + +Node1->Node2 + + + + + +Node3 + + +netinet/in.h + + + + + +Node1->Node3 + + + + + +Node4 + + +stdint.h + + + + + +Node1->Node4 + + + + + +Node5 + + +stdio.h + + + + + +Node1->Node5 + + + + + +Node6 + + +stdlib.h + + + + + +Node1->Node6 + + + + + +Node7 + + +string.h + + + + + +Node1->Node7 + + + + + +Node8 + + +sys/socket.h + + + + + +Node1->Node8 + + + + + +Node9 + + +sys/types.h + + + + + +Node1->Node9 + + + + + +Node10 + + +unistd.h + + + + + +Node1->Node10 + + + + + diff --git a/dd/d53/int__to__string_8c.html b/dd/d53/int__to__string_8c.html index 4a49151a8..ce72a18ae 100644 --- a/dd/d53/int__to__string_8c.html +++ b/dd/d53/int__to__string_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: conversions/int_to_string.c 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('dd/d53/int__to__string_8c.html','../..
-
-
int_to_string.c File Reference
+
int_to_string.c File Reference
@@ -112,30 +111,29 @@ Include dependency graph for int_to_string.c:
- - - - + + + - - + +

+

Functions

char * int_to_string (uint16_t value, char *dest, int base)
 Converts an integer value to a null-terminated string using the specified base and stores the result in the array given by str parameter. More...
 
char * int_to_string (uint16_t value, char *dest, int base)
 Converts an integer value to a null-terminated string using the specified base and stores the result in the array given by str parameter. More...
 
static void test ()
 Test function. More...
 
-int main ()
 Driver Code.
int main ()
 Driver Code. More...
 

Detailed Description

-

Convert a positive integer to string (non-standard function) representation.

+

Convert a positive integer to string (non-standard function) representation.

Function Documentation

- -

◆ int_to_string()

+ +

◆ int_to_string()

- + @@ -171,31 +169,64 @@ int  @@ -42,21 +41,22 @@
char* int_to_string char * int_to_string ( uint16_t  value,
Returns
A pointer to the resulting null-terminated string, same as parameter str.
Note
The destination array must be pre-allocated by the calling function.
-
26 {
-
27  const char hex_table[] = {'0', '1', '2', '3', '4', '5', '6', '7',
-
28  '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
-
29 
-
30  int len = 0;
-
31  do
-
32  {
-
33  dest[len++] = hex_table[value % base];
-
34  value /= base;
-
35  } while (value != 0);
-
36 
-
37  /* reverse characters */
-
38  for (int i = 0, limit = len / 2; i < limit; ++i)
-
39  {
-
40  char t = dest[i];
-
41  dest[i] = dest[len - 1 - i];
-
42  dest[len - 1 - i] = t;
-
43  }
-
44  dest[len] = '\0';
-
45  return dest;
-
46 }
+
26{
+
27 const char hex_table[] = {'0', '1', '2', '3', '4', '5', '6', '7',
+
28 '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
+
29
+
30 int len = 0;
+
31 do
+
32 {
+
33 dest[len++] = hex_table[value % base];
+
34 value /= base;
+
35 } while (value != 0);
+
36
+
37 /* reverse characters */
+
38 for (int i = 0, limit = len / 2; i < limit; ++i)
+
39 {
+
40 char t = dest[i];
+
41 dest[i] = dest[len - 1 - i];
+
42 dest[len - 1 - i] = t;
+
43 }
+
44 dest[len] = '\0';
+
45 return dest;
+
46}
- + +

◆ main()

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

Driver Code.

+
78{
+
79 /* Intializes random number generator */
+
80 srand(time(NULL));
+
81 test();
+
82 return 0;
+
83}
+
static void test()
Test function.
Definition: int_to_string.c:51
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+

◆ test()

@@ -221,37 +252,37 @@ int 
Returns
void
-
52 {
-
53  const int MAX_SIZE = 100;
-
54  char *str1 = (char *)calloc(sizeof(char), MAX_SIZE);
-
55  char *str2 = (char *)calloc(sizeof(char), MAX_SIZE);
-
56 
-
57  for (int i = 1; i <= 100; ++i) /* test 100 random numbers */
-
58  {
-
59  /* Generate value from 0 to 100 */
-
60  int value = rand() % 100;
-
61 
-
62  // assert(strcmp(itoa(value, str1, 2), int_to_string(value, str2, 2)) ==
-
63  // 0);
-
64  snprintf(str1, MAX_SIZE, "%o", value); //* standard C - to octal */
-
65  assert(strcmp(str1, int_to_string(value, str2, 8)) == 0);
-
66  snprintf(str1, MAX_SIZE, "%d", value); /* standard C - to decimal */
-
67  assert(strcmp(str1, int_to_string(value, str2, 10)) == 0);
-
68  snprintf(str1, MAX_SIZE, "%x", value); /* standard C - to hexadecimal */
-
69  assert(strcmp(str1, int_to_string(value, str2, 16)) == 0);
-
70  }
-
71 
-
72  free(str1);
-
73  free(str2);
-
74 }
-
char * int_to_string(uint16_t value, char *dest, int base)
Converts an integer value to a null-terminated string using the specified base and stores the result ...
Definition: int_to_string.c:25
+
52{
+
53 const int MAX_SIZE = 100;
+
54 char *str1 = (char *)calloc(sizeof(char), MAX_SIZE);
+
55 char *str2 = (char *)calloc(sizeof(char), MAX_SIZE);
+
56
+
57 for (int i = 1; i <= 100; ++i) /* test 100 random numbers */
+
58 {
+
59 /* Generate value from 0 to 100 */
+
60 int value = rand() % 100;
+
61
+
62 // assert(strcmp(itoa(value, str1, 2), int_to_string(value, str2, 2)) ==
+
63 // 0);
+
64 snprintf(str1, MAX_SIZE, "%o", value); //* standard C - to octal */
+
65 assert(strcmp(str1, int_to_string(value, str2, 8)) == 0);
+
66 snprintf(str1, MAX_SIZE, "%d", value); /* standard C - to decimal */
+
67 assert(strcmp(str1, int_to_string(value, str2, 10)) == 0);
+
68 snprintf(str1, MAX_SIZE, "%x", value); /* standard C - to hexadecimal */
+
69 assert(strcmp(str1, int_to_string(value, str2, 16)) == 0);
+
70 }
+
71
+
72 free(str1);
+
73 free(str2);
+
74}
+
char * int_to_string(uint16_t value, char *dest, int base)
Converts an integer value to a null-terminated string using the specified base and stores the result ...
Definition: int_to_string.c:25
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
#define calloc(elemCount, elemSize)
This macro replace the standard calloc function with calloc_dbg.
Definition: malloc_dbg.h:22
const unsigned long long MAX_SIZE
for assert for standard input output for general purpose standard library
Definition: prime_seive.c:11
Here is the call graph for this function:
-
+
@@ -263,7 +294,7 @@ Here is the call graph for this function:
diff --git a/dd/d53/int__to__string_8c.js b/dd/d53/int__to__string_8c.js index 11aadaaca..f2ac6459f 100644 --- a/dd/d53/int__to__string_8c.js +++ b/dd/d53/int__to__string_8c.js @@ -1,6 +1,6 @@ var int__to__string_8c = [ - [ "int_to_string", "dd/d53/int__to__string_8c.html#a969911f32f1c435bb2bf166574ef9ae5", null ], + [ "int_to_string", "dd/d53/int__to__string_8c.html#aeb4be1a1db1c5fea06e9d8b87e6c3973", null ], [ "main", "dd/d53/int__to__string_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], [ "test", "dd/d53/int__to__string_8c.html#aa8dca7b867074164d5f45b0f3851269d", null ] ]; \ No newline at end of file diff --git a/dd/d53/int__to__string_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map b/dd/d53/int__to__string_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map index 5a48f50f9..9d6eee3a2 100644 --- a/dd/d53/int__to__string_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map +++ b/dd/d53/int__to__string_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map @@ -1,4 +1,4 @@ - + diff --git a/dd/d53/int__to__string_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 b/dd/d53/int__to__string_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 index 10fd95bc0..823dd5f39 100644 --- a/dd/d53/int__to__string_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 +++ b/dd/d53/int__to__string_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 @@ -1 +1 @@ -3def44b0351fb8e6f98fb3ccea1d737c \ No newline at end of file +4703bd499a831a8b295c455e4c1764a0 \ No newline at end of file diff --git a/dd/d53/int__to__string_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/dd/d53/int__to__string_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg index eb834f5e6..a244a1ebb 100644 --- a/dd/d53/int__to__string_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg +++ b/dd/d53/int__to__string_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg @@ -1,14 +1,14 @@ - - + test - + Node1 @@ -21,17 +21,17 @@ Node2 - - -int_to_string + + +int_to_string Node1->Node2 - - + + diff --git a/dd/d53/int__to__string_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/dd/d53/int__to__string_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..d7eaae96e --- /dev/null +++ b/dd/d53/int__to__string_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/dd/d53/int__to__string_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/dd/d53/int__to__string_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..d0bbd4998 --- /dev/null +++ b/dd/d53/int__to__string_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +89bc1c817c846482ef51c5c0af383428 \ No newline at end of file diff --git a/dd/d53/int__to__string_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/dd/d53/int__to__string_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..f440fe4d1 --- /dev/null +++ b/dd/d53/int__to__string_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,52 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +test + + + + + +Node1->Node2 + + + + + +Node3 + + +int_to_string + + + + + +Node2->Node3 + + + + + diff --git a/dd/d75/structqueue__coll__graph.map b/dd/d75/structqueue__coll__graph.map index ae6d4f874..846d04cd4 100644 --- a/dd/d75/structqueue__coll__graph.map +++ b/dd/d75/structqueue__coll__graph.map @@ -1,4 +1,4 @@ - - + + diff --git a/dd/d75/structqueue__coll__graph.svg b/dd/d75/structqueue__coll__graph.svg index 8c941130a..edf5c6eb4 100644 --- a/dd/d75/structqueue__coll__graph.svg +++ b/dd/d75/structqueue__coll__graph.svg @@ -1,20 +1,20 @@ - - + queue - + Node1 - -queue + +queue @@ -22,32 +22,32 @@ Node2 - -node + +node Node2->Node1 - - - front -rear + + + front +rear Node2->Node2 - - - left -leftNode -link -next -par -pre -right -rightNode + + + left +leftNode +link +next +par +pre +right +rightNode diff --git a/dd/d77/so1_8c__incl.map b/dd/d77/so1_8c__incl.map index 5e40624b4..9eb003123 100644 --- a/dd/d77/so1_8c__incl.map +++ b/dd/d77/so1_8c__incl.map @@ -1,4 +1,4 @@ - - + + diff --git a/dd/d77/so1_8c__incl.svg b/dd/d77/so1_8c__incl.svg index b53362c02..361eedd59 100644 --- a/dd/d77/so1_8c__incl.svg +++ b/dd/d77/so1_8c__incl.svg @@ -1,21 +1,21 @@ - - + project_euler/problem_2/so1.c - + Node1 - + project_euler/problem -_2/so1.c +_2/so1.c @@ -23,16 +23,16 @@ Node2 - -stdio.h + +stdio.h Node1->Node2 - - + + diff --git a/dd/d7a/group__matrix.html b/dd/d7a/group__matrix.html index 47b0dec1f..3e9ee407d 100644 --- a/dd/d7a/group__matrix.html +++ b/dd/d7a/group__matrix.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Matrix operations @@ -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,27 +93,26 @@ $(document).ready(function(){initNavTree('dd/d7a/group__matrix.html','../../'); - +
Collaboration diagram for Matrix operations:
-
+
-

+

Data Structures

struct  mat_3x3_
 A 3x3 Matrix type definition. More...
 
- - +

+

Typedefs

-typedef struct mat_3x3_ mat_3x3
+typedef struct mat_3x3_ mat_3x3
 A 3x3 Matrix type definition.
 
@@ -123,7 +122,7 @@ typedef struct mat_3x3_< diff --git a/dd/d7a/group__matrix.js b/dd/d7a/group__matrix.js index 73fab4f74..00c94f9e7 100644 --- a/dd/d7a/group__matrix.js +++ b/dd/d7a/group__matrix.js @@ -3,10 +3,7 @@ var group__matrix = [ "mat_3x3_", "d9/d8b/structmat__3x3__.html", [ [ "row1", "d9/d8b/structmat__3x3__.html#ac74f33a2e1ad1f6db74d94807cf1f64e", null ], [ "row2", "d9/d8b/structmat__3x3__.html#a8d7ae8fbcc408e3c30e9d64bbd28feaf", null ], - [ "row3", "d9/d8b/structmat__3x3__.html#a490bb6be52ea95b333b55b236af41563", null ], - [ "vec1", "d9/d8b/structmat__3x3__.html#a083420b13a87ebece08b6c7d49081e8a", null ], - [ "vec2", "d9/d8b/structmat__3x3__.html#a79b11a5d4e23d7965cbb151fdc5bda32", null ], - [ "vec3", "d9/d8b/structmat__3x3__.html#ad2f6310ba8af97d333888128ca7a6f7d", null ] + [ "row3", "d9/d8b/structmat__3x3__.html#a490bb6be52ea95b333b55b236af41563", null ] ] ], [ "mat_3x3", "dd/d7a/group__matrix.html#ga9f844010cb96591fa94c9d533a500ab7", null ] ]; \ No newline at end of file diff --git a/dd/d7a/group__matrix.map b/dd/d7a/group__matrix.map index 4ab525e73..05b951436 100644 --- a/dd/d7a/group__matrix.map +++ b/dd/d7a/group__matrix.map @@ -1,4 +1,4 @@ - + diff --git a/dd/d7a/group__matrix.svg b/dd/d7a/group__matrix.svg index d38fc89b2..173b9ac36 100644 --- a/dd/d7a/group__matrix.svg +++ b/dd/d7a/group__matrix.svg @@ -1,20 +1,20 @@ - - + Matrix operations - + Node1 - -Matrix operations + +Matrix operations @@ -31,8 +31,8 @@ Node2->Node1 - - + + diff --git a/dd/d85/hash__adler32_8c__incl.map b/dd/d85/hash__adler32_8c__incl.map index 7639fc2f9..544ed229c 100644 --- a/dd/d85/hash__adler32_8c__incl.map +++ b/dd/d85/hash__adler32_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/dd/d85/hash__adler32_8c__incl.svg b/dd/d85/hash__adler32_8c__incl.svg index 0f8f3dcbb..60276d6eb 100644 --- a/dd/d85/hash__adler32_8c__incl.svg +++ b/dd/d85/hash__adler32_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - + hash/hash_adler32.c diff --git a/dd/d8b/problem__22_2sol1_8c.html b/dd/d8b/problem__22_2sol1_8c.html index b93c8bd47..13f6a43a3 100644 --- a/dd/d8b/problem__22_2sol1_8c.html +++ b/dd/d8b/problem__22_2sol1_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_22/sol1.c 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/d8b/problem__22_2sol1_8c.html','../ -
-
sol1.c File Reference
+
sol1.c File Reference
-

Problem 22 solution +

Problem 22 solution More...

#include <stdio.h>
#include <stdlib.h>
@@ -111,42 +110,263 @@ Include dependency graph for sol1.c:
- - + - +

+

Macros

-#define MAX_NAMES   6000
+#define MAX_NAMES   6000
 Maximum number of names to store.
 
-#define MAX_NAME_LEN   20
+#define MAX_NAME_LEN   20
 Maximum length of each name.
 
- - - + + - - + + - - + +

+

Functions

-void shell_sort (char data[][MAX_NAME_LEN], int LEN)
 Alphabetical sorting using 'shell sort' algorithm.
void shell_sort (char data[][MAX_NAME_LEN], int LEN)
 Alphabetical sorting using 'shell sort' algorithm. More...
 
-void lazy_sort (char data[][MAX_NAME_LEN], int LEN)
 Alphabetical sorting using 'lazy sort' algorithm.
void lazy_sort (char data[][MAX_NAME_LEN], int LEN)
 Alphabetical sorting using 'lazy sort' algorithm. More...
 
-int main (int argc, char **argv)
 Main function.
int main (int argc, char **argv)
 Main function. More...
 

Detailed Description

-

Problem 22 solution

-
Author
Krishna Vedala
-
+

Problem 22 solution

+
Author
Krishna Vedala
+

Function Documentation

+ +

◆ lazy_sort()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void lazy_sort (char data[][MAX_NAME_LEN],
int LEN 
)
+
+ +

Alphabetical sorting using 'lazy sort' algorithm.

+
49{
+
50 int i, j;
+
51 for (i = 0; i < LEN; i++)
+
52 {
+
53 for (j = i + 1; j < LEN; j++)
+
54 {
+
55 if (strcmp(data[i], data[j]) > 0)
+
56 {
+
57 char tmp_buffer[MAX_NAME_LEN];
+
58 strcpy(tmp_buffer, data[i]);
+
59 strcpy(data[i], data[j]);
+
60 strcpy(data[j], tmp_buffer);
+
61 }
+
62 }
+
63 }
+
64#ifdef DEBUG
+
65 for (i = 0; i < LEN; i++) printf("%s\t", data[i]);
+
66#endif
+
67}
+
#define LEN
Linear input code | Compressed code | Linear output code ---------------—+--------------—+-----------...
Definition: alaw.c:28
+
#define MAX_NAME_LEN
Maximum length of each name.
Definition: sol1.c:15
+
Definition: prime_factoriziation.c:25
+
+
+
+ +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char ** argv 
)
+
+ +

Main function.

+
71{
+
72 unsigned long COUNT = 0;
+
73 char *fname = "names.txt";
+
74 char names[MAX_NAMES][MAX_NAME_LEN];
+
75 short method = 0; /* sorting algorithm to use. 0 = lazy, 1 = shell-sort */
+
76
+
77 if (argc == 2)
+
78 method = atoi(argv[1]);
+
79
+
80 FILE *fp = fopen(fname, "rt");
+
81 if (!fp)
+
82 {
+
83 perror("Unable to open file");
+
84 return -1;
+
85 }
+
86
+
87 /*
+
88 * Loops to get total number of rows and columns in the file
+
89 */
+
90 do
+
91 {
+
92 int ret = fscanf(fp, "\"%[^\",]\",", names[COUNT++]);
+
93 if (ret <= 0)
+
94 continue;
+
95 // printf("%s\t", names[COUNT - 1]);
+
96 } while (!feof(fp));
+
97 fclose(fp);
+
98
+
99 printf("\nTotal number of names: %lu\n", COUNT);
+
100
+
101 if (method == 0)
+
102 {
+
103 clock_t start_time = clock();
+
104 shell_sort(names, COUNT);
+
105 clock_t end_time = clock();
+
106 printf("\nShell sort: %.4g millisecond\n",
+
107 1e3 * (end_time - start_time) / CLOCKS_PER_SEC);
+
108 }
+
109 else if (method == 1)
+
110 {
+
111 clock_t start_time = clock();
+
112 lazy_sort(names, COUNT);
+
113 clock_t end_time = clock();
+
114 printf("\nLazy sort: %.4g millisecond\n",
+
115 1e3 * (end_time - start_time) / CLOCKS_PER_SEC);
+
116 }
+
117
+
118 long sum_score = 0;
+
119 clock_t start_time = clock();
+
120 int i;
+
121
+
122#ifdef _OPENMP
+
123#pragma omp parallel for schedule(runtime) reduction(+ : sum_score)
+
124#endif
+
125#ifdef DEBUG
+
126 for (i = 935; i < 940; i++)
+
127#else
+
128 for (i = 0; i < COUNT; i++)
+
129#endif
+
130 {
+
131 long score = 0;
+
132 /* score the alphabets in i^th name */
+
133 for (int j = 0; names[i][j] != '\0'; j++)
+
134 score += names[i][j] - 'A' +
+
135 1; /* convert ASCII character to integer score */
+
136 sum_score += score * (i + 1);
+
137#ifdef DEBUG
+
138 printf("Name: %s\tScore: %u x %u = %lu\n", names[i], score, i + 1,
+
139 (unsigned long)score * (i + 1));
+
140#endif
+
141 }
+
142 clock_t end_time = clock();
+
143 printf("Scoring time: %.4g millisecond\n",
+
144 1e3 * (end_time - start_time) / CLOCKS_PER_SEC);
+
145
+
146 printf("Total Score = %lu\n", sum_score);
+
147
+
148 return 0;
+
149}
+
void shell_sort(char data[][MAX_NAME_LEN], int LEN)
Alphabetical sorting using 'shell sort' algorithm.
Definition: sol1.c:20
+
#define MAX_NAMES
Maximum number of names to store.
Definition: sol1.c:14
+
void lazy_sort(char data[][MAX_NAME_LEN], int LEN)
Alphabetical sorting using 'lazy sort' algorithm.
Definition: sol1.c:48
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ shell_sort()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void shell_sort (char data[][MAX_NAME_LEN],
int LEN 
)
+
+ +

Alphabetical sorting using 'shell sort' algorithm.

+
21{
+
22 const int gaps[] = {701, 301, 132, 57, 23, 10, 4, 1};
+
23 const int gap_len = 8;
+
24 int i, j, g;
+
25
+
26 for (g = 0; g < gap_len; g++)
+
27 {
+
28 int gap = gaps[g];
+
29 for (i = gap; i < LEN; i++)
+
30 {
+
31 char tmp_buffer[MAX_NAME_LEN];
+
32 strcpy(tmp_buffer, data[i]);
+
33
+
34 for (j = i; j >= gap && strcmp(data[j - gap], tmp_buffer) > 0;
+
35 j -= gap)
+
36 strcpy(data[j], data[j - gap]);
+
37 strcpy(data[j], tmp_buffer);
+
38 }
+
39 }
+
40#ifdef DEBUG
+
41 for (i = 0; i < LEN; i++) printf("%s\t", data[i]);
+
42#endif
+
43}
+
+
+
+ diff --git a/dd/d8b/problem__22_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map b/dd/d8b/problem__22_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map new file mode 100644 index 000000000..d84f71c97 --- /dev/null +++ b/dd/d8b/problem__22_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/dd/d8b/problem__22_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 b/dd/d8b/problem__22_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 new file mode 100644 index 000000000..9da580d10 --- /dev/null +++ b/dd/d8b/problem__22_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 @@ -0,0 +1 @@ +053baa3e2c29f6003731ed3cd8c8e0a5 \ No newline at end of file diff --git a/dd/d8b/problem__22_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg b/dd/d8b/problem__22_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg new file mode 100644 index 000000000..7ffcea7ec --- /dev/null +++ b/dd/d8b/problem__22_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg @@ -0,0 +1,52 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +lazy_sort + + + + + +Node1->Node2 + + + + + +Node3 + + +shell_sort + + + + + +Node1->Node3 + + + + + diff --git a/dd/d8c/adaline__learning_8c.html b/dd/d8c/adaline__learning_8c.html index 88326b96e..7b925c956 100644 --- a/dd/d8c/adaline__learning_8c.html +++ b/dd/d8c/adaline__learning_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: machine_learning/adaline_learning.c 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('dd/d8c/adaline__learning_8c.html','../ Data Structures | Macros | Functions -
-
adaline_learning.c File Reference
+
adaline_learning.c File Reference
-

Adaptive Linear Neuron (ADALINE) implementation +

Adaptive Linear Neuron (ADALINE) implementation More...

#include <assert.h>
#include <limits.h>
@@ -111,28 +110,28 @@ $(document).ready(function(){initNavTree('dd/d8c/adaline__learning_8c.html','../
Include dependency graph for adaline_learning.c:
-
+
-

+

Data Structures

struct  adaline
 structure to hold adaline model parameters More...
 
- +#define  +#define 

+

Macros

-#define MAX_ADALINE_ITER   500
MAX_ADALINE_ITER   500
 Maximum number of iterations to learn.
 
-#define ADALINE_ACCURACY   1e-5
ADALINE_ACCURACY   1e-5
 convergence accuracy \(=1\times10^{-5}\)
 
- @@ -141,11 +140,11 @@ Functions - + - - - + + + @@ -164,19 +163,78 @@ Functions - - + +

+

Functions

struct adaline new_adaline (const int num_features, const double eta)
 Default constructor. More...
 delete dynamically allocated memory More...
 
int adaline_activation (double x)
 Heaviside activation function More...
 Heaviside activation function More...
 
char * adaline_get_weights_str (const struct adaline *ada)
 Operator to print the weights of the model. More...
 
char * adaline_get_weights_str (const struct adaline *ada)
 Operator to print the weights of the model. More...
 
int adaline_predict (struct adaline *ada, const double *x, double *out)
 predict the output of the model for given set of features More...
 
void test3 (double eta)
 test function to predict points in a 3D coordinate system lying within the sphere of radius 1 and centre at origin as +1 and others as -1. More...
 
-int main (int argc, char **argv)
 Main function.
int main (int argc, char **argv)
 Main function. More...
 

Detailed Description

-

Adaptive Linear Neuron (ADALINE) implementation

-

source ADALINE is one of the first and simplest single layer artificial neural network. The algorithm essentially implements a linear function

+

Adaptive Linear Neuron (ADALINE) implementation

+

source ADALINE is one of the first and simplest single layer artificial neural network. The algorithm essentially implements a linear function

\[ f\left(x_0,x_1,x_2,\ldots\right) = \sum_j x_jw_j+\theta \]

-

where \(x_j\) are the input features of a sample, \(w_j\) are the coefficients of the linear function and \(\theta\) is a constant. If we know the \(w_j\), then for any given set of features, \(y\) can be computed. Computing the \(w_j\) is a supervised learning algorithm wherein a set of features and their corresponding outputs are given and weights are computed using stochastic gradient descent method.

Author
Krishna Vedala
+

where \(x_j\) are the input features of a sample, \(w_j\) are the coefficients of the linear function and \(\theta\) is a constant. If we know the \(w_j\), then for any given set of features, \(y\) can be computed. Computing the \(w_j\) is a supervised learning algorithm wherein a set of features and their corresponding outputs are given and weights are computed using stochastic gradient descent method.

Author
Krishna Vedala

Function Documentation

- + +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char ** argv 
)
+
+ +

Main function.

+
399{
+
400 srand(time(NULL)); // initialize random number generator
+
401
+
402 double eta = 0.1; // default value of eta
+
403 if (argc == 2) // read eta value from commandline argument if present
+
404 eta = strtof(argv[1], NULL);
+
405
+
406 test1(eta);
+
407
+
408 printf("Press ENTER to continue...\n");
+
409 getchar();
+
410
+
411 test2(eta);
+
412
+
413 printf("Press ENTER to continue...\n");
+
414 getchar();
+
415
+
416 test3(eta);
+
417
+
418 return 0;
+
419}
+
void test2(double eta)
test function to predict points in a 2D coordinate system above the line as +1 and others as -1.
Definition: adaline_learning.c:273
+
void test3(double eta)
test function to predict points in a 3D coordinate system lying within the sphere of radius 1 and cen...
Definition: adaline_learning.c:336
+
void test1(double eta)
test function to predict points in a 2D coordinate system above the line as +1 and others as -1.
Definition: adaline_learning.c:225
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+

◆ test1()

@@ -193,56 +251,56 @@ int 

test function to predict points in a 2D coordinate system above the line \(x=y\) as +1 and others as -1.

-

Note that each point is defined by 2 values or 2 features.

Parameters
+

Note that each point is defined by 2 values or 2 features.

Parameters
[in]etalearning rate (optional, default=0.01)
-
226 {
-
227  struct adaline ada = new_adaline(2, eta); // 2 features
-
228 
-
229  const int N = 10; // number of sample points
-
230  const double saved_X[10][2] = {{0, 1}, {1, -2}, {2, 3}, {3, -1},
-
231  {4, 1}, {6, -5}, {-7, -3}, {-8, 5},
-
232  {-9, 2}, {-10, -15}};
-
233 
-
234  double **X = (double **)malloc(N * sizeof(double *));
-
235  const int Y[10] = {1, -1, 1, -1, -1,
-
236  -1, 1, 1, 1, -1}; // corresponding y-values
-
237  for (int i = 0; i < N; i++)
-
238  {
-
239  X[i] = (double *)saved_X[i];
-
240  }
-
241 
-
242  printf("------- Test 1 -------\n");
-
243  printf("Model before fit: %s", adaline_get_weights_str(&ada));
-
244 
-
245  adaline_fit(&ada, X, Y, N);
-
246  printf("Model after fit: %s\n", adaline_get_weights_str(&ada));
-
247 
-
248  double test_x[] = {5, -3};
-
249  int pred = adaline_predict(&ada, test_x, NULL);
-
250  printf("Predict for x=(5,-3): % d", pred);
-
251  assert(pred == -1);
-
252  printf(" ...passed\n");
-
253 
-
254  double test_x2[] = {5, 8};
-
255  pred = adaline_predict(&ada, test_x2, NULL);
-
256  printf("Predict for x=(5, 8): % d", pred);
-
257  assert(pred == 1);
-
258  printf(" ...passed\n");
-
259 
-
260  // for (int i = 0; i < N; i++)
-
261  // free(X[i]);
-
262  free(X);
-
263  delete_adaline(&ada);
-
264 }
-
char * adaline_get_weights_str(const struct adaline *ada)
Operator to print the weights of the model.
Definition: adaline_learning.c:112
+
226{
+
227 struct adaline ada = new_adaline(2, eta); // 2 features
+
228
+
229 const int N = 10; // number of sample points
+
230 const double saved_X[10][2] = {{0, 1}, {1, -2}, {2, 3}, {3, -1},
+
231 {4, 1}, {6, -5}, {-7, -3}, {-8, 5},
+
232 {-9, 2}, {-10, -15}};
+
233
+
234 double **X = (double **)malloc(N * sizeof(double *));
+
235 const int Y[10] = {1, -1, 1, -1, -1,
+
236 -1, 1, 1, 1, -1}; // corresponding y-values
+
237 for (int i = 0; i < N; i++)
+
238 {
+
239 X[i] = (double *)saved_X[i];
+
240 }
+
241
+
242 printf("------- Test 1 -------\n");
+
243 printf("Model before fit: %s\n", adaline_get_weights_str(&ada));
+
244
+
245 adaline_fit(&ada, X, Y, N);
+
246 printf("Model after fit: %s\n", adaline_get_weights_str(&ada));
+
247
+
248 double test_x[] = {5, -3};
+
249 int pred = adaline_predict(&ada, test_x, NULL);
+
250 printf("Predict for x=(5,-3): % d\n", pred);
+
251 assert(pred == -1);
+
252 printf(" ...passed\n");
+
253
+
254 double test_x2[] = {5, 8};
+
255 pred = adaline_predict(&ada, test_x2, NULL);
+
256 printf("Predict for x=(5, 8): % d\n", pred);
+
257 assert(pred == 1);
+
258 printf(" ...passed\n");
+
259
+
260 // for (int i = 0; i < N; i++)
+
261 // free(X[i]);
+
262 free(X);
+
263 delete_adaline(&ada);
+
264}
void delete_adaline(struct adaline *ada)
delete dynamically allocated memory
Definition: adaline_learning.c:89
void adaline_fit(struct adaline *ada, double **X, const int *y, const int N)
Update the weights of the model using supervised learning for an array of vectors.
Definition: adaline_learning.c:184
int adaline_predict(struct adaline *ada, const double *x, double *out)
predict the output of the model for given set of features
Definition: adaline_learning.c:136
struct adaline new_adaline(const int num_features, const double eta)
Default constructor.
Definition: adaline_learning.c:59
+
char * adaline_get_weights_str(const struct adaline *ada)
Operator to print the weights of the model.
Definition: adaline_learning.c:112
#define malloc(bytes)
This macro replace the standard malloc function with malloc_dbg.
Definition: malloc_dbg.h:18
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
structure to hold adaline model parameters
Definition: adaline_learning.c:44
@@ -256,7 +314,7 @@ Here is the call graph for this function:
- +

◆ test2()

@@ -273,62 +331,62 @@ Here is the call graph for this function:

test function to predict points in a 2D coordinate system above the line \(x+3y=-1\) as +1 and others as -1.

-

Note that each point is defined by 2 values or 2 features. The function will create random sample points for training and test purposes.

Parameters
+

Note that each point is defined by 2 values or 2 features. The function will create random sample points for training and test purposes.

Parameters
[in]etalearning rate (optional, default=0.01)
-
274 {
-
275  struct adaline ada = new_adaline(2, eta); // 2 features
-
276 
-
277  const int N = 50; // number of sample points
-
278 
-
279  double **X = (double **)malloc(N * sizeof(double *));
-
280  int *Y = (int *)malloc(N * sizeof(int)); // corresponding y-values
-
281  for (int i = 0; i < N; i++) X[i] = (double *)malloc(2 * sizeof(double));
-
282 
-
283  // generate sample points in the interval
-
284  // [-range2/100 , (range2-1)/100]
-
285  int range = 500; // sample points full-range
-
286  int range2 = range >> 1; // sample points half-range
-
287  for (int i = 0; i < N; i++)
-
288  {
-
289  double x0 = ((rand() % range) - range2) / 100.f;
-
290  double x1 = ((rand() % range) - range2) / 100.f;
-
291  X[i][0] = x0;
-
292  X[i][1] = x1;
-
293  Y[i] = (x0 + 3. * x1) > -1 ? 1 : -1;
-
294  }
-
295 
-
296  printf("------- Test 2 -------\n");
-
297  printf("Model before fit: %s", adaline_get_weights_str(&ada));
-
298 
-
299  adaline_fit(&ada, X, Y, N);
-
300  printf("Model after fit: %s\n", adaline_get_weights_str(&ada));
-
301 
-
302  int N_test_cases = 5;
-
303  double test_x[2];
-
304  for (int i = 0; i < N_test_cases; i++)
-
305  {
-
306  double x0 = ((rand() % range) - range2) / 100.f;
-
307  double x1 = ((rand() % range) - range2) / 100.f;
-
308 
-
309  test_x[0] = x0;
-
310  test_x[1] = x1;
-
311  int pred = adaline_predict(&ada, test_x, NULL);
-
312  printf("Predict for x=(% 3.2f,% 3.2f): % d", x0, x1, pred);
-
313 
-
314  int expected_val = (x0 + 3. * x1) > -1 ? 1 : -1;
-
315  assert(pred == expected_val);
-
316  printf(" ...passed\n");
-
317  }
-
318 
-
319  for (int i = 0; i < N; i++) free(X[i]);
-
320  free(X);
-
321  free(Y);
-
322  delete_adaline(&ada);
-
323 }
+
274{
+
275 struct adaline ada = new_adaline(2, eta); // 2 features
+
276
+
277 const int N = 50; // number of sample points
+
278
+
279 double **X = (double **)malloc(N * sizeof(double *));
+
280 int *Y = (int *)malloc(N * sizeof(int)); // corresponding y-values
+
281 for (int i = 0; i < N; i++) X[i] = (double *)malloc(2 * sizeof(double));
+
282
+
283 // generate sample points in the interval
+
284 // [-range2/100 , (range2-1)/100]
+
285 int range = 500; // sample points full-range
+
286 int range2 = range >> 1; // sample points half-range
+
287 for (int i = 0; i < N; i++)
+
288 {
+
289 double x0 = ((rand() % range) - range2) / 100.f;
+
290 double x1 = ((rand() % range) - range2) / 100.f;
+
291 X[i][0] = x0;
+
292 X[i][1] = x1;
+
293 Y[i] = (x0 + 3. * x1) > -1 ? 1 : -1;
+
294 }
+
295
+
296 printf("------- Test 2 -------\n");
+
297 printf("Model before fit: %s\n", adaline_get_weights_str(&ada));
+
298
+
299 adaline_fit(&ada, X, Y, N);
+
300 printf("Model after fit: %s\n", adaline_get_weights_str(&ada));
+
301
+
302 int N_test_cases = 5;
+
303 double test_x[2];
+
304 for (int i = 0; i < N_test_cases; i++)
+
305 {
+
306 double x0 = ((rand() % range) - range2) / 100.f;
+
307 double x1 = ((rand() % range) - range2) / 100.f;
+
308
+
309 test_x[0] = x0;
+
310 test_x[1] = x1;
+
311 int pred = adaline_predict(&ada, test_x, NULL);
+
312 printf("Predict for x=(% 3.2f,% 3.2f): % d\n", x0, x1, pred);
+
313
+
314 int expected_val = (x0 + 3. * x1) > -1 ? 1 : -1;
+
315 assert(pred == expected_val);
+
316 printf(" ...passed\n");
+
317 }
+
318
+
319 for (int i = 0; i < N; i++) free(X[i]);
+
320 free(X);
+
321 free(Y);
+
322 delete_adaline(&ada);
+
323}
Definition: prime_factoriziation.c:25
Here is the call graph for this function:
@@ -339,7 +397,7 @@ Here is the call graph for this function:
- +

◆ test3()

@@ -356,72 +414,72 @@ Here is the call graph for this function:

test function to predict points in a 3D coordinate system lying within the sphere of radius 1 and centre at origin as +1 and others as -1.

-

Note that each point is defined by 3 values but we use 6 features. The function will create random sample points for training and test purposes. The sphere centred at origin and radius 1 is defined as: \(x^2+y^2+z^2=r^2=1\) and if the \(r^2<1\), point lies within the sphere else, outside.

+

Note that each point is defined by 3 values but we use 6 features. The function will create random sample points for training and test purposes. The sphere centred at origin and radius 1 is defined as: \(x^2+y^2+z^2=r^2=1\) and if the \(r^2<1\), point lies within the sphere else, outside.

Parameters
[in]etalearning rate (optional, default=0.01)
-
337 {
-
338  struct adaline ada = new_adaline(6, eta); // 2 features
-
339 
-
340  const int N = 50; // number of sample points
-
341 
-
342  double **X = (double **)malloc(N * sizeof(double *));
-
343  int *Y = (int *)malloc(N * sizeof(int)); // corresponding y-values
-
344  for (int i = 0; i < N; i++) X[i] = (double *)malloc(6 * sizeof(double));
-
345 
-
346  // generate sample points in the interval
-
347  // [-range2/100 , (range2-1)/100]
-
348  int range = 200; // sample points full-range
-
349  int range2 = range >> 1; // sample points half-range
-
350  for (int i = 0; i < N; i++)
-
351  {
-
352  double x0 = ((rand() % range) - range2) / 100.f;
-
353  double x1 = ((rand() % range) - range2) / 100.f;
-
354  double x2 = ((rand() % range) - range2) / 100.f;
-
355  X[i][0] = x0;
-
356  X[i][1] = x1;
-
357  X[i][2] = x2;
-
358  X[i][3] = x0 * x0;
-
359  X[i][4] = x1 * x1;
-
360  X[i][5] = x2 * x2;
-
361  Y[i] = (x0 * x0 + x1 * x1 + x2 * x2) <= 1 ? 1 : -1;
-
362  }
-
363 
-
364  printf("------- Test 3 -------\n");
-
365  printf("Model before fit: %s", adaline_get_weights_str(&ada));
-
366 
-
367  adaline_fit(&ada, X, Y, N);
-
368  printf("Model after fit: %s\n", adaline_get_weights_str(&ada));
-
369 
-
370  int N_test_cases = 5;
-
371  double test_x[6];
-
372  for (int i = 0; i < N_test_cases; i++)
-
373  {
-
374  double x0 = ((rand() % range) - range2) / 100.f;
-
375  double x1 = ((rand() % range) - range2) / 100.f;
-
376  double x2 = ((rand() % range) - range2) / 100.f;
-
377  test_x[0] = x0;
-
378  test_x[1] = x1;
-
379  test_x[2] = x2;
-
380  test_x[3] = x0 * x0;
-
381  test_x[4] = x1 * x1;
-
382  test_x[5] = x2 * x2;
-
383  int pred = adaline_predict(&ada, test_x, NULL);
-
384  printf("Predict for x=(% 3.2f,% 3.2f): % d", x0, x1, pred);
-
385 
-
386  int expected_val = (x0 * x0 + x1 * x1 + x2 * x2) <= 1 ? 1 : -1;
-
387  assert(pred == expected_val);
-
388  printf(" ...passed\n");
-
389  }
-
390 
-
391  for (int i = 0; i < N; i++) free(X[i]);
-
392  free(X);
-
393  free(Y);
-
394  delete_adaline(&ada);
-
395 }
+
337{
+
338 struct adaline ada = new_adaline(6, eta); // 2 features
+
339
+
340 const int N = 50; // number of sample points
+
341
+
342 double **X = (double **)malloc(N * sizeof(double *));
+
343 int *Y = (int *)malloc(N * sizeof(int)); // corresponding y-values
+
344 for (int i = 0; i < N; i++) X[i] = (double *)malloc(6 * sizeof(double));
+
345
+
346 // generate sample points in the interval
+
347 // [-range2/100 , (range2-1)/100]
+
348 int range = 200; // sample points full-range
+
349 int range2 = range >> 1; // sample points half-range
+
350 for (int i = 0; i < N; i++)
+
351 {
+
352 double x0 = ((rand() % range) - range2) / 100.f;
+
353 double x1 = ((rand() % range) - range2) / 100.f;
+
354 double x2 = ((rand() % range) - range2) / 100.f;
+
355 X[i][0] = x0;
+
356 X[i][1] = x1;
+
357 X[i][2] = x2;
+
358 X[i][3] = x0 * x0;
+
359 X[i][4] = x1 * x1;
+
360 X[i][5] = x2 * x2;
+
361 Y[i] = (x0 * x0 + x1 * x1 + x2 * x2) <= 1 ? 1 : -1;
+
362 }
+
363
+
364 printf("------- Test 3 -------\n");
+
365 printf("Model before fit: %s\n", adaline_get_weights_str(&ada));
+
366
+
367 adaline_fit(&ada, X, Y, N);
+
368 printf("Model after fit: %s\n", adaline_get_weights_str(&ada));
+
369
+
370 int N_test_cases = 5;
+
371 double test_x[6];
+
372 for (int i = 0; i < N_test_cases; i++)
+
373 {
+
374 double x0 = ((rand() % range) - range2) / 100.f;
+
375 double x1 = ((rand() % range) - range2) / 100.f;
+
376 double x2 = ((rand() % range) - range2) / 100.f;
+
377 test_x[0] = x0;
+
378 test_x[1] = x1;
+
379 test_x[2] = x2;
+
380 test_x[3] = x0 * x0;
+
381 test_x[4] = x1 * x1;
+
382 test_x[5] = x2 * x2;
+
383 int pred = adaline_predict(&ada, test_x, NULL);
+
384 printf("Predict for x=(% 3.2f,% 3.2f): % d\n", x0, x1, pred);
+
385
+
386 int expected_val = (x0 * x0 + x1 * x1 + x2 * x2) <= 1 ? 1 : -1;
+
387 assert(pred == expected_val);
+
388 printf(" ...passed\n");
+
389 }
+
390
+
391 for (int i = 0; i < N; i++) free(X[i]);
+
392 free(X);
+
393 free(Y);
+
394 delete_adaline(&ada);
+
395}
Here is the call graph for this function:
@@ -437,7 +495,7 @@ Here is the call graph for this function:
diff --git a/dd/d8c/adaline__learning_8c.js b/dd/d8c/adaline__learning_8c.js index 6726cdd10..15d3318c5 100644 --- a/dd/d8c/adaline__learning_8c.js +++ b/dd/d8c/adaline__learning_8c.js @@ -5,7 +5,7 @@ var adaline__learning_8c = [ "adaline_activation", "da/d2a/group__adaline.html#ga43576566b020c4157d4fb28f0dd45cfa", null ], [ "adaline_fit", "da/d2a/group__adaline.html#gaa52120912e32d2893fe1c6d78da5befd", null ], [ "adaline_fit_sample", "da/d2a/group__adaline.html#ga20d3642e0a87f36fdb7bf91b023cd166", null ], - [ "adaline_get_weights_str", "da/d2a/group__adaline.html#ga251695a79baa885cafdcf6d8ed4ac120", null ], + [ "adaline_get_weights_str", "da/d2a/group__adaline.html#gadb1a7acb555ad62daaf3806bf2fed036", null ], [ "adaline_predict", "da/d2a/group__adaline.html#gac70b578aee679005fd336073969c3d94", null ], [ "delete_adaline", "da/d2a/group__adaline.html#ga6f35caa3084772cc126ac7b20f67f665", null ], [ "main", "dd/d8c/adaline__learning_8c.html#a3c04138a5bfe5d72780bb7e82a18e627", null ], diff --git a/dd/d8c/adaline__learning_8c_a05cc9a0acb524fde727a4d7b4a747ee6_cgraph.map b/dd/d8c/adaline__learning_8c_a05cc9a0acb524fde727a4d7b4a747ee6_cgraph.map index c31c3defe..4077e543f 100644 --- a/dd/d8c/adaline__learning_8c_a05cc9a0acb524fde727a4d7b4a747ee6_cgraph.map +++ b/dd/d8c/adaline__learning_8c_a05cc9a0acb524fde727a4d7b4a747ee6_cgraph.map @@ -1,10 +1,10 @@ - - - - - - - + + + + + + + diff --git a/dd/d8c/adaline__learning_8c_a05cc9a0acb524fde727a4d7b4a747ee6_cgraph.md5 b/dd/d8c/adaline__learning_8c_a05cc9a0acb524fde727a4d7b4a747ee6_cgraph.md5 index 1612b1b3e..7c8bcbfa0 100644 --- a/dd/d8c/adaline__learning_8c_a05cc9a0acb524fde727a4d7b4a747ee6_cgraph.md5 +++ b/dd/d8c/adaline__learning_8c_a05cc9a0acb524fde727a4d7b4a747ee6_cgraph.md5 @@ -1 +1 @@ -0443ec5ae3c34e9ae51a5ace363423a2 \ No newline at end of file +2e74e9906f4de5bd61f52e0ca43dbf33 \ No newline at end of file diff --git a/dd/d8c/adaline__learning_8c_a05cc9a0acb524fde727a4d7b4a747ee6_cgraph.svg b/dd/d8c/adaline__learning_8c_a05cc9a0acb524fde727a4d7b4a747ee6_cgraph.svg index 7361f585e..d6861cb5c 100644 --- a/dd/d8c/adaline__learning_8c_a05cc9a0acb524fde727a4d7b4a747ee6_cgraph.svg +++ b/dd/d8c/adaline__learning_8c_a05cc9a0acb524fde727a4d7b4a747ee6_cgraph.svg @@ -1,7 +1,7 @@ - @@ -46,15 +46,15 @@ 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() {
@@ -93,8 +93,7 @@ $(document).ready(function(){initNavTree('dd/d93/client_8c.html','../../'); init -
-
client.c File Reference
+
client.c File Reference
@@ -110,42 +109,41 @@ $(document).ready(function(){initNavTree('dd/d93/client_8c.html','../../'); init
Include dependency graph for client.c:
-
+
- - + - +

+

Macros

#define MAX   80
 max. More...
 
-#define PORT   8080
+#define PORT   8080
 port number to connect to
 
-#define SA   struct sockaddr
+#define SA   struct sockaddr
 shortname for sockaddr
 
- - - + +

+

Functions

void func (int sockfd)
 Continuous loop to send and receive over the socket. More...
 
-int main ()
 Driver code.
int main ()
 Driver code. More...
 

Detailed Description

-

Client side implementation of Server-Client system.

-
Author
Nairit11
+

Client side implementation of Server-Client system.

+
Author
Nairit11
-Krishna Vedala
+Krishna Vedala
See also
client_server/server.c

Macro Definition Documentation

- +

◆ MAX

Function Documentation

-
+

◆ func()

@@ -180,37 +178,118 @@ int 

Continuous loop to send and receive over the socket.

-

Exits when "exit" is sent from commandline.

Parameters
+

Exits when "exit" is sent from commandline.

Parameters
sockfdsocket handle number
-
38 {
-
39  char buff[MAX];
-
40  int n;
-
41  for (;;)
-
42  {
-
43  bzero(buff, sizeof(buff));
-
44  printf("Enter the string : ");
-
45  n = 0;
-
46  while ((buff[n++] = getchar()) != '\n')
-
47  {
-
48  ;
-
49  }
-
50  write(sockfd, buff, sizeof(buff));
-
51  bzero(buff, sizeof(buff));
-
52  read(sockfd, buff, sizeof(buff));
-
53  printf("From Server : %s", buff);
-
54  if ((strncmp(buff, "exit", 4)) == 0)
-
55  {
-
56  printf("Client Exit...\n");
-
57  break;
-
58  }
-
59  }
-
60 }
+
38{
+
39 char buff[MAX];
+
40 int n;
+
41 for (;;)
+
42 {
+
43 bzero(buff, sizeof(buff));
+
44 printf("Enter the string : ");
+
45 n = 0;
+
46 while ((buff[n++] = getchar()) != '\n')
+
47 {
+
48 ;
+
49 }
+
50 write(sockfd, buff, sizeof(buff));
+
51 bzero(buff, sizeof(buff));
+
52 read(sockfd, buff, sizeof(buff));
+
53 printf("From Server : %s", buff);
+
54 if ((strncmp(buff, "exit", 4)) == 0)
+
55 {
+
56 printf("Client Exit...\n");
+
57 break;
+
58 }
+
59 }
+
60}
#define MAX
max.
Definition: client.c:28
+
+
+ +

◆ main()

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

Driver code.

+
71{
+
72#ifdef _WIN32
+
73 // when using winsock2.h, startup required
+
74 WSADATA wsData;
+
75 if (WSAStartup(MAKEWORD(2, 2), &wsData) != 0)
+
76 {
+
77 perror("WSA Startup error: \n");
+
78 return 0;
+
79 }
+
80
+
81 atexit(cleanup); // register at-exit function
+
82#endif
+
83
+
84 int sockfd, connfd;
+
85 struct sockaddr_in servaddr, cli;
+
86
+
87 // socket create and verification
+
88 sockfd = socket(AF_INET, SOCK_STREAM, 0);
+
89 if (sockfd == -1)
+
90 {
+
91 printf("socket creation failed...\n");
+
92 exit(0);
+
93 }
+
94 else
+
95 {
+
96 printf("Socket successfully created..\n");
+
97 }
+
98 bzero(&servaddr, sizeof(servaddr));
+
99
+
100 // assign IP, PORT
+
101 servaddr.sin_family = AF_INET;
+
102 servaddr.sin_addr.s_addr = inet_addr("127.0.0.1");
+
103 servaddr.sin_port = htons(PORT);
+
104
+
105 // connect the client socket to server socket
+
106 if (connect(sockfd, (SA *)&servaddr, sizeof(servaddr)) != 0)
+
107 {
+
108 printf("connection with the server failed...\n");
+
109 exit(0);
+
110 }
+
111 else
+
112 {
+
113 printf("connected to the server..\n");
+
114 }
+
115
+
116 // function for chat
+
117 func(sockfd);
+
118
+
119 // close the socket
+
120 close(sockfd);
+
121 return 0;
+
122}
+
#define SA
shortname for sockaddr
Definition: client.c:30
+
#define PORT
port number to connect to
Definition: client.c:29
+
void func(int sockfd)
Continuous loop to send and receive over the socket.
Definition: client.c:37
+
+Here is the call graph for this function:
+
+
+
+
+
@@ -219,7 +298,7 @@ int  diff --git a/dd/d93/client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/dd/d93/client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..43fd20c1a --- /dev/null +++ b/dd/d93/client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/dd/d93/client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/dd/d93/client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..f1c9a3827 --- /dev/null +++ b/dd/d93/client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +57bebaede7352c80747ce046019107b1 \ No newline at end of file diff --git a/dd/d93/client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/dd/d93/client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..ec52efe44 --- /dev/null +++ b/dd/d93/client_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,37 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +func + + + + + +Node1->Node2 + + + + + diff --git a/dd/d95/word__count_8h_source.html b/dd/d95/word__count_8h_source.html index bc3e9d4a6..00032d530 100644 --- a/dd/d95/word__count_8h_source.html +++ b/dd/d95/word__count_8h_source.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: exercism/word_count/word_count.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,38 +90,37 @@ $(document).ready(function(){initNavTree('dd/d95/word__count_8h_source.html','..
-
-
word_count.h
+
word_count.h
-
1 #ifndef WORD_COUNT_H
-
2 #define WORD_COUNT_H
-
3 
-
4 #define MAX_WORDS 20 // at most MAX_WORDS can be found in the test input string
-
5 #define MAX_WORD_LENGTH 50 // no individual word can exceed this length
-
6 
-
7 // results structure
-
8 typedef struct word_count_word
-
9 {
-
10  char text[MAX_WORD_LENGTH];
-
11  int count;
- -
13 
-
14 #define EXCESSIVE_LENGTH_WORD -1
-
15 #define EXCESSIVE_NUMBER_OF_WORDS -2
-
16 
-
17 // word_count - routine to classify the unique words and their frequency in a
-
18 // test input string inputs:
-
19 // input_text = a null-terminated string containing that is analyzed
-
20 //
-
21 // outputs:
-
22 // words = allocated structure to record the words found and their frequency
-
23 // uniqueWords - number of words in the words structure
-
24 // returns a negative number if an error.
-
25 // words will contain the results up to that point.
-
26 int word_count(const char *input_text, word_count_word_t *words);
-
27 
-
28 #endif
+
1#ifndef WORD_COUNT_H
+
2#define WORD_COUNT_H
+
3
+
4#define MAX_WORDS 20 // at most MAX_WORDS can be found in the test input string
+
5#define MAX_WORD_LENGTH 50 // no individual word can exceed this length
+
6
+
7// results structure
+
8typedef struct word_count_word
+
9{
+
10 char text[MAX_WORD_LENGTH];
+
11 int count;
+ +
13
+
14#define EXCESSIVE_LENGTH_WORD -1
+
15#define EXCESSIVE_NUMBER_OF_WORDS -2
+
16
+
17// word_count - routine to classify the unique words and their frequency in a
+
18// test input string inputs:
+
19// input_text = a null-terminated string containing that is analyzed
+
20//
+
21// outputs:
+
22// words = allocated structure to record the words found and their frequency
+
23// uniqueWords - number of words in the words structure
+
24// returns a negative number if an error.
+
25// words will contain the results up to that point.
+
26int word_count(const char *input_text, word_count_word_t *words);
+
27
+
28#endif
Definition: word_count.h:9
@@ -129,7 +128,7 @@ $(document).ready(function(){initNavTree('dd/d95/word__count_8h_source.html','.. diff --git a/dd/d99/heap__sort__2_8c__incl.map b/dd/d99/heap__sort__2_8c__incl.map new file mode 100644 index 000000000..6dc77d341 --- /dev/null +++ b/dd/d99/heap__sort__2_8c__incl.map @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/dd/d99/heap__sort__2_8c__incl.md5 b/dd/d99/heap__sort__2_8c__incl.md5 new file mode 100644 index 000000000..6661a16ba --- /dev/null +++ b/dd/d99/heap__sort__2_8c__incl.md5 @@ -0,0 +1 @@ +75dcc0b6e2a28306edb1f432670c2c88 \ No newline at end of file diff --git a/dd/d99/heap__sort__2_8c__incl.svg b/dd/d99/heap__sort__2_8c__incl.svg new file mode 100644 index 000000000..71f7f3997 --- /dev/null +++ b/dd/d99/heap__sort__2_8c__incl.svg @@ -0,0 +1,97 @@ + + + + + + +sorting/heap_sort_2.c + + + +Node1 + + +sorting/heap_sort_2.c + + + + + +Node2 + + +assert.h + + + + + +Node1->Node2 + + + + + +Node3 + + +stdio.h + + + + + +Node1->Node3 + + + + + +Node4 + + +stdlib.h + + + + + +Node1->Node4 + + + + + +Node5 + + +time.h + + + + + +Node1->Node5 + + + + + +Node6 + + +inttypes.h + + + + + +Node1->Node6 + + + + + diff --git a/dd/da2/structbuffer.html b/dd/da2/structbuffer.html new file mode 100644 index 000000000..60cb0be5f --- /dev/null +++ b/dd/da2/structbuffer.html @@ -0,0 +1,128 @@ + + + + + + + +Algorithms_in_C: buffer Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Algorithms_in_C 1.0.0 +
+
Set of algorithms implemented in C.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
buffer Struct Reference
+
+
+ +

struct used to store character in certain times + More...

+ +

#include <min_printf.h>

+ + + + + + +

+Data Fields

+char buffr_char
 
+int buf_size
 
+

Detailed Description

+

struct used to store character in certain times

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/dd/db8/test__malloc__dbg_8c__incl.map b/dd/db8/test__malloc__dbg_8c__incl.map index 2628840f2..b3619081f 100644 --- a/dd/db8/test__malloc__dbg_8c__incl.map +++ b/dd/db8/test__malloc__dbg_8c__incl.map @@ -1,6 +1,6 @@ - + - + diff --git a/dd/db8/test__malloc__dbg_8c__incl.svg b/dd/db8/test__malloc__dbg_8c__incl.svg index 1d39ab7e9..f85578256 100644 --- a/dd/db8/test__malloc__dbg_8c__incl.svg +++ b/dd/db8/test__malloc__dbg_8c__incl.svg @@ -1,20 +1,20 @@ - - + developer_tools/test_malloc_dbg.c - + Node1 - -developer_tools/test + +developer_tools/test _malloc_dbg.c @@ -53,16 +53,16 @@ Node4 - -malloc_dbg.h + +malloc_dbg.h Node1->Node4 - - + + diff --git a/dd/dd7/malloc__dbg_8h__dep__incl.map b/dd/dd7/malloc__dbg_8h__dep__incl.map index f9ea0f178..bd83e8076 100644 --- a/dd/dd7/malloc__dbg_8h__dep__incl.map +++ b/dd/dd7/malloc__dbg_8h__dep__incl.map @@ -1,5 +1,5 @@ - - - + + + diff --git a/dd/dd7/malloc__dbg_8h__dep__incl.svg b/dd/dd7/malloc__dbg_8h__dep__incl.svg index f115bfac3..842515915 100644 --- a/dd/dd7/malloc__dbg_8h__dep__incl.svg +++ b/dd/dd7/malloc__dbg_8h__dep__incl.svg @@ -1,21 +1,21 @@ - - + developer_tools/malloc_dbg.h - + Node1 - -developer_tools/malloc -_dbg.h + +developer_tools/malloc +_dbg.h @@ -23,33 +23,33 @@ Node2 - + developer_tools/malloc -_dbg.c +_dbg.c Node1->Node2 - - + + Node3 - -developer_tools/test -_malloc_dbg.c + +developer_tools/test +_malloc_dbg.c Node1->Node3 - - + + diff --git a/dd/de4/bubble__sort_8c.html b/dd/de4/bubble__sort_8c.html index a12944006..fbabb491a 100644 --- a/dd/de4/bubble__sort_8c.html +++ b/dd/de4/bubble__sort_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: sorting/bubble_sort.c 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/de4/bubble__sort_8c.html','../../')
-
-
bubble_sort.c File Reference
+
bubble_sort.c File Reference
-

Bubble sort algorithm implementation +

Bubble sort algorithm implementation More...

#include <assert.h>
#include <stdbool.h>
@@ -107,11 +106,11 @@ $(document).ready(function(){initNavTree('dd/de4/bubble__sort_8c.html','../../')
Include dependency graph for bubble_sort.c:
-
+
- @@ -122,19 +121,17 @@ Functions - - + + - - + +

+

Functions

void display (const int *arr, int n)
 Display elements of array. More...
void bubbleSort (int *arr, int size)
 Bubble sort algorithm implementation. More...
 
-void test ()
 Test function.
void test ()
 Test function. More...
 
-int main (int argc, const char *argv[])
 Driver Code.
int main (int argc, const char *argv[])
 Driver Code. More...
 

Detailed Description

-

Bubble sort algorithm implementation

+

Bubble sort algorithm implementation

Function Documentation

- +

◆ bubbleSort()

@@ -168,39 +165,39 @@ int 
44 {
-
45  for (int i = 0; i < size - 1; i++)
-
46  { /* for each array index */
-
47  bool swapped = false; /* flag to check if any changes had to be made */
-
48  /* perform iterations until no more changes were made or outer loop
-
49  executed for all array indices */
-
50  for (int j = 0; j < size - 1 - i; j++)
-
51  { /* for each element in the array */
-
52  if (arr[j] > arr[j + 1])
-
53  { /* if the order of successive elements needs update */
-
54  swap(&arr[j], &arr[j + 1]);
-
55  swapped = true; /* set flag */
-
56  }
-
57  }
-
58  if (!swapped)
-
59  {
-
60  /* since no more updates we made, the array is already sorted
-
61  this is an optimization for early termination */
-
62  break;
-
63  }
-
64  }
-
65 }
+
44{
+
45 for (int i = 0; i < size - 1; i++)
+
46 { /* for each array index */
+
47 bool swapped = false; /* flag to check if any changes had to be made */
+
48 /* perform iterations until no more changes were made or outer loop
+
49 executed for all array indices */
+
50 for (int j = 0; j < size - 1 - i; j++)
+
51 { /* for each element in the array */
+
52 if (arr[j] > arr[j + 1])
+
53 { /* if the order of successive elements needs update */
+
54 swap(&arr[j], &arr[j + 1]);
+
55 swapped = true; /* set flag */
+
56 }
+
57 }
+
58 if (!swapped)
+
59 {
+
60 /* since no more updates we made, the array is already sorted
+
61 this is an optimization for early termination */
+
62 break;
+
63 }
+
64 }
+
65}
void swap(int *first, int *second)
Swap two values by using pointer.
Definition: bubble_sort.c:31
Here is the call graph for this function:
-
+
- +

◆ display()

@@ -234,17 +231,60 @@ Here is the call graph for this function:
-
18 {
-
19  for (int i = 0; i < n; i++)
-
20  {
-
21  printf("%d ", arr[i]);
-
22  }
-
23  printf("\n");
-
24 }
+
18{
+
19 for (int i = 0; i < n; i++)
+
20 {
+
21 printf("%d ", arr[i]);
+
22 }
+
23 printf("\n");
+
24}
- + +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
const char * argv[] 
)
+
+ +

Driver Code.

+
90{
+
91 /* Intializes random number generator */
+
92 srand(time(NULL));
+
93 test();
+
94 return 0;
+
95}
+
void test()
Test function.
Definition: bubble_sort.c:70
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+

◆ swap()

@@ -278,12 +318,57 @@ Here is the call graph for this function:
-
32 {
-
33  int temp = *first;
-
34  *first = *second;
-
35  *second = temp;
-
36 }
+
32{
+
33 int temp = *first;
+
34 *first = *second;
+
35 *second = temp;
+
36}
+
+
+ +

◆ test()

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

Test function.

+
71{
+
72 const int size = 10;
+
73 int *arr = (int *)calloc(size, sizeof(int));
+
74
+
75 /* generate size random numbers from 0 to 100 */
+
76 for (int i = 0; i < size; i++)
+
77 {
+
78 arr[i] = rand() % 100;
+
79 }
+
80 bubbleSort(arr, size);
+
81 for (int i = 0; i < size - 1; ++i)
+
82 {
+
83 assert(arr[i] <= arr[i + 1]);
+
84 }
+
85 free(arr);
+
86}
+
void bubbleSort(int *arr, int size)
Bubble sort algorithm implementation.
Definition: bubble_sort.c:43
+
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
+
#define calloc(elemCount, elemSize)
This macro replace the standard calloc function with calloc_dbg.
Definition: malloc_dbg.h:22
+
+Here is the call graph for this function:
+
+
+
+
+
@@ -292,7 +377,7 @@ Here is the call graph for this function: diff --git a/dd/de4/bubble__sort_8c_aa8989f6c9bfd1f040854fa18b180114f_cgraph.map b/dd/de4/bubble__sort_8c_aa8989f6c9bfd1f040854fa18b180114f_cgraph.map index b1c2b0dec..2355166e8 100644 --- a/dd/de4/bubble__sort_8c_aa8989f6c9bfd1f040854fa18b180114f_cgraph.map +++ b/dd/de4/bubble__sort_8c_aa8989f6c9bfd1f040854fa18b180114f_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/dd/de4/bubble__sort_8c_aa8989f6c9bfd1f040854fa18b180114f_cgraph.svg b/dd/de4/bubble__sort_8c_aa8989f6c9bfd1f040854fa18b180114f_cgraph.svg index 9a6b254a8..60ab5be5f 100644 --- a/dd/de4/bubble__sort_8c_aa8989f6c9bfd1f040854fa18b180114f_cgraph.svg +++ b/dd/de4/bubble__sort_8c_aa8989f6c9bfd1f040854fa18b180114f_cgraph.svg @@ -1,20 +1,20 @@ - - + bubbleSort - + Node1 - -bubbleSort + +bubbleSort @@ -22,16 +22,16 @@ Node2 - -swap + +swap Node1->Node2 - - + + diff --git a/dd/de4/bubble__sort_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.map b/dd/de4/bubble__sort_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.map new file mode 100644 index 000000000..6f6254c3f --- /dev/null +++ b/dd/de4/bubble__sort_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/dd/de4/bubble__sort_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.md5 b/dd/de4/bubble__sort_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.md5 new file mode 100644 index 000000000..90e1df255 --- /dev/null +++ b/dd/de4/bubble__sort_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.md5 @@ -0,0 +1 @@ +ffac429bc4d8c8f24d963fe244fe081b \ No newline at end of file diff --git a/dd/de4/bubble__sort_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.svg b/dd/de4/bubble__sort_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.svg new file mode 100644 index 000000000..309723b71 --- /dev/null +++ b/dd/de4/bubble__sort_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.svg @@ -0,0 +1,67 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +test + + + + + +Node1->Node2 + + + + + +Node3 + + +bubbleSort + + + + + +Node2->Node3 + + + + + +Node4 + + +swap + + + + + +Node3->Node4 + + + + + diff --git a/dd/de4/bubble__sort_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.map b/dd/de4/bubble__sort_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.map new file mode 100644 index 000000000..1b6ff549b --- /dev/null +++ b/dd/de4/bubble__sort_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/dd/de4/bubble__sort_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.md5 b/dd/de4/bubble__sort_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.md5 new file mode 100644 index 000000000..99699e680 --- /dev/null +++ b/dd/de4/bubble__sort_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.md5 @@ -0,0 +1 @@ +de830fc7d4dfeda9f9247e35c58078ee \ No newline at end of file diff --git a/dd/de4/bubble__sort_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg b/dd/de4/bubble__sort_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg new file mode 100644 index 000000000..03cfcd738 --- /dev/null +++ b/dd/de4/bubble__sort_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg @@ -0,0 +1,52 @@ + + + + + + +test + + + +Node1 + + +test + + + + + +Node2 + + +bubbleSort + + + + + +Node1->Node2 + + + + + +Node3 + + +swap + + + + + +Node2->Node3 + + + + + diff --git a/dd/deb/structquaternion____coll__graph.map b/dd/deb/structquaternion____coll__graph.map index bbad0fe27..87fbbce05 100644 --- a/dd/deb/structquaternion____coll__graph.map +++ b/dd/deb/structquaternion____coll__graph.map @@ -1,4 +1,4 @@ - - + + diff --git a/dd/deb/structquaternion____coll__graph.svg b/dd/deb/structquaternion____coll__graph.svg index 088df27a2..c8d9f9bca 100644 --- a/dd/deb/structquaternion____coll__graph.svg +++ b/dd/deb/structquaternion____coll__graph.svg @@ -1,20 +1,20 @@ - - + quaternion_ - + Node1 - -quaternion_ + +quaternion_ @@ -22,17 +22,17 @@ Node2 - -vec_3d_ + +vec_3d_ Node2->Node1 - - - dual + + + dual diff --git a/dd/deb/tcp__half__duplex__client_8c__incl.map b/dd/deb/tcp__half__duplex__client_8c__incl.map new file mode 100644 index 000000000..4e9098dd3 --- /dev/null +++ b/dd/deb/tcp__half__duplex__client_8c__incl.map @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/dd/deb/tcp__half__duplex__client_8c__incl.md5 b/dd/deb/tcp__half__duplex__client_8c__incl.md5 new file mode 100644 index 000000000..e907e773e --- /dev/null +++ b/dd/deb/tcp__half__duplex__client_8c__incl.md5 @@ -0,0 +1 @@ +27388f58c7be80e600860c7e521734dd \ No newline at end of file diff --git a/dd/deb/tcp__half__duplex__client_8c__incl.svg b/dd/deb/tcp__half__duplex__client_8c__incl.svg new file mode 100644 index 000000000..d8640b5a3 --- /dev/null +++ b/dd/deb/tcp__half__duplex__client_8c__incl.svg @@ -0,0 +1,246 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +client_server/tcp_half_duplex_client.c + + + +Node1 + + +client_server/tcp_half +_duplex_client.c + + + + + +Node2 + + +netdb.h + + + + + +Node1->Node2 + + + + + +Node3 + + +netinet/in.h + + + + + +Node1->Node3 + + + + + +Node4 + + +stdint.h + + + + + +Node1->Node4 + + + + + +Node5 + + +stdio.h + + + + + +Node1->Node5 + + + + + +Node6 + + +stdlib.h + + + + + +Node1->Node6 + + + + + +Node7 + + +string.h + + + + + +Node1->Node7 + + + + + +Node8 + + +sys/socket.h + + + + + +Node1->Node8 + + + + + +Node9 + + +sys/types.h + + + + + +Node1->Node9 + + + + + +Node10 + + +unistd.h + + + + + +Node1->Node10 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dd/deb/tcp__half__duplex__client_8c__incl_org.svg b/dd/deb/tcp__half__duplex__client_8c__incl_org.svg new file mode 100644 index 000000000..712560007 --- /dev/null +++ b/dd/deb/tcp__half__duplex__client_8c__incl_org.svg @@ -0,0 +1,158 @@ + + + + + + +client_server/tcp_half_duplex_client.c + + + +Node1 + + +client_server/tcp_half +_duplex_client.c + + + + + +Node2 + + +netdb.h + + + + + +Node1->Node2 + + + + + +Node3 + + +netinet/in.h + + + + + +Node1->Node3 + + + + + +Node4 + + +stdint.h + + + + + +Node1->Node4 + + + + + +Node5 + + +stdio.h + + + + + +Node1->Node5 + + + + + +Node6 + + +stdlib.h + + + + + +Node1->Node6 + + + + + +Node7 + + +string.h + + + + + +Node1->Node7 + + + + + +Node8 + + +sys/socket.h + + + + + +Node1->Node8 + + + + + +Node9 + + +sys/types.h + + + + + +Node1->Node9 + + + + + +Node10 + + +unistd.h + + + + + +Node1->Node10 + + + + + diff --git a/dd/df0/problem__19_2sol1_8c.html b/dd/df0/problem__19_2sol1_8c.html index daef61df3..22c341b79 100644 --- a/dd/df0/problem__19_2sol1_8c.html +++ b/dd/df0/problem__19_2sol1_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_19/sol1.c 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,22 +92,21 @@ $(document).ready(function(){initNavTree('dd/df0/problem__19_2sol1_8c.html','../
-
-
sol1.c File Reference
+
sol1.c File Reference
-

Problem 19 solution +

Problem 19 solution More...

#include <stdio.h>
Include dependency graph for sol1.c:
-
+
- @@ -115,16 +114,15 @@ Functions - - + +

+

Functions

char get_month_days (short month)
 Function to get the number of days in a month. More...
char is_leap_year (short year)
 Check if input year is a leap year. More...
 
-int main (int argc, char **argv)
 Main function.
int main (int argc, char **argv)
 Main function. More...
 

Detailed Description

-

Problem 19 solution

-
Author
Krishna Vedala
+

Problem 19 solution

+
Author
Krishna Vedala

Function Documentation

- +

◆ get_month_days()

@@ -145,7 +143,7 @@ int  monthmonth identified by an integer -
-

0 = Jan and 11 = December

+

0 = Jan and 11 = December

@@ -153,28 +151,28 @@ int 
Returns
number of days in given month
Note
For February, adjust for leap year outside the function.
-
16 {
-
17  if (month == 1) /* February has 28 days. Adjust leap year in the loop */
-
18  return 28;
-
19  else if (month <= 6) /* odd months till July have 30 days - Jan = 0 (even)*/
-
20  {
-
21  if (month & 0x01)
-
22  return 30;
-
23  else
-
24  return 31;
-
25  }
-
26 
-
27  // else if (month >= 7) /* odd months after July have 31 days*/
-
28 
-
29  if (month & 0x01)
-
30  return 31;
-
31 
-
32  return 30;
-
33 }
+
16{
+
17 if (month == 1) /* February has 28 days. Adjust leap year in the loop */
+
18 return 28;
+
19 else if (month <= 6) /* odd months till July have 30 days - Jan = 0 (even)*/
+
20 {
+
21 if (month & 0x01)
+
22 return 30;
+
23 else
+
24 return 31;
+
25 }
+
26
+
27 // else if (month >= 7) /* odd months after July have 31 days*/
+
28
+
29 if (month & 0x01)
+
30 return 31;
+
31
+
32 return 30;
+
33}
- +

◆ is_leap_year()

@@ -200,13 +198,107 @@ int 
Returns
1 if input year is a leap year
0 if input year is not a leap year
-
42 {
-
43  if ((year % 400 == 0) || ((year % 4 == 0) && (year % 100 != 0)))
-
44  return 1;
-
45 
-
46  return 0;
-
47 }
+
42{
+
43 if ((year % 400 == 0) || ((year % 4 == 0) && (year % 100 != 0)))
+
44 return 1;
+
45
+
46 return 0;
+
47}
+
+
+ +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char ** argv 
)
+
+ +

Main function.

+
80{
+
81 int count_sundays = 0;
+
82 const short start_year = 1901;
+
83 const short end_year = 2000;
+
84
+
85 /*
+
86 * Let us identify days i.e., Sunday thru Saturday with integers - 0 thru 6
+
87 * respectively Jan 1 1901 was a Tuesday
+
88 */
+
89 char start_day = 2;
+
90
+
91 for (int year = start_year; year <= end_year; year++)
+
92 {
+
93 char is_leap = is_leap_year(year);
+
94 for (char month = 0; month < 12; month++)
+
95 {
+
96 /*
+
97 * These two for-loops count the start of day for the next month.
+
98 * Hence, we have to skip the last December count
+
99 */
+
100 if (year == end_year && month == 11)
+
101 continue;
+
102
+
103 int days = get_month_days(month);
+
104
+
105 if (is_leap && month == 1) /* for a leap year february, add a day */
+
106 days++;
+
107
+
108#ifdef DEBUG
+
109 if (year == end_year)
+
110 {
+
111 printf("Year: %d\t Month: %d\t Days: %d\t First of day: %s\n",
+
112 year, month, days, day_string(start_day));
+
113 }
+
114#endif
+
115
+
116 /* Main Algorithm:
+
117 * every week has 7 days hence, the start of next day would be
+
118 * modulo 7 add to this, the current start date and ensure the
+
119 * result is still modulo 7!
+
120 */
+
121 start_day = ((days % 7) + start_day) % 7;
+
122
+
123 /* If start-day is a Sunday, increment counter */
+
124 if (start_day == 0)
+
125 count_sundays++;
+
126 }
+
127 }
+
128
+
129 printf(
+
130 "Total number of Sundays that happened on the 1st of a month in the "
+
131 "last century: %d\n",
+
132 count_sundays);
+
133
+
134 return 0;
+
135}
+
char is_leap_year(short year)
Check if input year is a leap year.
Definition: sol1.c:41
+
char get_month_days(short month)
Function to get the number of days in a month.
Definition: sol1.c:15
+
+Here is the call graph for this function:
+
+
+
+
+
@@ -215,7 +307,7 @@ int 
diff --git a/dd/df0/problem__19_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map b/dd/df0/problem__19_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map new file mode 100644 index 000000000..295bebea1 --- /dev/null +++ b/dd/df0/problem__19_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/dd/df0/problem__19_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 b/dd/df0/problem__19_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 new file mode 100644 index 000000000..42e033900 --- /dev/null +++ b/dd/df0/problem__19_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 @@ -0,0 +1 @@ +eb5223711ae896f3f8274fe612958161 \ No newline at end of file diff --git a/dd/df0/problem__19_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg b/dd/df0/problem__19_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg new file mode 100644 index 000000000..3dbce1773 --- /dev/null +++ b/dd/df0/problem__19_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg @@ -0,0 +1,52 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +get_month_days + + + + + +Node1->Node2 + + + + + +Node3 + + +is_leap_year + + + + + +Node1->Node3 + + + + + diff --git a/dd/df2/problem__1_2sol2_8c__incl.map b/dd/df2/problem__1_2sol2_8c__incl.map index bf87037a7..c619877a7 100644 --- a/dd/df2/problem__1_2sol2_8c__incl.map +++ b/dd/df2/problem__1_2sol2_8c__incl.map @@ -1,4 +1,4 @@ - - + + diff --git a/dd/df2/problem__1_2sol2_8c__incl.svg b/dd/df2/problem__1_2sol2_8c__incl.svg index 689192140..736462844 100644 --- a/dd/df2/problem__1_2sol2_8c__incl.svg +++ b/dd/df2/problem__1_2sol2_8c__incl.svg @@ -1,21 +1,21 @@ - - + project_euler/problem_1/sol2.c - + Node1 - + project_euler/problem -_1/sol2.c +_1/sol2.c @@ -23,16 +23,16 @@ Node2 - -stdio.h + +stdio.h Node1->Node2 - - + + diff --git a/de/d0c/insertion__sort__recursive_8c.html b/de/d0c/insertion__sort__recursive_8c.html index 965986dee..75950d1fa 100644 --- a/de/d0c/insertion__sort__recursive_8c.html +++ b/de/d0c/insertion__sort__recursive_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: sorting/insertion_sort_recursive.c 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/d0c/insertion__sort__recursive_8c.h
-
-
insertion_sort_recursive.c File Reference
+
insertion_sort_recursive.c File Reference
-

Insertion sort algorithm implementation. +

Insertion sort algorithm implementation. More...

#include <assert.h>
#include <stdio.h>
@@ -110,7 +109,7 @@ Include dependency graph for insertion_sort_recursive.c:
- @@ -123,9 +122,9 @@ Functions

+

Functions

void RecursionInsertionSort (int *arr, int size)
 Insertion sort algorithm implements using Recursion. More...
 

Detailed Description

-

Insertion sort algorithm implementation.

+

Insertion sort algorithm implementation.

Function Documentation

- +

◆ main()

@@ -153,23 +152,23 @@ Functions

Main function.

Returns
integer 0
-
66 {
-
67  /* Intializes random number generator */
-
68  srand(time(NULL));
-
69  test();
-
70  return 0;
-
71 }
+
66{
+
67 /* Intializes random number generator */
+
68 srand(time(NULL));
+
69 test();
+
70 return 0;
+
71}
static void test()
Test function.
Definition: insertion_sort_recursive.c:44
Here is the call graph for this function:
-
+
- +

◆ test()

@@ -195,29 +194,29 @@ Here is the call graph for this function:

Test function.

Returns
None
-
45 {
-
46  const int size = rand() % 500; /* random array size */
-
47  int *arr = (int *)calloc(size, sizeof(int));
-
48 
-
49  /* generate size random numbers from -50 to 49 */
-
50  for (int i = 0; i < size; i++)
-
51  {
-
52  arr[i] = (rand() % 100) - 50;/* signed random numbers */
-
53  }
-
54  RecursionInsertionSort(arr, size);
-
55  for (int i = 0; i < size ; ++i)
-
56  {
-
57  assert(arr[i] <= arr[i + 1]);
-
58  }
-
59  free(arr);
-
60 }
+
45{
+
46 const int size = rand() % 500; /* random array size */
+
47 int *arr = (int *)calloc(size, sizeof(int));
+
48
+
49 /* generate size random numbers from -50 to 49 */
+
50 for (int i = 0; i < size; i++)
+
51 {
+
52 arr[i] = (rand() % 100) - 50;/* signed random numbers */
+
53 }
+
54 RecursionInsertionSort(arr, size);
+
55 for (int i = 0; i < size ; ++i)
+
56 {
+
57 assert(arr[i] <= arr[i + 1]);
+
58 }
+
59 free(arr);
+
60}
void RecursionInsertionSort(int *arr, int size)
Insertion sort algorithm implements using Recursion.
Definition: insertion_sort_recursive.c:20
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
#define calloc(elemCount, elemSize)
This macro replace the standard calloc function with calloc_dbg.
Definition: malloc_dbg.h:22
Here is the call graph for this function:
-
+
@@ -229,7 +228,7 @@ Here is the call graph for this function:
diff --git a/de/d0c/insertion__sort__recursive_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map b/de/d0c/insertion__sort__recursive_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map index de4d32b19..2f63786d9 100644 --- a/de/d0c/insertion__sort__recursive_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map +++ b/de/d0c/insertion__sort__recursive_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/de/d0c/insertion__sort__recursive_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 b/de/d0c/insertion__sort__recursive_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 index eac232896..705388e2e 100644 --- a/de/d0c/insertion__sort__recursive_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 +++ b/de/d0c/insertion__sort__recursive_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 @@ -1 +1 @@ -2656930f2ad116f4d85e071947f3c5df \ No newline at end of file +a6600566f31cd91d8f19906fb942c90e \ No newline at end of file diff --git a/de/d0c/insertion__sort__recursive_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/de/d0c/insertion__sort__recursive_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg index 8da624464..abca27ca1 100644 --- a/de/d0c/insertion__sort__recursive_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg +++ b/de/d0c/insertion__sort__recursive_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg @@ -1,14 +1,14 @@ - - - + + test - + Node1 @@ -22,16 +22,22 @@ Node2 - -RecursionInsertionSort + +RecursionInsertionSort Node1->Node2 - - + + + + + +Node2->Node2 + + diff --git a/de/d0c/insertion__sort__recursive_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.map b/de/d0c/insertion__sort__recursive_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.map index 570a23931..d16c0187a 100644 --- a/de/d0c/insertion__sort__recursive_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.map +++ b/de/d0c/insertion__sort__recursive_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.map @@ -1,5 +1,5 @@ - - - + + + diff --git a/de/d0c/insertion__sort__recursive_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.md5 b/de/d0c/insertion__sort__recursive_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.md5 index 553841361..5ba8c2af7 100644 --- a/de/d0c/insertion__sort__recursive_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.md5 +++ b/de/d0c/insertion__sort__recursive_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.md5 @@ -1 +1 @@ -ddec2f55fb5be1c85e68a43604d4bd7a \ No newline at end of file +eac3be513a4bc440805775500635df31 \ No newline at end of file diff --git a/de/d0c/insertion__sort__recursive_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.svg b/de/d0c/insertion__sort__recursive_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.svg index 0dd92a45c..65039db5e 100644 --- a/de/d0c/insertion__sort__recursive_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.svg +++ b/de/d0c/insertion__sort__recursive_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.svg @@ -1,14 +1,14 @@ - - - + + main - + Node1 @@ -37,16 +37,22 @@ Node3 - -RecursionInsertionSort + +RecursionInsertionSort Node2->Node3 - - + + + + + +Node3->Node3 + + diff --git a/de/d0e/hash__xor8_8c__incl.map b/de/d0e/hash__xor8_8c__incl.map index 1c1c5bbe3..b97c65d21 100644 --- a/de/d0e/hash__xor8_8c__incl.map +++ b/de/d0e/hash__xor8_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/de/d0e/hash__xor8_8c__incl.svg b/de/d0e/hash__xor8_8c__incl.svg index d916b65bf..999ba4bab 100644 --- a/de/d0e/hash__xor8_8c__incl.svg +++ b/de/d0e/hash__xor8_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - + hash/hash_xor8.c diff --git a/de/d16/server_8c__incl.map b/de/d16/server_8c__incl.map index 819cde668..8ad849f31 100644 --- a/de/d16/server_8c__incl.map +++ b/de/d16/server_8c__incl.map @@ -1,10 +1,10 @@ - + - - - - + + + + diff --git a/de/d16/server_8c__incl.svg b/de/d16/server_8c__incl.svg index 51631e815..a8c245e43 100644 --- a/de/d16/server_8c__incl.svg +++ b/de/d16/server_8c__incl.svg @@ -1,20 +1,20 @@ - - + client_server/server.c - + Node1 - -client_server/server.c + +client_server/server.c @@ -30,8 +30,8 @@ Node1->Node2 - - + + @@ -45,8 +45,8 @@ Node1->Node3 - - + + @@ -60,68 +60,68 @@ Node1->Node4 - - + + Node5 - -arpa/inet.h + +arpa/inet.h Node1->Node5 - - + + Node6 - -netdb.h + +netdb.h Node1->Node6 - - + + Node7 - -sys/socket.h + +sys/socket.h Node1->Node7 - - + + Node8 - -unistd.h + +unistd.h Node1->Node8 - - + + diff --git a/de/d1c/prim_8c__incl.map b/de/d1c/prim_8c__incl.map new file mode 100644 index 000000000..9936d7def --- /dev/null +++ b/de/d1c/prim_8c__incl.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/de/d1c/prim_8c__incl.md5 b/de/d1c/prim_8c__incl.md5 new file mode 100644 index 000000000..89719518b --- /dev/null +++ b/de/d1c/prim_8c__incl.md5 @@ -0,0 +1 @@ +f4afa743f3f76f717952d36f1b322fdb \ No newline at end of file diff --git a/de/d1c/prim_8c__incl.svg b/de/d1c/prim_8c__incl.svg new file mode 100644 index 000000000..4e01dc188 --- /dev/null +++ b/de/d1c/prim_8c__incl.svg @@ -0,0 +1,82 @@ + + + + + + +greedy_approach/prim.c + + + +Node1 + + +greedy_approach/prim.c + + + + + +Node2 + + +stdio.h + + + + + +Node1->Node2 + + + + + +Node3 + + +string.h + + + + + +Node1->Node3 + + + + + +Node4 + + +assert.h + + + + + +Node1->Node4 + + + + + +Node5 + + +inttypes.h + + + + + +Node1->Node5 + + + + + diff --git a/de/d20/md_data_structures_dictionary__r_e_a_d_m_e.html b/de/d20/md_data_structures_dictionary__r_e_a_d_m_e.html index ad30647da..cdab6940f 100644 --- a/de/d20/md_data_structures_dictionary__r_e_a_d_m_e.html +++ b/de/d20/md_data_structures_dictionary__r_e_a_d_m_e.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Dictionary @@ -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,14 +89,13 @@ $(document).ready(function(){initNavTree('de/d20/md_data_structures_dictionary__
-
-
-
Dictionary
+
+
Dictionary
-

This is simple and generic dictionary. You can instantiate multiple dictionaries with the constructor. See interface below.

-

Each dictionary has space for 1000 elements.

-

You need add the files dic.c and dic.h in your project directory. After that you include dic.h

+

This is simple and generic dictionary. You can instantiate multiple dictionaries with the constructor. See interface below.

+

Each dictionary has space for 1000 elements.

+

You need add the files dic.c and dic.h in your project directory. After that you include dic.h

Overview about functions

Dictionary * create_dict(void);
@@ -117,7 +116,7 @@ Overview about functions diff --git a/de/d4e/lu__decompose_8c__incl.map b/de/d4e/lu__decompose_8c__incl.map index 233967a06..17d03c20f 100644 --- a/de/d4e/lu__decompose_8c__incl.map +++ b/de/d4e/lu__decompose_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/de/d4e/lu__decompose_8c__incl.svg b/de/d4e/lu__decompose_8c__incl.svg index ba5bc88bc..6f32057c4 100644 --- a/de/d4e/lu__decompose_8c__incl.svg +++ b/de/d4e/lu__decompose_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - -numerical_methods/lu + +numerical_methods/lu _decompose.c diff --git a/de/d50/min__printf_8h__dep__incl.map b/de/d50/min__printf_8h__dep__incl.map new file mode 100644 index 000000000..16cc4a3b9 --- /dev/null +++ b/de/d50/min__printf_8h__dep__incl.map @@ -0,0 +1,4 @@ + + + + diff --git a/de/d50/min__printf_8h__dep__incl.md5 b/de/d50/min__printf_8h__dep__incl.md5 new file mode 100644 index 000000000..e5e120aa5 --- /dev/null +++ b/de/d50/min__printf_8h__dep__incl.md5 @@ -0,0 +1 @@ +6e23e8e270b03bd8c77d75f15d366180 \ No newline at end of file diff --git a/de/d50/min__printf_8h__dep__incl.svg b/de/d50/min__printf_8h__dep__incl.svg new file mode 100644 index 000000000..5aac90dcd --- /dev/null +++ b/de/d50/min__printf_8h__dep__incl.svg @@ -0,0 +1,39 @@ + + + + + + +developer_tools/min_printf.h + + + +Node1 + + +developer_tools/min +_printf.h + + + + + +Node2 + + +developer_tools/test +_min_printf.c + + + + + +Node1->Node2 + + + + + diff --git a/de/d58/structquaternion__.html b/de/d58/structquaternion__.html index d0c1e3222..a87349724 100644 --- a/de/d58/structquaternion__.html +++ b/de/d58/structquaternion__.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: quaternion_ 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() {
@@ -92,8 +92,7 @@ $(document).ready(function(){initNavTree('de/d58/structquaternion__.html','../..
@@ -104,32 +103,32 @@ $(document).ready(function(){initNavTree('de/d58/structquaternion__.html','../..
Collaboration diagram for quaternion_:
-
+
[legend]
- - +   float   w +   float   q0 - +   vec_3d   dual - @@ -147,7 +146,7 @@ union {

+

Data Fields

+
union {
-   float   w
 real part of quaternion
 
-   float   q0
 real part of quaternion
 
}; 
 dual part of quaternion
 
+
union {
-   vec_3d   dual
 can be a 3D vector
 
+
   struct {
      float   q1
 

Detailed Description

-

a Quaternion type represented using a scalar \(w\) or \(q_0\) and a 3D vector \(\left(q_1,q_2,q_3\right)\)

+

a Quaternion type represented using a scalar \(w\) or \(q_0\) and a 3D vector \(\left(q_1,q_2,q_3\right)\)


The documentation for this struct was generated from the following file: @@ -157,7 +156,7 @@ union { diff --git a/de/d58/structquaternion__.js b/de/d58/structquaternion__.js index a5947e819..3f5c36aa1 100644 --- a/de/d58/structquaternion__.js +++ b/de/d58/structquaternion__.js @@ -2,8 +2,5 @@ var structquaternion__ = [ [ "dual", "de/d58/structquaternion__.html#a596abbab688731119c1f23b26a7ac17a", null ], [ "q0", "de/d58/structquaternion__.html#a37819eb7d76c65c37a9c2a63f01f65b2", null ], - [ "q1", "de/d58/structquaternion__.html#a3b00276b56da72911199baf48814b3f6", null ], - [ "q2", "de/d58/structquaternion__.html#a627574208aad1215fde8fcf9cb3f36e4", null ], - [ "q3", "de/d58/structquaternion__.html#a2ce1409f1d683aa40eade31d60ded530", null ], [ "w", "de/d58/structquaternion__.html#a835e2ba72517fbb29d0d4e3cb4c2914f", null ] ]; \ No newline at end of file diff --git a/de/d5a/group__quaternions.html b/de/d5a/group__quaternions.html index 05585f864..40de1310f 100644 --- a/de/d5a/group__quaternions.html +++ b/de/d5a/group__quaternions.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Library for 3D Vectors & Quaternions @@ -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,17 @@ $(document).ready(function(){initNavTree('de/d5a/group__quaternions.html','../.. Modules | Files | Macros
-
-
Library for 3D Vectors & Quaternions
+
Library for 3D Vectors & Quaternions
Collaboration diagram for Library for 3D Vectors & Quaternions:
-
+
- @@ -116,13 +115,13 @@ Modules

+

Modules

 3D Vector operations
 
 3D Dual-Quaternion operations
 
-

+

Files

file  geometry_datatypes.h
 Generic header that provides data types for 3D vectors and quaternions.
 
- @@ -130,7 +129,7 @@ Macros

+

Macros

#define EPSILON   1e-9
 Minimum recognizable value. More...

Detailed Description

Macro Definition Documentation

- +

◆ EPSILON

@@ -143,7 +142,7 @@ Macros

Minimum recognizable value.

-

Any value less than this is considered to be \(=0\)

+

Any value less than this is considered to be \(=0\)

@@ -152,7 +151,7 @@ Macros diff --git a/de/d5a/group__quaternions.js b/de/d5a/group__quaternions.js index f7c23d7e3..0bf32d6a0 100644 --- a/de/d5a/group__quaternions.js +++ b/de/d5a/group__quaternions.js @@ -1,10 +1,5 @@ var group__quaternions = [ - [ "Overview about functions", "de/d20/md_data_structures_dictionary__r_e_a_d_m_e.html#autotoc_md35", null ], - [ "Content", "d1/d12/md_data_structures_stack__r_e_a_d_m_e.html#autotoc_md37", null ], - [ "Public interface", "d1/d12/md_data_structures_stack__r_e_a_d_m_e.html#autotoc_md38", null ], - [ "Overview", "d7/db5/md_exercism__r_e_a_d_m_e.html#autotoc_md58", null ], - [ "LeetCode Algorithm", "df/d58/md_leetcode__r_e_a_d_m_e.html#autotoc_md60", null ], [ "3D Vector operations", "de/d7b/group__vec__3d.html", "de/d7b/group__vec__3d" ], [ "Matrix operations", "dd/d7a/group__matrix.html", "dd/d7a/group__matrix" ], [ "3D Quaternion operations", "dc/d9a/group__quats.html", "dc/d9a/group__quats" ], diff --git a/de/d5a/group__quaternions.map b/de/d5a/group__quaternions.map index 65cbab886..2b0fdc32b 100644 --- a/de/d5a/group__quaternions.map +++ b/de/d5a/group__quaternions.map @@ -1,7 +1,7 @@ - - - - - + + + + + diff --git a/de/d5a/group__quaternions.md5 b/de/d5a/group__quaternions.md5 index 00296cbce..07b2b4491 100644 --- a/de/d5a/group__quaternions.md5 +++ b/de/d5a/group__quaternions.md5 @@ -1 +1 @@ -32b0b7d3011908690e664267ca54375d \ No newline at end of file +6069cec4fe239a7250c814666a8a5bdb \ No newline at end of file diff --git a/de/d5a/group__quaternions.svg b/de/d5a/group__quaternions.svg index 57c36b945..ef99e8e95 100644 --- a/de/d5a/group__quaternions.svg +++ b/de/d5a/group__quaternions.svg @@ -1,20 +1,21 @@ - - + Library for 3D Vectors & Quaternions - - + + -Node4 - - -3D Quaternion operations +Node5 + + +3D Dual-Quaternion + operations @@ -22,63 +23,62 @@ Node3 - -Matrix operations - - - - - -Node2 - - -3D Vector operations - - - - - -Node5 - - -3D Dual-Quaternion - operations + +Matrix operations - + Node1 - - -Library for 3D Vectors - & Quaternions + + +Library for 3D Vectors + & Quaternions + + + + + +Node1->Node5 + + + + + +Node1->Node3 + + + + + +Node4 + + +3D Quaternion operations Node1->Node4 - - + + + + + +Node2 + + +3D Vector operations + - - -Node1->Node3 - - Node1->Node2 - - - - - -Node1->Node5 - - + + diff --git a/de/d5e/bubble__sort_8c__incl.map b/de/d5e/bubble__sort_8c__incl.map index e137c0ea1..d460c7fc2 100644 --- a/de/d5e/bubble__sort_8c__incl.map +++ b/de/d5e/bubble__sort_8c__incl.map @@ -1,8 +1,8 @@ - + - - - - + + + + diff --git a/de/d5e/bubble__sort_8c__incl.svg b/de/d5e/bubble__sort_8c__incl.svg index 0688aea46..393763ac7 100644 --- a/de/d5e/bubble__sort_8c__incl.svg +++ b/de/d5e/bubble__sort_8c__incl.svg @@ -1,20 +1,20 @@ - - + sorting/bubble_sort.c - + Node1 - -sorting/bubble_sort.c + +sorting/bubble_sort.c @@ -30,68 +30,68 @@ Node1->Node2 - - + + Node3 - -stdbool.h + +stdbool.h Node1->Node3 - - + + Node4 - -stdio.h + +stdio.h Node1->Node4 - - + + Node5 - -stdlib.h + +stdlib.h Node1->Node5 - - + + Node6 - -time.h + +time.h Node1->Node6 - - + + diff --git a/de/d7b/group__vec__3d.html b/de/d7b/group__vec__3d.html index 7c26be006..e2446c349 100644 --- a/de/d7b/group__vec__3d.html +++ b/de/d7b/group__vec__3d.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: 3D Vector operations @@ -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,31 +94,30 @@ $(document).ready(function(){initNavTree('de/d7b/group__vec__3d.html','../../'); Data Structures | Typedefs | Functions
- +
Collaboration diagram for 3D Vector operations:
-
+
-

+

Data Structures

struct  vec_3d_
 3D vector type More...
 
- - +

+

Typedefs

-typedef struct vec_3d_ vec_3d
+typedef struct vec_3d_ vec_3d
 3D vector type
 
- @@ -132,9 +131,9 @@ Functions - - - + + + @@ -144,10 +143,13 @@ Functions + + +

+

Functions

vec_3d vector_sub (const vec_3d *a, const vec_3d *b)
 Subtract one vector from another. More...
vec_3d vector_prod (const vec_3d *a, const vec_3d *b)
 Compute the vector product of two 3d vectors. More...
 
const char * print_vector (const vec_3d *a, const char *name)
 Print formatted vector on stdout. More...
 
const char * print_vector (const vec_3d *a, const char *name)
 Print formatted vector on stdout. More...
 
float vector_norm (const vec_3d *a)
 Compute the norm a vector. More...
 
mat_3x3 get_cross_matrix (const vec_3d *a)
 The cross product of vectors can be represented as a matrix multiplication operation. More...
 
double get_angle (const vec_3d *a, const vec_3d *b)
 Obtain the angle between two given vectors. More...
 

Detailed Description

Function Documentation

- +

◆ dot_prod()

@@ -185,25 +187,91 @@ Functions
Returns
resulting dot product
-
77 {
-
78  float dot;
-
79 #ifdef LIBQUAT_ARM
-
80  arm_dot_prod_f32((float *)a, (float *)b, &dot);
-
81 #else
-
82  dot = a->x * b->x;
-
83  dot += a->y * b->y;
-
84  dot += a->z * b->z;
-
85 #endif
-
86 
-
87  return dot;
-
88 }
+
77{
+
78 float dot;
+
79#ifdef LIBQUAT_ARM
+
80 arm_dot_prod_f32((float *)a, (float *)b, &dot);
+
81#else
+
82 dot = a->x * b->x;
+
83 dot += a->y * b->y;
+
84 dot += a->z * b->z;
+
85#endif
+
86
+
87 return dot;
+
88}
float z
Z co-ordinate.
Definition: geometry_datatypes.h:25
float x
X co-ordinate.
Definition: geometry_datatypes.h:23
float y
Y co-ordinate.
Definition: geometry_datatypes.h:24
- + +

◆ get_angle()

+ +
+
+ + + + + + + + + + + + + + + + + + +
double get_angle (const vec_3d * a,
const vec_3d * b 
)
+
+ +

Obtain the angle between two given vectors.

+

+\[\alpha=acos\left(\frac{\vec{a} \cdot \vec{b}}{\lVert\vec{a}\rVert \cdot \lVert\vec{b}\rVert}\right)\] +

+
Parameters
+ + + +
[in]afirst input vector
[in]bsecond input vector
+
+
+
Returns
angle between \(\vec{a}\) and \(\vec{b}\) in radians
+

< The norm of vector a

+

< The norm of vector b

+

detect possible division by 0 - the angle is not defined in this case

+
203{
+
204 double alpha, cos_alpha;
+
205 float norm_a = vector_norm(a); ///< The norm of vector a
+
206 float norm_b = vector_norm(b); ///< The norm of vector b
+
207 if (fabsf(norm_a) < EPSILON || fabsf(norm_b) < EPSILON) /// detect possible division by 0 - the angle is not defined in this case
+
208 {
+
209 return NAN;
+
210 }
+
211
+
212 cos_alpha = dot_prod(a, b) / (norm_a * norm_b);
+
213 alpha = acos(cos_alpha); // delivers the radian
+
214 return alpha; // in range from -1 to 1
+
215}
+
#define EPSILON
Minimum recognizable value.
Definition: geometry_datatypes.h:14
+
float dot_prod(const vec_3d *a, const vec_3d *b)
Obtain the dot product of two 3D vectors.
Definition: vectors_3d.c:76
+
float vector_norm(const vec_3d *a)
Compute the norm a vector.
Definition: vectors_3d.c:138
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+

◆ get_cross_matrix()

@@ -220,7 +288,7 @@ Functions

The cross product of vectors can be represented as a matrix multiplication operation.

-

This function obtains the 3x3 matrix of the cross-product operator from the first vector.

+

This function obtains the 3x3 matrix of the cross-product operator from the first vector.

\[\begin{align*} \left(\vec{a}\times\right)\vec{b} &= \tilde{A}_a\vec{b}\\ \tilde{A}_a &= \begin{bmatrix}0&-a_z&a_y\\a_z&0&-a_x\\-a_y&a_x&0\end{bmatrix} \end{align*}\]

Parameters
@@ -230,22 +298,22 @@ Functions
Returns
the 3x3 matrix for the cross product operator \(\left(\vec{a}\times\right)\)
-
189 {
-
190  mat_3x3 A = {0., -a->z, a->y, a->z, 0., -a->x, -a->y, a->x, 0.};
-
191  return A;
-
192 }
+
189{
+
190 mat_3x3 A = {0., -a->z, a->y, a->z, 0., -a->x, -a->y, a->x, 0.};
+
191 return A;
+
192}
A 3x3 Matrix type definition.
Definition: geometry_datatypes.h:35
- -

◆ print_vector()

+ +

◆ print_vector()

- + @@ -273,18 +341,18 @@ Functions
Returns
string representation of vector
-
123 {
-
124  static char vec_str[100]; // static to ensure the string life extends the
-
125  // life of function
-
126 
-
127  snprintf(vec_str, 99, "vec(%s) = (%.3g)i + (%.3g)j + (%.3g)k\n", name, a->x,
-
128  a->y, a->z);
-
129  return vec_str;
-
130 }
+
123{
+
124 static char vec_str[100]; // static to ensure the string life extends the
+
125 // life of function
+
126
+
127 snprintf(vec_str, 99, "vec(%s) = (%.3g)i + (%.3g)j + (%.3g)k\n", name, a->x,
+
128 a->y, a->z);
+
129 return vec_str;
+
130}
- +

◆ unit_vec()

@@ -311,36 +379,34 @@ Functions
Returns
n unit vector in the direction of \(\vec{a}\)
-
157 {
-
158  vec_3d n = {0};
-
159 
-
160  float norm = vector_norm(a);
-
161  if (fabsf(norm) < EPSILON)
-
162  { // detect possible divide by 0
-
163  return n;
-
164  }
-
165 
-
166  if (norm != 1.F) // perform division only if needed
-
167  {
-
168  n.x = a->x / norm;
-
169  n.y = a->y / norm;
-
170  n.z = a->z / norm;
-
171  }
-
172  return n;
-
173 }
-
#define EPSILON
Minimum recognizable value.
Definition: geometry_datatypes.h:14
-
float vector_norm(const vec_3d *a)
Compute the norm a vector.
Definition: vectors_3d.c:138
+
157{
+
158 vec_3d n = {0};
+
159
+
160 float norm = vector_norm(a);
+
161 if (fabsf(norm) < EPSILON)
+
162 { // detect possible divide by 0
+
163 return n;
+
164 }
+
165
+
166 if (norm != 1.F) // perform division only if needed
+
167 {
+
168 n.x = a->x / norm;
+
169 n.y = a->y / norm;
+
170 n.z = a->z / norm;
+
171 }
+
172 return n;
+
173}
3D vector type
Definition: geometry_datatypes.h:22
Here is the call graph for this function:
-
+
- +

◆ vector_add()

@@ -378,22 +444,22 @@ Here is the call graph for this function:
Returns
resultant vector
-
54 {
-
55  vec_3d out;
-
56 #ifdef LIBQUAT_ARM
-
57  arm_add_f32((float *)a, (float *)b, (float *)&out);
-
58 #else
-
59  out.x = a->x + b->x;
-
60  out.y = a->y + b->y;
-
61  out.z = a->z + b->z;
-
62 #endif
-
63 
-
64  return out;
-
65 }
+
54{
+
55 vec_3d out;
+
56#ifdef LIBQUAT_ARM
+
57 arm_add_f32((float *)a, (float *)b, (float *)&out);
+
58#else
+
59 out.x = a->x + b->x;
+
60 out.y = a->y + b->y;
+
61 out.z = a->z + b->z;
+
62#endif
+
63
+
64 return out;
+
65}
- +

◆ vector_norm()

@@ -420,27 +486,26 @@ Here is the call graph for this function:
Returns
norm of the given vector
-
139 {
-
140  float n = dot_prod(a, a);
-
141 #ifdef LIBQUAT_ARM
-
142  arm_sqrt_f32(*n, n);
-
143 #else
-
144  n = sqrtf(n);
-
145 #endif
-
146 
-
147  return n;
-
148 }
-
float dot_prod(const vec_3d *a, const vec_3d *b)
Obtain the dot product of two 3D vectors.
Definition: vectors_3d.c:76
+
139{
+
140 float n = dot_prod(a, a);
+
141#ifdef LIBQUAT_ARM
+
142 arm_sqrt_f32(*n, n);
+
143#else
+
144 n = sqrtf(n);
+
145#endif
+
146
+
147 return n;
+
148}
Here is the call graph for this function:
-
+
- +

◆ vector_prod()

@@ -478,19 +543,19 @@ Here is the call graph for this function:
Returns
resultant vector \(\vec{o}=\vec{a}\times\vec{b}\)
-
106 {
-
107  vec_3d out; // better this way to avoid copying results to input
-
108  // vectors themselves
-
109  out.x = a->y * b->z - a->z * b->y;
-
110  out.y = -a->x * b->z + a->z * b->x;
-
111  out.z = a->x * b->y - a->y * b->x;
-
112 
-
113  return out;
-
114 }
+
106{
+
107 vec_3d out; // better this way to avoid copying results to input
+
108 // vectors themselves
+
109 out.x = a->y * b->z - a->z * b->y;
+
110 out.y = -a->x * b->z + a->z * b->x;
+
111 out.z = a->x * b->y - a->y * b->x;
+
112
+
113 return out;
+
114}
- +

◆ vector_sub()

@@ -528,18 +593,18 @@ Here is the call graph for this function:
Returns
resultant vector
-
32 {
-
33  vec_3d out;
-
34 #ifdef LIBQUAT_ARM
-
35  arm_sub_f32((float *)a, (float *)b, (float *)&out);
-
36 #else
-
37  out.x = a->x - b->x;
-
38  out.y = a->y - b->y;
-
39  out.z = a->z - b->z;
-
40 #endif
-
41 
-
42  return out;
-
43 }
+
32{
+
33 vec_3d out;
+
34#ifdef LIBQUAT_ARM
+
35 arm_sub_f32((float *)a, (float *)b, (float *)&out);
+
36#else
+
37 out.x = a->x - b->x;
+
38 out.y = a->y - b->y;
+
39 out.z = a->z - b->z;
+
40#endif
+
41
+
42 return out;
+
43}
@@ -548,7 +613,7 @@ Here is the call graph for this function: diff --git a/de/d7b/group__vec__3d.js b/de/d7b/group__vec__3d.js index 40f7385d5..50e8eeac6 100644 --- a/de/d7b/group__vec__3d.js +++ b/de/d7b/group__vec__3d.js @@ -7,8 +7,9 @@ var group__vec__3d = ] ], [ "vec_3d", "de/d7b/group__vec__3d.html#gaf9ee870d4922e488bdd3e7262485c270", null ], [ "dot_prod", "de/d7b/group__vec__3d.html#ga243e74d542d0d4d14fa3ae0bc2170d84", null ], + [ "get_angle", "de/d7b/group__vec__3d.html#ga55be1d766c8a824b35d97e79744834d8", null ], [ "get_cross_matrix", "de/d7b/group__vec__3d.html#ga5082b0720c2cc51ae84bf19bd76dc849", null ], - [ "print_vector", "de/d7b/group__vec__3d.html#ga4fd194972bea4884e0b33cf4a166d14e", null ], + [ "print_vector", "de/d7b/group__vec__3d.html#gae25e1f2e973933bef65838601e2de0af", null ], [ "unit_vec", "de/d7b/group__vec__3d.html#ga3cdfd8378a0b115563ea6c561bb46b7e", null ], [ "vector_add", "de/d7b/group__vec__3d.html#gaa6b5ac18429ffb0131dc8593d31c25a4", null ], [ "vector_norm", "de/d7b/group__vec__3d.html#ga94805165d037d111d7d7c0df99e3a5de", null ], diff --git a/de/d7b/group__vec__3d.map b/de/d7b/group__vec__3d.map index 87cad9ab9..793b163fa 100644 --- a/de/d7b/group__vec__3d.map +++ b/de/d7b/group__vec__3d.map @@ -1,4 +1,4 @@ - - + + diff --git a/de/d7b/group__vec__3d.md5 b/de/d7b/group__vec__3d.md5 index 6d70d8f43..6f75cf033 100644 --- a/de/d7b/group__vec__3d.md5 +++ b/de/d7b/group__vec__3d.md5 @@ -1 +1 @@ -3378f33d94bee44740695aa3b360f65b \ No newline at end of file +eee56c19d475537321250867f6f7662e \ No newline at end of file diff --git a/de/d7b/group__vec__3d.svg b/de/d7b/group__vec__3d.svg index 557b6be99..2173c2cf1 100644 --- a/de/d7b/group__vec__3d.svg +++ b/de/d7b/group__vec__3d.svg @@ -1,38 +1,38 @@ - - + 3D Vector operations - - - -Node1 - - -3D Vector operations - - - + - + Node2 - + Library for 3D Vectors & Quaternions + + +Node1 + + +3D Vector operations + + + Node2->Node1 - - + + diff --git a/de/d7b/group__vec__3d_ga3cdfd8378a0b115563ea6c561bb46b7e_cgraph.map b/de/d7b/group__vec__3d_ga3cdfd8378a0b115563ea6c561bb46b7e_cgraph.map index d9d49dffe..4dda420e0 100644 --- a/de/d7b/group__vec__3d_ga3cdfd8378a0b115563ea6c561bb46b7e_cgraph.map +++ b/de/d7b/group__vec__3d_ga3cdfd8378a0b115563ea6c561bb46b7e_cgraph.map @@ -1,5 +1,5 @@ - - - + + + diff --git a/de/d7b/group__vec__3d_ga3cdfd8378a0b115563ea6c561bb46b7e_cgraph.svg b/de/d7b/group__vec__3d_ga3cdfd8378a0b115563ea6c561bb46b7e_cgraph.svg index 8d641a92c..7bfe56bd2 100644 --- a/de/d7b/group__vec__3d_ga3cdfd8378a0b115563ea6c561bb46b7e_cgraph.svg +++ b/de/d7b/group__vec__3d_ga3cdfd8378a0b115563ea6c561bb46b7e_cgraph.svg @@ -1,20 +1,20 @@ - - + unit_vec - + Node1 - -unit_vec + +unit_vec @@ -22,31 +22,31 @@ Node2 - -vector_norm + +vector_norm Node1->Node2 - - + + Node3 - -dot_prod + +dot_prod Node2->Node3 - - + + diff --git a/de/d7b/group__vec__3d_ga55be1d766c8a824b35d97e79744834d8_cgraph.map b/de/d7b/group__vec__3d_ga55be1d766c8a824b35d97e79744834d8_cgraph.map new file mode 100644 index 000000000..9386a0727 --- /dev/null +++ b/de/d7b/group__vec__3d_ga55be1d766c8a824b35d97e79744834d8_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/de/d7b/group__vec__3d_ga55be1d766c8a824b35d97e79744834d8_cgraph.md5 b/de/d7b/group__vec__3d_ga55be1d766c8a824b35d97e79744834d8_cgraph.md5 new file mode 100644 index 000000000..5071aa946 --- /dev/null +++ b/de/d7b/group__vec__3d_ga55be1d766c8a824b35d97e79744834d8_cgraph.md5 @@ -0,0 +1 @@ +4d38ffb3b2ab1f9ae7263359411c32dd \ No newline at end of file diff --git a/de/d7b/group__vec__3d_ga55be1d766c8a824b35d97e79744834d8_cgraph.svg b/de/d7b/group__vec__3d_ga55be1d766c8a824b35d97e79744834d8_cgraph.svg new file mode 100644 index 000000000..84bfcf4c2 --- /dev/null +++ b/de/d7b/group__vec__3d_ga55be1d766c8a824b35d97e79744834d8_cgraph.svg @@ -0,0 +1,58 @@ + + + + + + +get_angle + + + +Node1 + + +get_angle + + + + + +Node2 + + +dot_prod + + + + + +Node1->Node2 + + + + + +Node3 + + +vector_norm + + + + + +Node1->Node3 + + + + + +Node3->Node2 + + + + + diff --git a/de/d7b/group__vec__3d_ga94805165d037d111d7d7c0df99e3a5de_cgraph.map b/de/d7b/group__vec__3d_ga94805165d037d111d7d7c0df99e3a5de_cgraph.map index 45a7f63df..5065a07cc 100644 --- a/de/d7b/group__vec__3d_ga94805165d037d111d7d7c0df99e3a5de_cgraph.map +++ b/de/d7b/group__vec__3d_ga94805165d037d111d7d7c0df99e3a5de_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/de/d7b/group__vec__3d_ga94805165d037d111d7d7c0df99e3a5de_cgraph.svg b/de/d7b/group__vec__3d_ga94805165d037d111d7d7c0df99e3a5de_cgraph.svg index 8be81ea6a..e66b56fcf 100644 --- a/de/d7b/group__vec__3d_ga94805165d037d111d7d7c0df99e3a5de_cgraph.svg +++ b/de/d7b/group__vec__3d_ga94805165d037d111d7d7c0df99e3a5de_cgraph.svg @@ -1,20 +1,20 @@ - - + vector_norm - + Node1 - -vector_norm + +vector_norm @@ -22,16 +22,16 @@ Node2 - -dot_prod + +dot_prod Node1->Node2 - - + + diff --git a/de/dac/sudoku__solver_8c.html b/de/dac/sudoku__solver_8c.html index 3c71a8c40..2812c4006 100644 --- a/de/dac/sudoku__solver_8c.html +++ b/de/dac/sudoku__solver_8c.html @@ -2,8 +2,8 @@ - - + +Algorithms_in_C: misc/sudoku_solver.c File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ @@ -42,21 +41,22 @@
const char* print_vector const char * print_vector ( const vec_3d *  a,
-
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('de/dac/sudoku__solver_8c.html','../../ -
-
sudoku_solver.c File Reference
+
sudoku_solver.c File Reference
@@ -110,17 +109,17 @@ $(document).ready(function(){initNavTree('de/dac/sudoku__solver_8c.html','../../
Include dependency graph for sudoku_solver.c:
-
+
-

+

Data Structures

struct  sudoku
 Structure to hold the matrix and dimensions. More...
 
- @@ -143,33 +142,123 @@ Functions - + - - + +

+

Functions

bool OKrow (const struct sudoku *a, int x, int y, int v)
 Check if x^th row is valid. More...
bool solve (struct sudoku *a)
 Function to solve a partially filled sudoku matrix. More...
 
-void test ()
void test ()
 
-int main ()
 Main function.
int main ()
 Main function. More...
 

Detailed Description

-

Sudoku Solver using recursive implementation of brute-force algorithm.

-

Given an incomplete N*N Sudoku and asked to solve it using the following recursive algorithm:

    +

    Sudoku Solver using recursive implementation of brute-force algorithm.

    +

    Given an incomplete N*N Sudoku and asked to solve it using the following recursive algorithm:

    1. Scan the Sudoku from left to right row-wise to search for an empty cell.
    2. If there are no empty cells, print the Sudoku. Go to step 5.
    3. In the empty cell, try putting numbers 1 to N while ensuring that no two numbers in a single row, column, or box are same. Go back to step 1.
    4. Declare that the Sudoku is Invalid.
    5. Exit.
    -
    Authors
    Anuj Shah
    +
    Authors
    Anuj Shah
    -Krishna Vedala
    -
+Krishna Vedala +

Function Documentation

+ +

◆ main()

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

Main function.

+
247{
+
248 test();
+
249
+
250 struct sudoku a; // store the matrix as a 1D array
+
251 scanf("%" SCNu8, &(a.N));
+
252 a.a = (uint8_t *)malloc(a.N * a.N * sizeof(uint8_t));
+
253 a.N2 = (uint8_t)sqrt(a.N);
+
254
+
255 for (int i = 0; i < a.N; i++)
+
256 for (int j = 0; j < a.N; j++) scanf("%" SCNu8, &(a.a[i * a.N + j]));
+
257
+
258 printf("Entered a %udx%ud matrix with block size: %" SCNu8 "\n", a.N, a.N,
+
259 a.N2);
+
260 // print(&a);
+
261 printf("\n\n");
+
262 if (solve(&a))
+
263 printf("Valid solution found!\n");
+
264 else
+
265 printf("Invalid\n");
+
266 print(&a);
+
267
+
268 free(a.a);
+
269 return 0;
+
270}
+
void test()
Test function.
Definition: decimal_to_binary_recursion.c:20
+
void print(const struct sudoku *a)
Print the matrix to stdout.
Definition: sudoku_solver.c:126
+
bool solve(struct sudoku *a)
Function to solve a partially filled sudoku matrix.
Definition: sudoku_solver.c:172
+
#define malloc(bytes)
This macro replace the standard malloc function with malloc_dbg.
Definition: malloc_dbg.h:18
+
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
+
Structure to hold the matrix and dimensions.
Definition: sudoku_solver.c:33
+
uint8_t * a
matrix as a flattened 1D row-major array
Definition: sudoku_solver.c:34
+
+
+
+ +

◆ test()

+ +
+
+ + + + + + + + +
void test (void )
+
+
222{
+
223 printf("Test begin...\n");
+
224
+
225 uint8_t test_array[] = {3, 0, 6, 5, 0, 8, 4, 0, 0, 5, 2, 0, 0, 0, 0, 0, 0,
+
226 0, 0, 8, 7, 0, 0, 0, 0, 3, 1, 0, 0, 3, 0, 1, 0, 0,
+
227 8, 0, 9, 0, 0, 8, 6, 3, 0, 0, 5, 0, 5, 0, 0, 9, 0,
+
228 6, 0, 0, 1, 3, 0, 0, 0, 0, 2, 5, 0, 0, 0, 0, 0, 0,
+
229 0, 0, 7, 4, 0, 0, 5, 2, 0, 6, 3, 0, 0};
+
230 struct sudoku a = {.N = 9, .N2 = 3, .a = test_array};
+
231 assert(solve(&a)); // ensure that solution is obtained
+
232
+
233 uint8_t expected[] = {3, 1, 6, 5, 7, 8, 4, 9, 2, 5, 2, 9, 1, 3, 4, 7, 6,
+
234 8, 4, 8, 7, 6, 2, 9, 5, 3, 1, 2, 6, 3, 4, 1, 5, 9,
+
235 8, 7, 9, 7, 4, 8, 6, 3, 1, 2, 5, 8, 5, 1, 7, 9, 2,
+
236 6, 4, 3, 1, 3, 8, 9, 4, 7, 2, 5, 6, 6, 9, 2, 3, 5,
+
237 1, 8, 7, 4, 7, 4, 5, 2, 8, 6, 3, 1, 9};
+
238 for (int i = 0; i < a.N; i++)
+
239 for (int j = 0; j < a.N; j++)
+
240 assert(a.a[i * a.N + j] == expected[i * a.N + j]);
+
241
+
242 printf("Test passed\n");
+
243}
+
+
+
+
diff --git a/de/dac/sudoku__solver_8c.js b/de/dac/sudoku__solver_8c.js index fde4a17cc..d2a1e5ea5 100644 --- a/de/dac/sudoku__solver_8c.js +++ b/de/dac/sudoku__solver_8c.js @@ -7,6 +7,5 @@ var sudoku__solver_8c = [ "OKcol", "d5/df4/group__sudoku.html#ga6503128d4f5ce0a0826f72f73f9e0b2a", null ], [ "OKrow", "d5/df4/group__sudoku.html#ga85d25d3b40017436f264a103685e4c55", null ], [ "print", "d5/df4/group__sudoku.html#ga702ff4f95dde780c7d04fcdd1021b6c1", null ], - [ "solve", "d5/df4/group__sudoku.html#gadfe0ed5085b4775d8fa00b434cc0fdfc", null ], - [ "test", "de/dac/sudoku__solver_8c.html#ae1a3968e7947464bee7714f6d43b7002", null ] + [ "solve", "d5/df4/group__sudoku.html#gadfe0ed5085b4775d8fa00b434cc0fdfc", null ] ]; \ No newline at end of file diff --git a/de/dce/structmin__heap.html b/de/dce/structmin__heap.html index 1d1758a3d..a6fb24d9f 100644 --- a/de/dce/structmin__heap.html +++ b/de/dce/structmin__heap.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: min_heap 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() {
@@ -92,20 +92,19 @@ $(document).ready(function(){initNavTree('de/dce/structmin__heap.html','../../')
-
-
min_heap Struct Reference
+
min_heap Struct Reference
- - - -

+

Data Fields

+
int * p
 
+
int size
 
+
int count
 
@@ -118,7 +117,7 @@ int count diff --git a/de/dce/structmin__heap.js b/de/dce/structmin__heap.js deleted file mode 100644 index 2708a426e..000000000 --- a/de/dce/structmin__heap.js +++ /dev/null @@ -1,6 +0,0 @@ -var structmin__heap = -[ - [ "count", "de/dce/structmin__heap.html#a9fd34546dad4dfd9e6a456936b766123", null ], - [ "p", "de/dce/structmin__heap.html#ad960bfacd24fb843208db83f113ebc8f", null ], - [ "size", "de/dce/structmin__heap.html#a456c6372c103c6d1bb430f581f5d3c71", null ] -]; \ No newline at end of file diff --git a/de/dd7/prime__seive_8c__incl.map b/de/dd7/prime__seive_8c__incl.map index 824e1294e..c8b3e24a4 100644 --- a/de/dd7/prime__seive_8c__incl.map +++ b/de/dd7/prime__seive_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/de/dd7/prime__seive_8c__incl.svg b/de/dd7/prime__seive_8c__incl.svg index 839b50e66..a9ee72297 100644 --- a/de/dd7/prime__seive_8c__incl.svg +++ b/de/dd7/prime__seive_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - + misc/prime_seive.c diff --git a/de/dff/heap__sort__2_8c.html b/de/dff/heap__sort__2_8c.html new file mode 100644 index 000000000..5e8066598 --- /dev/null +++ b/de/dff/heap__sort__2_8c.html @@ -0,0 +1,471 @@ + + + + + + + +Algorithms_in_C: sorting/heap_sort_2.c File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Algorithms_in_C 1.0.0 +
+
Set of algorithms implemented in C.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
heap_sort_2.c File Reference
+
+
+ +

Heap Sort implementation +More...

+
#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+#include <inttypes.h>
+
+Include dependency graph for heap_sort_2.c:
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + +

+Functions

void swap (int8_t *first, int8_t *second)
 for assert More...
 
void heapifyDown (int8_t *arr, const uint8_t size)
 heapifyDown Adjusts new root to the correct position in the heap This heapify procedure can be thought of as building a heap from the top down by successively shifting downward to establish the heap property. More...
 
void heapifyUp (int8_t *arr, uint8_t i)
 heapifyUp Adjusts arr[i] to the correct position in the heap This heapify procedure can be thought of as building a heap from the bottom up by successively shifting upward to establish the heap property. More...
 
void heapSort (int8_t *arr, const uint8_t size)
 Heap Sort algorithm. More...
 
static void test ()
 Self-test implementations. More...
 
int main ()
 Main function. More...
 
+

Detailed Description

+

Heap Sort implementation

+
Author
Dhruv Pasricha
+

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(Nlog(N))

+

Function Documentation

+ +

◆ heapifyDown()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void heapifyDown (int8_t * arr,
const uint8_t size 
)
+
+ +

heapifyDown Adjusts new root to the correct position in the heap This heapify procedure can be thought of as building a heap from the top down by successively shifting downward to establish the heap property.

+
Parameters
+ + + +
arrarray to be sorted
sizesize of array
+
+
+
Returns
void
+
49{
+
50 uint8_t i = 0;
+
51
+
52 while (2 * i + 1 < size)
+
53 {
+
54 uint8_t maxChild = 2 * i + 1;
+
55
+
56 if (2 * i + 2 < size && arr[2 * i + 2] > arr[maxChild])
+
57 {
+
58 maxChild = 2 * i + 2;
+
59 }
+
60
+
61 if (arr[maxChild] > arr[i])
+
62 {
+
63 swap(&arr[i], &arr[maxChild]);
+
64 i = maxChild;
+
65 }
+
66 else
+
67 {
+
68 break;
+
69 }
+
70 }
+
71}
+
void swap(int8_t *first, int8_t *second)
for assert
Definition: heap_sort_2.c:32
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ heapifyUp()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void heapifyUp (int8_t * arr,
uint8_t i 
)
+
+ +

heapifyUp Adjusts arr[i] to the correct position in the heap This heapify procedure can be thought of as building a heap from the bottom up by successively shifting upward to establish the heap property.

+
Parameters
+ + + +
arrarray to be sorted
iindex of the pushed element
+
+
+
Returns
void
+
83{
+
84 while (i > 0 && arr[i / 2] < arr[i])
+
85 {
+
86 swap(&arr[i / 2], &arr[i]);
+
87 i /= 2;
+
88 }
+
89}
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ heapSort()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void heapSort (int8_t * arr,
const uint8_t size 
)
+
+ +

Heap Sort algorithm.

+
Parameters
+ + + +
arrarray to be sorted
sizesize of the array
+
+
+
Returns
void
+
98{
+
99 if (size <= 1)
+
100 {
+
101 return;
+
102 }
+
103
+
104 for (uint8_t i = 0; i < size; i++)
+
105 {
+
106 // Pushing `arr[i]` to the heap
+
107
+
108 /*heapifyUp Adjusts arr[i] to the correct position in the heap*/
+
109 heapifyUp(arr, i);
+
110 }
+
111
+
112 for (uint8_t i = size - 1; i >= 1; i--)
+
113 {
+
114 // Moving current root to the end
+
115 swap(&arr[0], &arr[i]);
+
116
+
117 // `heapifyDown` adjusts new root to the correct position in the heap
+
118 heapifyDown(arr, i);
+
119
+
120 }
+
121}
+
void heapifyDown(int8_t *arr, const uint8_t size)
heapifyDown Adjusts new root to the correct position in the heap This heapify procedure can be though...
Definition: heap_sort_2.c:48
+
void heapifyUp(int8_t *arr, uint8_t i)
heapifyUp Adjusts arr[i] to the correct position in the heap This heapify procedure can be thought of...
Definition: heap_sort_2.c:82
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ main()

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

Main function.

+
Returns
0 on exit
+
150{
+
151 // Intializes random number generator
+
152 srand(time(NULL));
+
153
+
154 test(); // run self-test implementations
+
155 return 0;
+
156}
+
static void test()
Self-test implementations.
Definition: heap_sort_2.c:127
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ swap()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void swap (int8_t * first,
int8_t * second 
)
+
+ +

for assert

+

for IO operations for dynamic memory allocation for random numbers generation for uint8_t, int8_t

+

Swapped two numbers using pointer

Parameters
+ + + +
firstpointer of first number
secondpointer of second number
+
+
+
33{
+
34 int8_t temp = *first;
+
35 *first = *second;
+
36 *second = temp;
+
37}
+
+
+
+ +

◆ test()

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

Self-test implementations.

+
Returns
void
+
128{
+
129 const uint8_t size = 10;
+
130 int8_t *arr = (int8_t *)calloc(size, sizeof(int8_t));
+
131
+
132 /* generate size random numbers from 0 to 100 */
+
133 for (uint8_t i = 0; i < size; i++)
+
134 {
+
135 arr[i] = rand() % 100;
+
136 }
+
137 heapSort(arr, size);
+
138 for (uint8_t i = 0; i < size - 1; ++i)
+
139 {
+
140 assert(arr[i] <= arr[i + 1]);
+
141 }
+
142 free(arr);
+
143}
+
void heapSort(int8_t *arr, const uint8_t size)
Heap Sort algorithm.
Definition: heap_sort_2.c:97
+
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
+
#define calloc(elemCount, elemSize)
This macro replace the standard calloc function with calloc_dbg.
Definition: malloc_dbg.h:22
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+
+
+ + + + diff --git a/de/dff/heap__sort__2_8c.js b/de/dff/heap__sort__2_8c.js new file mode 100644 index 000000000..ebe69aa04 --- /dev/null +++ b/de/dff/heap__sort__2_8c.js @@ -0,0 +1,9 @@ +var heap__sort__2_8c = +[ + [ "heapifyDown", "de/dff/heap__sort__2_8c.html#a00cd944b33a5fe5972111ded9b49793c", null ], + [ "heapifyUp", "de/dff/heap__sort__2_8c.html#a619753b978f962aa2337e1fdb4e59e33", null ], + [ "heapSort", "de/dff/heap__sort__2_8c.html#a672a47d865e7fa18f1ff23001ef4a485", null ], + [ "main", "de/dff/heap__sort__2_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], + [ "swap", "de/dff/heap__sort__2_8c.html#aaf68497ab808b560dbf109da6435905a", null ], + [ "test", "de/dff/heap__sort__2_8c.html#aa8dca7b867074164d5f45b0f3851269d", null ] +]; \ No newline at end of file diff --git a/de/dff/heap__sort__2_8c_a00cd944b33a5fe5972111ded9b49793c_cgraph.map b/de/dff/heap__sort__2_8c_a00cd944b33a5fe5972111ded9b49793c_cgraph.map new file mode 100644 index 000000000..17a0a323e --- /dev/null +++ b/de/dff/heap__sort__2_8c_a00cd944b33a5fe5972111ded9b49793c_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/de/dff/heap__sort__2_8c_a00cd944b33a5fe5972111ded9b49793c_cgraph.md5 b/de/dff/heap__sort__2_8c_a00cd944b33a5fe5972111ded9b49793c_cgraph.md5 new file mode 100644 index 000000000..5d352b146 --- /dev/null +++ b/de/dff/heap__sort__2_8c_a00cd944b33a5fe5972111ded9b49793c_cgraph.md5 @@ -0,0 +1 @@ +666aaca193ef05f0f4ea417c8de15c37 \ No newline at end of file diff --git a/de/dff/heap__sort__2_8c_a00cd944b33a5fe5972111ded9b49793c_cgraph.svg b/de/dff/heap__sort__2_8c_a00cd944b33a5fe5972111ded9b49793c_cgraph.svg new file mode 100644 index 000000000..aad0229dd --- /dev/null +++ b/de/dff/heap__sort__2_8c_a00cd944b33a5fe5972111ded9b49793c_cgraph.svg @@ -0,0 +1,37 @@ + + + + + + +heapifyDown + + + +Node1 + + +heapifyDown + + + + + +Node2 + + +swap + + + + + +Node1->Node2 + + + + + diff --git a/de/dff/heap__sort__2_8c_a619753b978f962aa2337e1fdb4e59e33_cgraph.map b/de/dff/heap__sort__2_8c_a619753b978f962aa2337e1fdb4e59e33_cgraph.map new file mode 100644 index 000000000..f9d3148f5 --- /dev/null +++ b/de/dff/heap__sort__2_8c_a619753b978f962aa2337e1fdb4e59e33_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/de/dff/heap__sort__2_8c_a619753b978f962aa2337e1fdb4e59e33_cgraph.md5 b/de/dff/heap__sort__2_8c_a619753b978f962aa2337e1fdb4e59e33_cgraph.md5 new file mode 100644 index 000000000..f7b6f6930 --- /dev/null +++ b/de/dff/heap__sort__2_8c_a619753b978f962aa2337e1fdb4e59e33_cgraph.md5 @@ -0,0 +1 @@ +e13f5c0081f592a47422afd3d03aa095 \ No newline at end of file diff --git a/de/dff/heap__sort__2_8c_a619753b978f962aa2337e1fdb4e59e33_cgraph.svg b/de/dff/heap__sort__2_8c_a619753b978f962aa2337e1fdb4e59e33_cgraph.svg new file mode 100644 index 000000000..07b334fbb --- /dev/null +++ b/de/dff/heap__sort__2_8c_a619753b978f962aa2337e1fdb4e59e33_cgraph.svg @@ -0,0 +1,37 @@ + + + + + + +heapifyUp + + + +Node1 + + +heapifyUp + + + + + +Node2 + + +swap + + + + + +Node1->Node2 + + + + + diff --git a/de/dff/heap__sort__2_8c_a672a47d865e7fa18f1ff23001ef4a485_cgraph.map b/de/dff/heap__sort__2_8c_a672a47d865e7fa18f1ff23001ef4a485_cgraph.map new file mode 100644 index 000000000..5f8d09ff6 --- /dev/null +++ b/de/dff/heap__sort__2_8c_a672a47d865e7fa18f1ff23001ef4a485_cgraph.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/de/dff/heap__sort__2_8c_a672a47d865e7fa18f1ff23001ef4a485_cgraph.md5 b/de/dff/heap__sort__2_8c_a672a47d865e7fa18f1ff23001ef4a485_cgraph.md5 new file mode 100644 index 000000000..888f0e097 --- /dev/null +++ b/de/dff/heap__sort__2_8c_a672a47d865e7fa18f1ff23001ef4a485_cgraph.md5 @@ -0,0 +1 @@ +d9c0d1795953fc13f638cd6e2d43cf8b \ No newline at end of file diff --git a/de/dff/heap__sort__2_8c_a672a47d865e7fa18f1ff23001ef4a485_cgraph.svg b/de/dff/heap__sort__2_8c_a672a47d865e7fa18f1ff23001ef4a485_cgraph.svg new file mode 100644 index 000000000..aaab9a2a6 --- /dev/null +++ b/de/dff/heap__sort__2_8c_a672a47d865e7fa18f1ff23001ef4a485_cgraph.svg @@ -0,0 +1,79 @@ + + + + + + +heapSort + + + +Node1 + + +heapSort + + + + + +Node2 + + +heapifyDown + + + + + +Node1->Node2 + + + + + +Node3 + + +swap + + + + + +Node1->Node3 + + + + + +Node4 + + +heapifyUp + + + + + +Node1->Node4 + + + + + +Node2->Node3 + + + + + +Node4->Node3 + + + + + diff --git a/de/dff/heap__sort__2_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map b/de/dff/heap__sort__2_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map new file mode 100644 index 000000000..9f56e8168 --- /dev/null +++ b/de/dff/heap__sort__2_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/de/dff/heap__sort__2_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 b/de/dff/heap__sort__2_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 new file mode 100644 index 000000000..dcc07449c --- /dev/null +++ b/de/dff/heap__sort__2_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 @@ -0,0 +1 @@ +b291e87dfd09ebc9259d4f5fc9d9675a \ No newline at end of file diff --git a/de/dff/heap__sort__2_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/de/dff/heap__sort__2_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg new file mode 100644 index 000000000..0df2eb6a1 --- /dev/null +++ b/de/dff/heap__sort__2_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg @@ -0,0 +1,94 @@ + + + + + + +test + + + +Node1 + + +test + + + + + +Node2 + + +heapSort + + + + + +Node1->Node2 + + + + + +Node3 + + +heapifyDown + + + + + +Node2->Node3 + + + + + +Node4 + + +swap + + + + + +Node2->Node4 + + + + + +Node5 + + +heapifyUp + + + + + +Node2->Node5 + + + + + +Node3->Node4 + + + + + +Node5->Node4 + + + + + diff --git a/de/dff/heap__sort__2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/de/dff/heap__sort__2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..7d0ff290e --- /dev/null +++ b/de/dff/heap__sort__2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/de/dff/heap__sort__2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/de/dff/heap__sort__2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..6764c97c3 --- /dev/null +++ b/de/dff/heap__sort__2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +57e639efd64121dbd309211bd19170b3 \ No newline at end of file diff --git a/de/dff/heap__sort__2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/de/dff/heap__sort__2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..49ef52fec --- /dev/null +++ b/de/dff/heap__sort__2_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,109 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +test + + + + + +Node1->Node2 + + + + + +Node3 + + +heapSort + + + + + +Node2->Node3 + + + + + +Node4 + + +heapifyDown + + + + + +Node3->Node4 + + + + + +Node5 + + +swap + + + + + +Node3->Node5 + + + + + +Node6 + + +heapifyUp + + + + + +Node3->Node6 + + + + + +Node4->Node5 + + + + + +Node6->Node5 + + + + + diff --git a/df/d16/palindrome_8c.html b/df/d16/palindrome_8c.html index f90c7d454..bc6fd4035 100644 --- a/df/d16/palindrome_8c.html +++ b/df/d16/palindrome_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: misc/palindrome.c 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('df/d16/palindrome_8c.html','../../');
-
-
palindrome.c File Reference
+
palindrome.c File Reference
-

Program to identify if a number is palindrome number or not. +

Program to identify if a number is palindrome number or not. More...

#include <assert.h>
#include <stdbool.h>
@@ -105,25 +104,24 @@ $(document).ready(function(){initNavTree('df/d16/palindrome_8c.html','../../');
Include dependency graph for palindrome.c:
-
+
- - - + +

+

Functions

bool isPalindrome (int number)
 Check given number whether is palindrome number or not. More...
 
-int main ()
 Driver Code.
int main ()
 Driver Code. More...
 

Detailed Description

-

Program to identify if a number is palindrome number or not.

+

Program to identify if a number is palindrome number or not.

See also
project_euler/problem_4/sol1.c

Function Documentation

- +

◆ isPalindrome()

@@ -149,18 +147,52 @@ int 
Returns
true if given number is palindrome number
false if number is not a palindrome number
-
30 {
-
31  int reversedNumber = 0;
-
32  int originalNumber = number;
-
33  while (number != 0)
-
34  {
-
35  int remainder = number % 10;
-
36  reversedNumber = reversedNumber * 10 + remainder;
-
37  number /= 10;
-
38  }
-
39  return originalNumber == reversedNumber;
-
40 }
+
30{
+
31 int reversedNumber = 0;
+
32 int originalNumber = number;
+
33 while (number != 0)
+
34 {
+
35 int remainder = number % 10;
+
36 reversedNumber = reversedNumber * 10 + remainder;
+
37 number /= 10;
+
38 }
+
39 return originalNumber == reversedNumber;
+
40}
+
+
+ +

◆ main()

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

Driver Code.

+
15{
+
16 assert(isPalindrome(0));
+
17 assert(isPalindrome(1));
+
18 assert(isPalindrome(12321));
+
19 assert(!isPalindrome(1234));
+
20 return 0;
+
21}
+
bool isPalindrome(int number)
Check given number whether is palindrome number or not.
Definition: palindrome.c:29
+
+Here is the call graph for this function:
+
+
+
+
+
@@ -169,7 +201,7 @@ int 
diff --git a/df/d16/palindrome_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/df/d16/palindrome_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..4a1bbefba --- /dev/null +++ b/df/d16/palindrome_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/df/d16/palindrome_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/df/d16/palindrome_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..594ec8a9c --- /dev/null +++ b/df/d16/palindrome_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +f5433c99d19e484aa5f4fe789e08dc60 \ No newline at end of file diff --git a/df/d16/palindrome_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/df/d16/palindrome_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..b989be4ee --- /dev/null +++ b/df/d16/palindrome_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,37 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +isPalindrome + + + + + +Node1->Node2 + + + + + diff --git a/df/d1a/problem__21_2sol1_8c.html b/df/d1a/problem__21_2sol1_8c.html index 445ae853f..df2d6a7c6 100644 --- a/df/d1a/problem__21_2sol1_8c.html +++ b/df/d1a/problem__21_2sol1_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_21/sol1.c 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('df/d1a/problem__21_2sol1_8c.html','../
-
-
sol1.c File Reference
+
sol1.c File Reference
-

Problem 21 solution +

Problem 21 solution More...

#include <stdio.h>
#include <stdlib.h>
@@ -109,27 +108,162 @@ Include dependency graph for sol1.c:
- - - + + - - + +

+

Functions

-unsigned long sum_of_divisors (unsigned int N)
 function to return the sum of proper divisors of N
unsigned long sum_of_divisors (unsigned int N)
 function to return the sum of proper divisors of N More...
 
-int main (int argc, char **argv)
 Main function.
int main (int argc, char **argv)
 Main function. More...
 

Detailed Description

-

Problem 21 solution

-
Author
Krishna Vedala
-
+

Problem 21 solution

+
Author
Krishna Vedala
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char ** argv 
)
+
+ +

Main function.

+
37{
+
38 unsigned long sum = 0;
+
39 unsigned int MAX_N = 500;
+
40 if (argc == 2)
+
41 MAX_N = atoi(argv[1]);
+
42
+
43 /*
+
44 * We use an array of flags to check if a number at the index was:
+
45 * not-processed = 0
+
46 * is amicable = 1
+
47 * not amicable = -1
+
48 */
+
49 char *flags = (char *)calloc(MAX_N, sizeof(char));
+
50
+
51 clock_t start_time = clock();
+
52 int i;
+
53 /* there are no such numbers till 10. Lets search from there on */
+
54 for (i = 10; i < MAX_N; i++)
+
55 {
+
56 if (flags[i] != 0)
+
57 /* already processed, skip */
+
58 continue;
+
59
+
60 unsigned int b = sum_of_divisors(i);
+
61 if (b >= MAX_N)
+
62 flags[i] = -1;
+
63 else if (flags[b] == -1)
+
64 continue;
+
65
+
66 unsigned int c = sum_of_divisors(b);
+
67 if (c == i && b != i)
+
68 {
+
69 /* found amicable */
+
70 flags[b] = 1;
+
71 flags[i] = 1;
+
72 sum += b + i;
+
73#ifdef DEBUG
+
74 printf("Amicable: %4d : %4d\n", i, b);
+
75#endif
+
76 }
+
77 else
+
78 {
+
79 flags[i] = -1;
+
80 if (b < MAX_N)
+
81 flags[b] = -1;
+
82 }
+
83 }
+
84
+
85 clock_t end_time = clock();
+
86
+
87 printf("\nTime taken: %.4g millisecond\n",
+
88 1e3 * (end_time - start_time) / CLOCKS_PER_SEC);
+
89 printf("Sum of all numbers = %lu\n", sum);
+
90
+
91 free(flags);
+
92 return 0;
+
93}
+
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
+
#define calloc(elemCount, elemSize)
This macro replace the standard calloc function with calloc_dbg.
Definition: malloc_dbg.h:22
+
unsigned long sum_of_divisors(unsigned int N)
function to return the sum of proper divisors of N
Definition: sol1.c:13
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ sum_of_divisors()

+ +
+
+ + + + + + + + +
unsigned long sum_of_divisors (unsigned int N)
+
+ +

function to return the sum of proper divisors of N

+
14{
+
15 unsigned long sum = 1 + N; /* 1 and itself are always a divisor */
+
16 /* divisors are symmertically distributed about the square-root */
+
17 for (unsigned int i = 2; i * i < N; i++)
+
18 {
+
19 if ((N % i) != 0)
+
20 /* i is not a divisor of N */
+
21 continue;
+
22
+
23 // #ifdef DEBUG
+
24 // printf("%4d, %4d,", i, N / i);
+
25 // #endif
+
26
+
27 sum += i + (N / i);
+
28 }
+
29 // #ifdef DEBUG
+
30 // printf("\nSum of divisors of %4d: %4d\n", N, sum);
+
31 // #endif
+
32 return sum;
+
33}
+
+
+
+ diff --git a/df/d1a/problem__21_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map b/df/d1a/problem__21_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map new file mode 100644 index 000000000..efa9ec091 --- /dev/null +++ b/df/d1a/problem__21_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/df/d1a/problem__21_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 b/df/d1a/problem__21_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 new file mode 100644 index 000000000..f111b7f5d --- /dev/null +++ b/df/d1a/problem__21_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 @@ -0,0 +1 @@ +d6b54105e9bd72471145ee0b304fc1ca \ No newline at end of file diff --git a/df/d1a/problem__21_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg b/df/d1a/problem__21_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg new file mode 100644 index 000000000..df2c558e9 --- /dev/null +++ b/df/d1a/problem__21_2sol1_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg @@ -0,0 +1,37 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +sum_of_divisors + + + + + +Node1->Node2 + + + + + diff --git a/df/d23/struct__cantor__set__coll__graph.map b/df/d23/struct__cantor__set__coll__graph.map index 05e5615d2..95facce6e 100644 --- a/df/d23/struct__cantor__set__coll__graph.map +++ b/df/d23/struct__cantor__set__coll__graph.map @@ -1,3 +1,3 @@ - + diff --git a/df/d23/struct__cantor__set__coll__graph.svg b/df/d23/struct__cantor__set__coll__graph.svg index 52759c5ea..bfd59c877 100644 --- a/df/d23/struct__cantor__set__coll__graph.svg +++ b/df/d23/struct__cantor__set__coll__graph.svg @@ -1,29 +1,29 @@ - - + _cantor_set - + Node1 - -_cantor_set + +_cantor_set Node1->Node1 - - - next + + + next diff --git a/df/d27/alaw_8c.html b/df/d27/alaw_8c.html new file mode 100644 index 000000000..4040ff580 --- /dev/null +++ b/df/d27/alaw_8c.html @@ -0,0 +1,519 @@ + + + + + + + +Algorithms_in_C: audio/alaw.c File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Algorithms_in_C 1.0.0 +
+
Set of algorithms implemented in C.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
alaw.c File Reference
+
+
+ +

A-law algorithm for encoding and decoding (16bit pcm <=> a-law). This is the implementation of G.711 in C. +More...

+
#include <assert.h>
+#include <inttypes.h>
+#include <stdio.h>
+
+Include dependency graph for alaw.c:
+
+
+
+
+
+ + + + +

+Macros

#define LEN   ((size_t)8)
 Linear input code | Compressed code | Linear output code ---------------—+--------------—+----------------— s0000000abcdx | s000abcd | s0000000abcd1 s0000001abcdx | s001abcd | s0000001abcd1 s000001abcdxx | s010abcd | s000001abcd10 s00001abcdxxx | s011abcd | s00001abcd100 s0001abcdxxxx | s100abcd | s0001abcd1000 s001abcdxxxxx | s101abcd | s001abcd10000 s01abcdxxxxxx | s110abcd | s01abcd100000 s1abcdxxxxxxx | s111abcd | s1abcd1000000. More...
 
+ + + + + + + + + + + + + +

+Functions

void encode (uint8_t *out, int16_t *in, size_t len)
 16bit pcm to 8bit alaw More...
 
void decode (int16_t *out, uint8_t *in, size_t len)
 8bit alaw to 16bit pcm More...
 
static void test (int16_t *pcm, uint8_t *coded, int16_t *decoded, size_t len)
 Self-test implementations. More...
 
int main (int argc, char *argv[])
 Main function. More...
 
+ + + + + + + +

+Variables

+int16_t pcm [LEN] = {1000, -1000, 1234, 3200, -1314, 0, 32767, -32768}
 
+uint8_t r_coded [LEN] = {250, 122, 230, 156, 97, 213, 170, 42}
 
+int16_t r_decoded [LEN] = {1008, -1008, 1248, 3264, -1312, 8, 32256, -32256}
 
+

Detailed Description

+

A-law algorithm for encoding and decoding (16bit pcm <=> a-law). This is the implementation of G.711 in C.

+
Author
sunzhenliang
+

Macro Definition Documentation

+ +

◆ LEN

+ +
+
+ + + + +
#define LEN   ((size_t)8)
+
+ +

Linear input code | Compressed code | Linear output code ---------------—+--------------—+----------------— s0000000abcdx | s000abcd | s0000000abcd1 s0000001abcdx | s001abcd | s0000001abcd1 s000001abcdxx | s010abcd | s000001abcd10 s00001abcdxxx | s011abcd | s00001abcd100 s0001abcdxxxx | s100abcd | s0001abcd1000 s001abcdxxxxx | s101abcd | s001abcd10000 s01abcdxxxxxx | s110abcd | s01abcd100000 s1abcdxxxxxxx | s111abcd | s1abcd1000000.

+

Compressed code: (s | eee | abcd) for assert for appropriate size int types for IO operations

+ +
+
+

Function Documentation

+ +

◆ decode()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void decode (int16_t * out,
uint8_t * in,
size_t len 
)
+
+ +

8bit alaw to 16bit pcm

+
Parameters
+ + + + +
outsigned 16bit pcm array
inunsigned 8bit alaw array
lenlength of alaw array
+
+
+
Returns
void
+
108{
+
109 uint8_t alaw = 0;
+
110 int32_t pcm = 0;
+
111 int32_t sign = 0;
+
112 int32_t eee = 0;
+
113 for (size_t i = 0; i < len; i++)
+
114 {
+
115 alaw = *in++;
+
116
+
117 /* Re-toggle toggled bits */
+
118 alaw ^= 0xD5;
+
119
+
120 /* Get sign bit */
+
121 sign = alaw & 0x80;
+
122
+
123 /* Get eee bits */
+
124 eee = (alaw & 0x70) >> 4;
+
125
+
126 /* Get abcd bits and add 1/2 quantization step */
+
127 pcm = (alaw & 0x0f) << 4 | 8;
+
128
+
129 /* If quantization level > 0, there need `1` bit before abcd bits */
+
130 pcm += eee ? 0x100 : 0x0;
+
131
+
132 /* Left shift according quantization level */
+
133 pcm <<= eee > 1 ? (eee - 1) : 0;
+
134
+
135 /* Use the right sign */
+
136 *out++ = sign ? -pcm : pcm;
+
137 }
+
138}
+
+
+
+ +

◆ encode()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void encode (uint8_t * out,
int16_t * in,
size_t len 
)
+
+ +

16bit pcm to 8bit alaw

+
Parameters
+ + + + +
outunsigned 8bit alaw array
insigned 16bit pcm array
lenlength of pcm array
+
+
+
Returns
void
+
47{
+
48 uint8_t alaw = 0;
+
49 int16_t pcm = 0;
+
50 int32_t sign = 0;
+
51 int32_t abcd = 0;
+
52 int32_t eee = 0;
+
53 int32_t mask = 0;
+
54 for (size_t i = 0; i < len; i++)
+
55 {
+
56 pcm = *in++;
+
57 /* 0-7 kinds of quantization level from the table above */
+
58 eee = 7;
+
59 mask = 0x4000; /* 0x4000: '0b0100 0000 0000 0000' */
+
60
+
61 /* Get sign bit */
+
62 sign = (pcm & 0x8000) >> 8;
+
63
+
64 /* Turn negative pcm to positive */
+
65 /* The absolute value of a negative number may be larger than the size
+
66 * of the corresponding positive number, so here needs `-pcm -1` after
+
67 * taking the opposite number. */
+
68 pcm = sign ? (-pcm - 1) : pcm;
+
69
+
70 /* Get eee and abcd bit */
+
71 /* Use mask to locate the first `1` bit and quantization level at the
+
72 * same time */
+
73 while ((pcm & mask) == 0 && eee > 0)
+
74 {
+
75 eee--;
+
76 mask >>= 1;
+
77 }
+
78
+
79 /* The location of abcd bits is related with quantization level. Check
+
80 * the table above to determine how many bits to `>>` to get abcd */
+
81 abcd = (pcm >> (eee ? (eee + 3) : 4)) & 0x0f;
+
82
+
83 /* Put the quantization level number at right bit location to get eee
+
84 * bits */
+
85 eee <<= 4;
+
86
+
87 /* Splice results */
+
88 alaw = (sign | eee | abcd);
+
89
+
90 /* The standard specifies that all resulting even bits (LSB
+
91 * is even) are inverted before the octet is transmitted. This is to
+
92 * provide plenty of 0/1 transitions to facilitate the clock recovery
+
93 * process in the PCM receivers. Thus, a silent A-law encoded PCM
+
94 * channel has the 8 bit samples coded 0xD5 instead of 0x80 in the
+
95 * octets. (Reference from wiki above) */
+
96 *out++ = alaw ^ 0xD5;
+
97 }
+
98}
+
+
+
+ +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char * argv[] 
)
+
+ +

Main function.

+
Parameters
+ + + +
argccommandline argument count (ignored)
argvcommandline array of arguments (ignored)
+
+
+
Returns
0 on exit
+
176{
+
177 /* output alaw encoded by encode() */
+
178 uint8_t coded[LEN];
+
179
+
180 /* output pcm decoded by decode() from coded[LEN] */
+
181 int16_t decoded[LEN];
+
182
+
183 test(pcm, coded, decoded, LEN); // run self-test implementations
+
184
+
185 /* print test pcm inputs */
+
186 printf("inputs: ");
+
187 for (size_t i = 0; i < LEN; i++)
+
188 {
+
189 printf("%d ", pcm[i]);
+
190 }
+
191 printf("\n");
+
192
+
193 /* print encoded alaw */
+
194 printf("encode: ");
+
195 for (size_t i = 0; i < LEN; i++)
+
196 {
+
197 printf("%u ", coded[i]);
+
198 }
+
199 printf("\n");
+
200
+
201 /* print decoded pcm */
+
202 printf("decode: ");
+
203 for (size_t i = 0; i < LEN; i++)
+
204 {
+
205 printf("%d ", decoded[i]);
+
206 }
+
207 printf("\n");
+
208
+
209 /* It can be seen that the encoded alaw is smaller than the input PCM, so
+
210 * the purpose of compression is achieved. And the decoded PCM is almost the
+
211 * same as the original input PCM, which verifies the correctness of the
+
212 * decoding. The reason why it is not exactly the same is that there is
+
213 * precision loss during encode / decode. */
+
214
+
215 return 0;
+
216}
+
#define LEN
Linear input code | Compressed code | Linear output code ---------------—+--------------—+-----------...
Definition: alaw.c:28
+
static void test(int16_t *pcm, uint8_t *coded, int16_t *decoded, size_t len)
Self-test implementations.
Definition: alaw.c:148
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ test()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
static void test (int16_t * pcm,
uint8_t * coded,
int16_t * decoded,
size_t len 
)
+
+static
+
+ +

Self-test implementations.

+
Parameters
+ + + + + +
pcmsigned 16bit pcm array
codedunsigned 8bit alaw array
decodedsigned 16bit pcm array
lenlength of test array
+
+
+
Returns
void
+
149{
+
150 /* run encode */
+
151 encode(coded, pcm, len);
+
152
+
153 /* check encode result */
+
154 for (size_t i = 0; i < len; i++)
+
155 {
+
156 assert(coded[i] == r_coded[i]);
+
157 }
+
158
+
159 /* run decode */
+
160 decode(decoded, coded, len);
+
161
+
162 /* check decode result */
+
163 for (size_t i = 0; i < len; i++)
+
164 {
+
165 assert(decoded[i] == r_decoded[i]);
+
166 }
+
167}
+
void decode(int16_t *out, uint8_t *in, size_t len)
8bit alaw to 16bit pcm
Definition: alaw.c:107
+
void encode(uint8_t *out, int16_t *in, size_t len)
16bit pcm to 8bit alaw
Definition: alaw.c:46
+
+
+
+
+
+ + + + diff --git a/df/d27/alaw_8c.js b/df/d27/alaw_8c.js new file mode 100644 index 000000000..ca5d60dd3 --- /dev/null +++ b/df/d27/alaw_8c.js @@ -0,0 +1,8 @@ +var alaw_8c = +[ + [ "LEN", "df/d27/alaw_8c.html#a05b49c662c073f89e86804f7856622a0", null ], + [ "decode", "df/d27/alaw_8c.html#a093ac72124e3c2268d1150676e63175d", null ], + [ "encode", "df/d27/alaw_8c.html#a751d8e2c1975706e4d876316518c54c4", null ], + [ "main", "df/d27/alaw_8c.html#a0ddf1224851353fc92bfbff6f499fa97", null ], + [ "test", "df/d27/alaw_8c.html#a840bf13d2e4d75d38fb7bf3a655152f5", null ] +]; \ No newline at end of file diff --git a/df/d27/alaw_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map b/df/d27/alaw_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map new file mode 100644 index 000000000..648079a1d --- /dev/null +++ b/df/d27/alaw_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/df/d27/alaw_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 b/df/d27/alaw_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 new file mode 100644 index 000000000..f6fd28f80 --- /dev/null +++ b/df/d27/alaw_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 @@ -0,0 +1 @@ +8f436fda70cf3d76b9fb2c02a3dada5d \ No newline at end of file diff --git a/df/d27/alaw_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg b/df/d27/alaw_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg new file mode 100644 index 000000000..91accd44c --- /dev/null +++ b/df/d27/alaw_8c_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg @@ -0,0 +1,37 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +test + + + + + +Node1->Node2 + + + + + diff --git a/df/d29/problem__7_2sol_8c__incl.map b/df/d29/problem__7_2sol_8c__incl.map index db4e31ca8..fbf3e27a6 100644 --- a/df/d29/problem__7_2sol_8c__incl.map +++ b/df/d29/problem__7_2sol_8c__incl.map @@ -1,5 +1,5 @@ - - - + + + diff --git a/df/d29/problem__7_2sol_8c__incl.svg b/df/d29/problem__7_2sol_8c__incl.svg index a6f959277..e86cf4b08 100644 --- a/df/d29/problem__7_2sol_8c__incl.svg +++ b/df/d29/problem__7_2sol_8c__incl.svg @@ -1,21 +1,21 @@ - - + project_euler/problem_7/sol.c - + Node1 - + project_euler/problem -_7/sol.c +_7/sol.c @@ -23,31 +23,31 @@ Node2 - -stdio.h + +stdio.h Node1->Node2 - - + + Node3 - -stdlib.h + +stdlib.h Node1->Node3 - - + + diff --git a/df/d3b/binary__search_8c.html b/df/d3b/binary__search_8c.html index bce957c91..2c9f26f0b 100644 --- a/df/d3b/binary__search_8c.html +++ b/df/d3b/binary__search_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: searching/binary_search.c 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,23 +92,22 @@ $(document).ready(function(){initNavTree('df/d3b/binary__search_8c.html','../../
-
-
binary_search.c File Reference
+
binary_search.c File Reference
-

Program to perform binary search of a target value in a given sorted array. +

Program to perform binary search of a target value in a given sorted array. More...

#include <assert.h>
#include <stdio.h>
Include dependency graph for binary_search.c:
-
+
- @@ -116,22 +115,20 @@ Functions - - + + - - + +

+

Functions

int binarysearch1 (const int *arr, int l, int r, int x)
 Recursive implementation. More...
int binarysearch2 (const int *arr, int l, int r, int x)
 Iterative implementation. More...
 
-void test ()
 Test implementations.
void test ()
 Test implementations. More...
 
-int main (void)
 Main function.
int main (void)
 Main function. More...
 

Detailed Description

-

Program to perform binary search of a target value in a given sorted array.

-
Authors
James McDermott - recursive algorithm
+

Program to perform binary search of a target value in a given sorted array.

+
Authors
James McDermott - recursive algorithm
-Krishna Vedala - iterative algorithm
+Krishna Vedala - iterative algorithm

Function Documentation

- +

◆ binarysearch1()

@@ -182,31 +179,37 @@ int 
Returns
location of x assuming array arr[l..r] is present
-1 otherwise
-
22 {
-
23  if (r >= l)
-
24  {
-
25  int mid = l + (r - l) / 2;
-
26 
-
27  // If element is present at middle
-
28  if (arr[mid] == x)
-
29  return mid;
-
30 
-
31  // If element is smaller than middle
-
32  if (arr[mid] > x)
-
33  return binarysearch1(arr, l, mid - 1, x);
-
34 
-
35  // Else element is in right subarray
-
36  return binarysearch1(arr, mid + 1, r, x);
-
37  }
-
38 
-
39  // When element is not present in array
-
40  return -1;
-
41 }
+
22{
+
23 if (r >= l)
+
24 {
+
25 int mid = l + (r - l) / 2;
+
26
+
27 // If element is present at middle
+
28 if (arr[mid] == x)
+
29 return mid;
+
30
+
31 // If element is smaller than middle
+
32 if (arr[mid] > x)
+
33 return binarysearch1(arr, l, mid - 1, x);
+
34
+
35 // Else element is in right subarray
+
36 return binarysearch1(arr, mid + 1, r, x);
+
37 }
+
38
+
39 // When element is not present in array
+
40 return -1;
+
41}
int binarysearch1(const int *arr, int l, int r, int x)
Recursive implementation.
Definition: binary_search.c:21
-
+
+Here is the call graph for this function:
+
+
- + +
+
+

◆ binarysearch2()

@@ -257,28 +260,113 @@ int 
Returns
location of x assuming array arr[l..r] is present
-1 otherwise
-
52 {
-
53  int mid = l + (r - l) / 2;
-
54 
-
55  while (arr[mid] != x)
-
56  {
-
57  if (r <= l || r < 0)
-
58  return -1;
-
59 
-
60  if (arr[mid] > x)
-
61  // If element is smaller than middle
-
62  r = mid - 1;
-
63  else
-
64  // Else element is in right subarray
-
65  l = mid + 1;
-
66 
-
67  mid = l + (r - l) / 2;
-
68  }
-
69 
-
70  // When element is not present in array
-
71  return mid;
-
72 }
+
52{
+
53 int mid = l + (r - l) / 2;
+
54
+
55 while (arr[mid] != x)
+
56 {
+
57 if (r <= l || r < 0)
+
58 return -1;
+
59
+
60 if (arr[mid] > x)
+
61 // If element is smaller than middle
+
62 r = mid - 1;
+
63 else
+
64 // Else element is in right subarray
+
65 l = mid + 1;
+
66
+
67 mid = l + (r - l) / 2;
+
68 }
+
69
+
70 // When element is not present in array
+
71 return mid;
+
72}
+
+
+ +

◆ main()

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

Main function.

+
106{
+
107 test();
+
108 return 0;
+
109}
+
void test()
Test implementations.
Definition: binary_search.c:75
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ test()

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

Test implementations.

+
76{
+
77 // give function an array to work with
+
78 int arr[] = {2, 3, 4, 10, 40};
+
79 // get size of array
+
80 int n = sizeof(arr) / sizeof(arr[0]);
+
81
+
82 printf("Test 1.... ");
+
83 // set value to look for
+
84 int x = 10;
+
85 // set result to what is returned from binarysearch
+
86 int result = binarysearch1(arr, 0, n - 1, x);
+
87 assert(result == 3);
+
88 printf("passed recursive... ");
+
89 result = binarysearch2(arr, 0, n - 1, x);
+
90 assert(result == 3);
+
91 printf("passed iterative...\n");
+
92
+
93 printf("Test 2.... ");
+
94 x = 5;
+
95 // set result to what is returned from binarysearch
+
96 result = binarysearch1(arr, 0, n - 1, x);
+
97 assert(result == -1);
+
98 printf("passed recursive... ");
+
99 result = binarysearch2(arr, 0, n - 1, x);
+
100 assert(result == -1);
+
101 printf("passed iterative...\n");
+
102}
+
int binarysearch2(const int *arr, int l, int r, int x)
Iterative implementation.
Definition: binary_search.c:51
+
+Here is the call graph for this function:
+
+
+
+
+
@@ -287,7 +375,7 @@ int  diff --git a/df/d3b/binary__search_8c_a40855c608ca64048d04cff6526f0a582_cgraph.map b/df/d3b/binary__search_8c_a40855c608ca64048d04cff6526f0a582_cgraph.map new file mode 100644 index 000000000..0b30ccb0a --- /dev/null +++ b/df/d3b/binary__search_8c_a40855c608ca64048d04cff6526f0a582_cgraph.map @@ -0,0 +1,3 @@ + + + diff --git a/df/d3b/binary__search_8c_a40855c608ca64048d04cff6526f0a582_cgraph.md5 b/df/d3b/binary__search_8c_a40855c608ca64048d04cff6526f0a582_cgraph.md5 new file mode 100644 index 000000000..e5d11538e --- /dev/null +++ b/df/d3b/binary__search_8c_a40855c608ca64048d04cff6526f0a582_cgraph.md5 @@ -0,0 +1 @@ +8610a3528189d032dd1da8b93ad33c3b \ No newline at end of file diff --git a/df/d3b/binary__search_8c_a40855c608ca64048d04cff6526f0a582_cgraph.svg b/df/d3b/binary__search_8c_a40855c608ca64048d04cff6526f0a582_cgraph.svg new file mode 100644 index 000000000..f263d7b67 --- /dev/null +++ b/df/d3b/binary__search_8c_a40855c608ca64048d04cff6526f0a582_cgraph.svg @@ -0,0 +1,28 @@ + + + + + + +binarysearch1 + + + +Node1 + + +binarysearch1 + + + + + +Node1->Node1 + + + + + diff --git a/df/d3b/binary__search_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map b/df/d3b/binary__search_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map new file mode 100644 index 000000000..0fba8639c --- /dev/null +++ b/df/d3b/binary__search_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/df/d3b/binary__search_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.md5 b/df/d3b/binary__search_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.md5 new file mode 100644 index 000000000..1bae799b1 --- /dev/null +++ b/df/d3b/binary__search_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.md5 @@ -0,0 +1 @@ +c0577c9edb9c9c82a0d010b27bf580f5 \ No newline at end of file diff --git a/df/d3b/binary__search_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg b/df/d3b/binary__search_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg new file mode 100644 index 000000000..df4a6d454 --- /dev/null +++ b/df/d3b/binary__search_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg @@ -0,0 +1,73 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +test + + + + + +Node1->Node2 + + + + + +Node3 + + +binarysearch1 + + + + + +Node2->Node3 + + + + + +Node4 + + +binarysearch2 + + + + + +Node2->Node4 + + + + + +Node3->Node3 + + + + + diff --git a/df/d3b/binary__search_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.map b/df/d3b/binary__search_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.map new file mode 100644 index 000000000..88d607b7f --- /dev/null +++ b/df/d3b/binary__search_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/df/d3b/binary__search_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.md5 b/df/d3b/binary__search_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.md5 new file mode 100644 index 000000000..c23448913 --- /dev/null +++ b/df/d3b/binary__search_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.md5 @@ -0,0 +1 @@ +6fe6b5f359871e3273eaffe7b717d18a \ No newline at end of file diff --git a/df/d3b/binary__search_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg b/df/d3b/binary__search_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg new file mode 100644 index 000000000..8a407a5e3 --- /dev/null +++ b/df/d3b/binary__search_8c_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg @@ -0,0 +1,58 @@ + + + + + + +test + + + +Node1 + + +test + + + + + +Node2 + + +binarysearch1 + + + + + +Node1->Node2 + + + + + +Node3 + + +binarysearch2 + + + + + +Node1->Node3 + + + + + +Node2->Node2 + + + + + diff --git a/df/d3c/threaded__binary__trees_8c.html b/df/d3c/threaded__binary__trees_8c.html index b123d64a8..b1b3a2c70 100644 --- a/df/d3c/threaded__binary__trees_8c.html +++ b/df/d3c/threaded__binary__trees_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: data_structures/binary_trees/threaded_binary_trees.c 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('df/d3c/threaded__binary__trees_8c.html Data Structures | Typedefs | Functions -
-
threaded_binary_trees.c File Reference
+
threaded_binary_trees.c File Reference
@@ -106,74 +105,69 @@ $(document).ready(function(){initNavTree('df/d3c/threaded__binary__trees_8c.html
Include dependency graph for threaded_binary_trees.c:
-
+
-

+

Data Structures

struct  Node
 Node, the basic data structure of the tree. More...
 
- - +

+

Typedefs

-typedef struct Node node
+typedef struct Node node
 Node, the basic data structure of the tree.
 
- - - - - - + + + + + - - + + - - + + - - + + - - + +

+

Functions

node * create_node (int data)
 creates a new node param[in] data value to be inserted More...
 
-void insert_bt (node **root, int data)
 inserts a node into the tree param[in,out] root pointer to node pointer to the topmost node of the tree param[in] data value to be inserted into the tree
node * create_node (int data)
 creates a new node param[in] data value to be inserted More...
 
void insert_bt (node **root, int data)
 inserts a node into the tree param[in,out] root pointer to node pointer to the topmost node of the tree param[in] data value to be inserted into the tree More...
 
void search (node *root, int ele)
 searches for the element More...
 
-void inorder_display (node *curr)
 performs inorder traversal param[in] curr node pointer to the topmost node of the tree
void inorder_display (node *curr)
 performs inorder traversal param[in] curr node pointer to the topmost node of the tree More...
 
-void postorder_display (node *curr)
 performs postorder traversal param[in] curr node pointer to the topmost node of the tree
void postorder_display (node *curr)
 performs postorder traversal param[in] curr node pointer to the topmost node of the tree More...
 
-void preorder_display (node *curr)
 performs preorder traversal param[in] curr node pointer to the topmost node of the tree
void preorder_display (node *curr)
 performs preorder traversal param[in] curr node pointer to the topmost node of the tree More...
 
void delete_bt (node **root, int ele)
 deletion of a node from the tree if the node isn't present in the tree, it takes no action. More...
 
-int main ()
 main function
int main ()
 main function More...
 

Detailed Description

-

This file is a simple implementation of a Threaded Binary Tree.

-

Threaded Binary Tree is a binary tree variant in which all left child pointers that are NULL (in Linked list representation) point to its in-order predecessor, and all right child pointers that are NULL (in Linked list representation) point to its in-order successor. It has the following functionalities:

    +

    This file is a simple implementation of a Threaded Binary Tree.

    +

    Threaded Binary Tree is a binary tree variant in which all left child pointers that are NULL (in Linked list representation) point to its in-order predecessor, and all right child pointers that are NULL (in Linked list representation) point to its in-order successor. It has the following functionalities:

    • Insertion
    • Search
    • Deletion
    • Listing of node keys inorder,preorder,postorder
    -

    -see binary_search_tree.c

    -
    Author
    Amitha Nayak
    +

    -see binary_search_tree.c

    +
    Author
    Amitha Nayak

    Function Documentation

    - -

    ◆ create_node()

    + +

    ◆ create_node()

    - + @@ -184,12 +178,12 @@ int  @@ -42,21 +41,22 @@
    node* create_node node * create_node ( int  data)
    Returns
    a pointer to the new node
    -
    39 {
    -
    40  node *ptr = (node *)malloc(sizeof(node));
    -
    41  ptr->rlink = ptr->llink = NULL;
    -
    42  ptr->data = data;
    -
    43  return ptr;
    -
    44 }
    +
    39{
    +
    40 node *ptr = (node *)malloc(sizeof(node));
    +
    41 ptr->rlink = ptr->llink = NULL;
    +
    42 ptr->data = data;
    +
    43 return ptr;
    +
    44}
    #define malloc(bytes)
    This macro replace the standard malloc function with malloc_dbg.
    Definition: malloc_dbg.h:18
    Definition: prime_factoriziation.c:25
    Node, the basic data structure in the tree.
    Definition: binary_search_tree.c:15
    @@ -197,7 +191,7 @@ int 
    +

    ◆ delete_bt()

    @@ -224,89 +218,348 @@ int 

    deletion of a node from the tree if the node isn't present in the tree, it takes no action.

    -

    param[in,out] root pointer to node pointer to the topmost node of the tree param[in] ele value to be deleted from the tree

    -
    174 {
    -
    175  node *temp;
    -
    176  node *prev;
    -
    177  if (*root == NULL)
    -
    178  return;
    -
    179  else
    -
    180  {
    -
    181  temp = *root;
    -
    182  prev = NULL;
    -
    183  // search
    -
    184  while (temp != NULL)
    -
    185  {
    -
    186  if (temp->data == ele)
    -
    187  {
    -
    188  break;
    -
    189  }
    -
    190  else if (ele > temp->data)
    -
    191  {
    -
    192  prev = temp;
    -
    193  temp = temp->rlink;
    -
    194  }
    -
    195  else
    -
    196  {
    -
    197  prev = temp;
    -
    198  temp = temp->llink;
    -
    199  }
    -
    200  }
    -
    201  }
    -
    202 
    -
    203  if (temp == NULL)
    -
    204  return;
    -
    205  else
    -
    206  {
    -
    207  node *replacement; // deleted node's replacement
    -
    208  node *t;
    -
    209  if (temp->llink == NULL && temp->rlink == NULL)
    -
    210  {
    -
    211  replacement = NULL;
    -
    212  }
    -
    213  else if (temp->llink == NULL && temp->rlink != NULL)
    -
    214  {
    -
    215  replacement = temp->rlink;
    -
    216  }
    -
    217  else if (temp->llink != NULL && temp->rlink == NULL)
    -
    218  {
    -
    219  replacement = temp->llink;
    -
    220  }
    -
    221  else
    -
    222  {
    -
    223  replacement = temp->rlink; // replaced with inorder successor
    -
    224  t = replacement;
    -
    225  while (t->llink != NULL)
    -
    226  {
    -
    227  t = t->llink;
    -
    228  }
    -
    229  t->llink =
    -
    230  temp->llink; // leftmost node of the replacement is linked to
    -
    231  // the left child of the deleted node
    -
    232  }
    -
    233 
    -
    234  if (temp == *root)
    -
    235  {
    -
    236  free(*root);
    -
    237  *root = replacement;
    -
    238  }
    -
    239  else if (prev->llink == temp)
    -
    240  {
    -
    241  free(prev->llink);
    -
    242  prev->llink = replacement;
    -
    243  }
    -
    244  else if (prev->rlink == temp)
    -
    245  {
    -
    246  free(prev->rlink);
    -
    247  prev->rlink = replacement;
    -
    248  }
    -
    249  }
    -
    250 }
    +

    param[in,out] root pointer to node pointer to the topmost node of the tree param[in] ele value to be deleted from the tree

    +
    174{
    +
    175 node *temp;
    +
    176 node *prev;
    +
    177 if (*root == NULL)
    +
    178 return;
    +
    179 else
    +
    180 {
    +
    181 temp = *root;
    +
    182 prev = NULL;
    +
    183 // search
    +
    184 while (temp != NULL)
    +
    185 {
    +
    186 if (temp->data == ele)
    +
    187 {
    +
    188 break;
    +
    189 }
    +
    190 else if (ele > temp->data)
    +
    191 {
    +
    192 prev = temp;
    +
    193 temp = temp->rlink;
    +
    194 }
    +
    195 else
    +
    196 {
    +
    197 prev = temp;
    +
    198 temp = temp->llink;
    +
    199 }
    +
    200 }
    +
    201 }
    +
    202
    +
    203 if (temp == NULL)
    +
    204 return;
    +
    205 else
    +
    206 {
    +
    207 node *replacement; // deleted node's replacement
    +
    208 node *t;
    +
    209 if (temp->llink == NULL && temp->rlink == NULL)
    +
    210 {
    +
    211 replacement = NULL;
    +
    212 }
    +
    213 else if (temp->llink == NULL && temp->rlink != NULL)
    +
    214 {
    +
    215 replacement = temp->rlink;
    +
    216 }
    +
    217 else if (temp->llink != NULL && temp->rlink == NULL)
    +
    218 {
    +
    219 replacement = temp->llink;
    +
    220 }
    +
    221 else
    +
    222 {
    +
    223 replacement = temp->rlink; // replaced with inorder successor
    +
    224 t = replacement;
    +
    225 while (t->llink != NULL)
    +
    226 {
    +
    227 t = t->llink;
    +
    228 }
    +
    229 t->llink =
    +
    230 temp->llink; // leftmost node of the replacement is linked to
    +
    231 // the left child of the deleted node
    +
    232 }
    +
    233
    +
    234 if (temp == *root)
    +
    235 {
    +
    236 free(*root);
    +
    237 *root = replacement;
    +
    238 }
    +
    239 else if (prev->llink == temp)
    +
    240 {
    +
    241 free(prev->llink);
    +
    242 prev->llink = replacement;
    +
    243 }
    +
    244 else if (prev->rlink == temp)
    +
    245 {
    +
    246 free(prev->rlink);
    +
    247 prev->rlink = replacement;
    +
    248 }
    +
    249 }
    +
    250}
    #define free(ptr)
    This macro replace the standard free function with free_dbg.
    Definition: malloc_dbg.h:26
    - + +

    ◆ inorder_display()

    + +
    +
    + + + + + + + + +
    void inorder_display (node * curr)
    +
    + +

    performs inorder traversal param[in] curr node pointer to the topmost node of the tree

    +
    130{
    +
    131 if (curr != NULL)
    +
    132 {
    +
    133 inorder_display(curr->llink);
    +
    134 printf("%d\t", curr->data);
    +
    135 inorder_display(curr->rlink);
    +
    136 }
    +
    137}
    +
    void inorder_display(node *curr)
    performs inorder traversal param[in] curr node pointer to the topmost node of the tree
    Definition: threaded_binary_trees.c:129
    +
    +Here is the call graph for this function:
    +
    +
    +
    +
    + +
    +
    + +

    ◆ insert_bt()

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    void insert_bt (node ** root,
    int data 
    )
    +
    + +

    inserts a node into the tree param[in,out] root pointer to node pointer to the topmost node of the tree param[in] data value to be inserted into the tree

    +
    52{
    +
    53 node *new_node = create_node(data);
    +
    54 node *temp; // to be deleted
    +
    55 node *prev; // keeps track of the parent of the element deleted
    +
    56 if (*root == NULL)
    +
    57 {
    +
    58 *root = new_node;
    +
    59 }
    +
    60 else
    +
    61 {
    +
    62 temp = *root;
    +
    63 prev = NULL;
    +
    64 while (temp != NULL)
    +
    65 {
    +
    66 if (new_node->data > temp->data)
    +
    67 {
    +
    68 prev = temp;
    +
    69 temp = temp->rlink;
    +
    70 }
    +
    71 else if (new_node->data < temp->data)
    +
    72 {
    +
    73 prev = temp;
    +
    74 temp = temp->llink;
    +
    75 }
    +
    76 else
    +
    77 {
    +
    78 return;
    +
    79 }
    +
    80 }
    +
    81
    +
    82 if (new_node->data > prev->data)
    +
    83 {
    +
    84 prev->rlink = new_node;
    +
    85 }
    +
    86 else
    +
    87 {
    +
    88 prev->llink = new_node;
    +
    89 }
    +
    90 }
    +
    91}
    +
    node * create_node(int data)
    creates a new node param[in] data value to be inserted
    Definition: threaded_binary_trees.c:38
    +
    +Here is the call graph for this function:
    +
    +
    +
    +
    + +
    +
    + +

    ◆ main()

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

    main function

    +
    256{
    +
    257 printf("BINARY THREADED TREE: \n");
    +
    258 node *root = NULL;
    +
    259 int choice, n;
    +
    260 do
    +
    261 {
    +
    262 printf("%s\n", "1. Insert into BT");
    +
    263 printf("%s\n", "2. Print BT - inorder");
    +
    264 printf("%s\n", "3. Print BT - preorder");
    +
    265 printf("%s\n", "4. print BT - postorder");
    +
    266 printf("%s\n", "5. delete from BT");
    +
    267 printf("%s\n", "6. search in BT");
    +
    268 printf("%s\n", "Type 0 to exit");
    +
    269 scanf("%d", &choice);
    +
    270
    +
    271 switch (choice)
    +
    272 {
    +
    273 case 1:
    +
    274 printf("%s\n", "Enter a no:");
    +
    275 scanf("%d", &n);
    +
    276 insert_bt(&root, n);
    +
    277 break;
    +
    278 case 2:
    +
    279 inorder_display(root);
    +
    280 printf("\n");
    +
    281 break;
    +
    282 case 3:
    +
    283 preorder_display(root);
    +
    284 printf("\n");
    +
    285 break;
    +
    286 case 4:
    +
    287 postorder_display(root);
    +
    288 printf("\n");
    +
    289 break;
    +
    290 case 5:
    +
    291 printf("%s\n", "Enter a no:");
    +
    292 scanf("%d", &n);
    +
    293 delete_bt(&root, n);
    +
    294 break;
    +
    295 case 6:
    +
    296 printf("%s\n", "Enter a no:");
    +
    297 scanf("%d", &n);
    +
    298 search(root, n);
    +
    299 break;
    +
    300 }
    +
    301 } while (choice != 0);
    +
    302 return 0;
    +
    303}
    +
    void delete_bt(node **root, int ele)
    deletion of a node from the tree if the node isn't present in the tree, it takes no action.
    Definition: threaded_binary_trees.c:173
    +
    void search(node *root, int ele)
    searches for the element
    Definition: threaded_binary_trees.c:98
    +
    void postorder_display(node *curr)
    performs postorder traversal param[in] curr node pointer to the topmost node of the tree
    Definition: threaded_binary_trees.c:143
    +
    void preorder_display(node *curr)
    performs preorder traversal param[in] curr node pointer to the topmost node of the tree
    Definition: threaded_binary_trees.c:157
    +
    void insert_bt(node **root, int data)
    inserts a node into the tree param[in,out] root pointer to node pointer to the topmost node of the tr...
    Definition: threaded_binary_trees.c:51
    +
    +Here is the call graph for this function:
    +
    +
    +
    +
    + +
    +
    + +

    ◆ postorder_display()

    + +
    +
    + + + + + + + + +
    void postorder_display (node * curr)
    +
    + +

    performs postorder traversal param[in] curr node pointer to the topmost node of the tree

    +
    144{
    +
    145 if (curr != NULL)
    +
    146 {
    +
    147 postorder_display(curr->llink);
    +
    148 postorder_display(curr->rlink);
    +
    149 printf("%d\t", curr->data);
    +
    150 }
    +
    151}
    +
    +Here is the call graph for this function:
    +
    +
    +
    +
    + +
    +
    + +

    ◆ preorder_display()

    + +
    +
    + + + + + + + + +
    void preorder_display (node * curr)
    +
    + +

    performs preorder traversal param[in] curr node pointer to the topmost node of the tree

    +
    158{
    +
    159 if (curr != NULL)
    +
    160 {
    +
    161 printf("%d\t", curr->data);
    +
    162 preorder_display(curr->llink);
    +
    163 preorder_display(curr->rlink);
    +
    164 }
    +
    165}
    +
    +Here is the call graph for this function:
    +
    +
    +
    +
    + +
    +
    +

    ◆ search()

    @@ -340,31 +593,31 @@ int 
    99 {
    -
    100  node *temp = root;
    -
    101  while (temp != NULL)
    -
    102  {
    -
    103  if (temp->data == ele)
    -
    104  {
    -
    105  break;
    -
    106  }
    -
    107  else if (ele > temp->data)
    -
    108  {
    -
    109  temp = temp->rlink;
    -
    110  }
    -
    111  else
    -
    112  {
    -
    113  temp = temp->llink;
    -
    114  }
    -
    115  }
    -
    116 
    -
    117  if (temp == NULL)
    -
    118  {
    -
    119  printf("%s\n", "Element not found.");
    -
    120  }
    -
    121  else
    -
    122  printf("%s\n", "Element found.");
    -
    123 }
    +
    99{
    +
    100 node *temp = root;
    +
    101 while (temp != NULL)
    +
    102 {
    +
    103 if (temp->data == ele)
    +
    104 {
    +
    105 break;
    +
    106 }
    +
    107 else if (ele > temp->data)
    +
    108 {
    +
    109 temp = temp->rlink;
    +
    110 }
    +
    111 else
    +
    112 {
    +
    113 temp = temp->llink;
    +
    114 }
    +
    115 }
    +
    116
    +
    117 if (temp == NULL)
    +
    118 {
    +
    119 printf("%s\n", "Element not found.");
    +
    120 }
    +
    121 else
    +
    122 printf("%s\n", "Element found.");
    +
    123}
    @@ -374,7 +627,7 @@ int 
    diff --git a/df/d3c/threaded__binary__trees_8c.js b/df/d3c/threaded__binary__trees_8c.js index 95c7c90bd..c357c542b 100644 --- a/df/d3c/threaded__binary__trees_8c.js +++ b/df/d3c/threaded__binary__trees_8c.js @@ -2,7 +2,7 @@ var threaded__binary__trees_8c = [ [ "Node", "db/d8b/struct_node.html", "db/d8b/struct_node" ], [ "node", "df/d3c/threaded__binary__trees_8c.html#ad8ecdcce462dd8e170ae1f164935aaa6", null ], - [ "create_node", "df/d3c/threaded__binary__trees_8c.html#ab21d1d36d95001defbca2f6abd4d410c", null ], + [ "create_node", "df/d3c/threaded__binary__trees_8c.html#a4802bca3f38251543b4aba6765e0390d", null ], [ "delete_bt", "df/d3c/threaded__binary__trees_8c.html#a284d683f74b6c884e79ba00d3d1c3317", null ], [ "inorder_display", "df/d3c/threaded__binary__trees_8c.html#a4c1e06b5f0876ec9c1bd6817f3b7eda7", null ], [ "insert_bt", "df/d3c/threaded__binary__trees_8c.html#a823432888332fc9f0aa6072cff28c3bb", null ], diff --git a/df/d3c/threaded__binary__trees_8c_a4c1e06b5f0876ec9c1bd6817f3b7eda7_cgraph.map b/df/d3c/threaded__binary__trees_8c_a4c1e06b5f0876ec9c1bd6817f3b7eda7_cgraph.map new file mode 100644 index 000000000..b4b2317d9 --- /dev/null +++ b/df/d3c/threaded__binary__trees_8c_a4c1e06b5f0876ec9c1bd6817f3b7eda7_cgraph.map @@ -0,0 +1,3 @@ + + + diff --git a/df/d3c/threaded__binary__trees_8c_a4c1e06b5f0876ec9c1bd6817f3b7eda7_cgraph.md5 b/df/d3c/threaded__binary__trees_8c_a4c1e06b5f0876ec9c1bd6817f3b7eda7_cgraph.md5 new file mode 100644 index 000000000..e46ea07c7 --- /dev/null +++ b/df/d3c/threaded__binary__trees_8c_a4c1e06b5f0876ec9c1bd6817f3b7eda7_cgraph.md5 @@ -0,0 +1 @@ +9ce5d7ae27130dc81fd10414cd53d88c \ No newline at end of file diff --git a/df/d3c/threaded__binary__trees_8c_a4c1e06b5f0876ec9c1bd6817f3b7eda7_cgraph.svg b/df/d3c/threaded__binary__trees_8c_a4c1e06b5f0876ec9c1bd6817f3b7eda7_cgraph.svg new file mode 100644 index 000000000..050493a34 --- /dev/null +++ b/df/d3c/threaded__binary__trees_8c_a4c1e06b5f0876ec9c1bd6817f3b7eda7_cgraph.svg @@ -0,0 +1,28 @@ + + + + + + +inorder_display + + + +Node1 + + +inorder_display + + + + + +Node1->Node1 + + + + + diff --git a/df/d3c/threaded__binary__trees_8c_a5a82ae0ee13788be51ca4ba6cddb0719_cgraph.map b/df/d3c/threaded__binary__trees_8c_a5a82ae0ee13788be51ca4ba6cddb0719_cgraph.map new file mode 100644 index 000000000..1a4248bd2 --- /dev/null +++ b/df/d3c/threaded__binary__trees_8c_a5a82ae0ee13788be51ca4ba6cddb0719_cgraph.map @@ -0,0 +1,3 @@ + + + diff --git a/df/d3c/threaded__binary__trees_8c_a5a82ae0ee13788be51ca4ba6cddb0719_cgraph.md5 b/df/d3c/threaded__binary__trees_8c_a5a82ae0ee13788be51ca4ba6cddb0719_cgraph.md5 new file mode 100644 index 000000000..53c28f7d6 --- /dev/null +++ b/df/d3c/threaded__binary__trees_8c_a5a82ae0ee13788be51ca4ba6cddb0719_cgraph.md5 @@ -0,0 +1 @@ +a7491ec141c20f4286965daa7476319e \ No newline at end of file diff --git a/df/d3c/threaded__binary__trees_8c_a5a82ae0ee13788be51ca4ba6cddb0719_cgraph.svg b/df/d3c/threaded__binary__trees_8c_a5a82ae0ee13788be51ca4ba6cddb0719_cgraph.svg new file mode 100644 index 000000000..e8cf887b2 --- /dev/null +++ b/df/d3c/threaded__binary__trees_8c_a5a82ae0ee13788be51ca4ba6cddb0719_cgraph.svg @@ -0,0 +1,28 @@ + + + + + + +postorder_display + + + +Node1 + + +postorder_display + + + + + +Node1->Node1 + + + + + diff --git a/df/d3c/threaded__binary__trees_8c_a8169ba0dfd5b8183672e444d1434bf9c_cgraph.map b/df/d3c/threaded__binary__trees_8c_a8169ba0dfd5b8183672e444d1434bf9c_cgraph.map new file mode 100644 index 000000000..1f7091605 --- /dev/null +++ b/df/d3c/threaded__binary__trees_8c_a8169ba0dfd5b8183672e444d1434bf9c_cgraph.map @@ -0,0 +1,3 @@ + + + diff --git a/df/d3c/threaded__binary__trees_8c_a8169ba0dfd5b8183672e444d1434bf9c_cgraph.md5 b/df/d3c/threaded__binary__trees_8c_a8169ba0dfd5b8183672e444d1434bf9c_cgraph.md5 new file mode 100644 index 000000000..81a0326f6 --- /dev/null +++ b/df/d3c/threaded__binary__trees_8c_a8169ba0dfd5b8183672e444d1434bf9c_cgraph.md5 @@ -0,0 +1 @@ +7e4971c5b22188bdb2113fdd20eb93a2 \ No newline at end of file diff --git a/df/d3c/threaded__binary__trees_8c_a8169ba0dfd5b8183672e444d1434bf9c_cgraph.svg b/df/d3c/threaded__binary__trees_8c_a8169ba0dfd5b8183672e444d1434bf9c_cgraph.svg new file mode 100644 index 000000000..e3750126a --- /dev/null +++ b/df/d3c/threaded__binary__trees_8c_a8169ba0dfd5b8183672e444d1434bf9c_cgraph.svg @@ -0,0 +1,28 @@ + + + + + + +preorder_display + + + +Node1 + + +preorder_display + + + + + +Node1->Node1 + + + + + diff --git a/df/d3c/threaded__binary__trees_8c_a823432888332fc9f0aa6072cff28c3bb_cgraph.map b/df/d3c/threaded__binary__trees_8c_a823432888332fc9f0aa6072cff28c3bb_cgraph.map new file mode 100644 index 000000000..55352ef63 --- /dev/null +++ b/df/d3c/threaded__binary__trees_8c_a823432888332fc9f0aa6072cff28c3bb_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/df/d3c/threaded__binary__trees_8c_a823432888332fc9f0aa6072cff28c3bb_cgraph.md5 b/df/d3c/threaded__binary__trees_8c_a823432888332fc9f0aa6072cff28c3bb_cgraph.md5 new file mode 100644 index 000000000..6daf73f4a --- /dev/null +++ b/df/d3c/threaded__binary__trees_8c_a823432888332fc9f0aa6072cff28c3bb_cgraph.md5 @@ -0,0 +1 @@ +58c0e10780a1ee14e3717d4b228d7f74 \ No newline at end of file diff --git a/df/d3c/threaded__binary__trees_8c_a823432888332fc9f0aa6072cff28c3bb_cgraph.svg b/df/d3c/threaded__binary__trees_8c_a823432888332fc9f0aa6072cff28c3bb_cgraph.svg new file mode 100644 index 000000000..e8eca67ea --- /dev/null +++ b/df/d3c/threaded__binary__trees_8c_a823432888332fc9f0aa6072cff28c3bb_cgraph.svg @@ -0,0 +1,37 @@ + + + + + + +insert_bt + + + +Node1 + + +insert_bt + + + + + +Node2 + + +create_node + + + + + +Node1->Node2 + + + + + diff --git a/df/d3c/threaded__binary__trees_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/df/d3c/threaded__binary__trees_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..6b1ee31b2 --- /dev/null +++ b/df/d3c/threaded__binary__trees_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/df/d3c/threaded__binary__trees_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/df/d3c/threaded__binary__trees_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..c1d8239f1 --- /dev/null +++ b/df/d3c/threaded__binary__trees_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +0193c62034ed7ee950416d9e1331159e \ No newline at end of file diff --git a/df/d3c/threaded__binary__trees_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/df/d3c/threaded__binary__trees_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..2e92bfa7c --- /dev/null +++ b/df/d3c/threaded__binary__trees_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,145 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +delete_bt + + + + + +Node1->Node2 + + + + + +Node3 + + +inorder_display + + + + + +Node1->Node3 + + + + + +Node4 + + +insert_bt + + + + + +Node1->Node4 + + + + + +Node6 + + +postorder_display + + + + + +Node1->Node6 + + + + + +Node7 + + +preorder_display + + + + + +Node1->Node7 + + + + + +Node8 + + +search + + + + + +Node1->Node8 + + + + + +Node3->Node3 + + + + + +Node5 + + +create_node + + + + + +Node4->Node5 + + + + + +Node6->Node6 + + + + + +Node7->Node7 + + + + + diff --git a/df/d43/postfix__evaluation_8c.html b/df/d43/postfix__evaluation_8c.html new file mode 100644 index 000000000..ea4eb502b --- /dev/null +++ b/df/d43/postfix__evaluation_8c.html @@ -0,0 +1,393 @@ + + + + + + + +Algorithms_in_C: misc/postfix_evaluation.c File Reference + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Algorithms_in_C 1.0.0 +
    +
    Set of algorithms implemented in C.
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    postfix_evaluation.c File Reference
    +
    +
    + +

    Postfix evaluation algorithm implementation +More...

    +
    #include <stdio.h>
    +#include <string.h>
    +#include <ctype.h>
    +#include <stdlib.h>
    +#include <stdint.h>
    +#include <assert.h>
    +
    +Include dependency graph for postfix_evaluation.c:
    +
    +
    +
    +
    +
    + + + + +

    +Data Structures

    struct  Stack
     for printf() and scanf() More...
     
    + + + + + + + + + + + + + + + + +

    +Functions

    void push (int8_t opd)
     Function to push on the stack. More...
     
    int8_t pop ()
     Function to pop from the stack. More...
     
    int8_t evaluate (char post[])
     Function to evaluate postfix expression. More...
     
    static void test ()
     Self-test implementations. More...
     
    int main ()
     Main function. More...
     
    + + + + +

    +Variables

    +struct Stack st
     global declaration of stack st
     
    +

    Detailed Description

    +

    Postfix evaluation algorithm implementation

    +

    The input postfix expression is of type string upto 49 characters (including space delimiters). Supported operations- '+', '-', '/', '*', ''

    Author
    Kumar Yash
    +

    Function Documentation

    + +

    ◆ evaluate()

    + +
    +
    + + + + + + + + +
    int8_t evaluate (char post[])
    +
    + +

    Function to evaluate postfix expression.

    +
    Parameters
    + + +
    postthe input postfix expression
    +
    +
    +
    Returns
    evaluated answer
    +
    60 {
    +
    61 int8_t it1;
    +
    62 int8_t it2;
    +
    63 int8_t temp;
    +
    64 int8_t number;
    +
    65 int i;
    +
    66 for(i = 0; i < strlen(post); i++) {
    +
    67 if(post[i] == ' ') {
    +
    68 continue; // ignore delimiter
    +
    69 }
    +
    70 else if(isdigit(post[i])) {
    +
    71 number = 0;
    +
    72 do {
    +
    73 number = number * 10 + (post[i]-'0');
    +
    74 i++;
    +
    75 } while(i < strlen(post) && isdigit(post[i]));
    +
    76 push(number);
    +
    77 }
    +
    78 else {
    +
    79 it2 = pop();
    +
    80 it1 = pop();
    +
    81 switch(post[i]) {
    +
    82 case '+':
    +
    83 temp = it1 + it2; break;
    +
    84 case '-':
    +
    85 temp = it1 - it2; break;
    +
    86 case '*':
    +
    87 temp = it1 * it2; break;
    +
    88 case '/':
    +
    89 temp = it1 / it2; break;
    +
    90 case '%':
    +
    91 temp = it1 % it2; break;
    +
    92 default:
    +
    93 printf("Invalid operator"); exit(1);
    +
    94 }
    +
    95 push(temp);
    +
    96 }
    +
    97 }
    +
    98 return pop();
    +
    99}
    +
    int8_t pop()
    Function to pop from the stack.
    Definition: postfix_evaluation.c:44
    +
    void push(int8_t opd)
    Function to push on the stack.
    Definition: postfix_evaluation.c:31
    +
    +Here is the call graph for this function:
    +
    +
    +
    +
    + +
    +
    + +

    ◆ main()

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

    Main function.

    +
    Returns
    0 on exit
    +

    initialize

    +

    run self-test implementations

    +
    124 {
    +
    125 st.top = -1; /// initialize
    +
    126 test(); /// run self-test implementations
    +
    127 return 0;
    +
    128}
    +
    struct Stack st
    global declaration of stack st
    Definition: postfix_evaluation.c:24
    +
    static void test()
    Self-test implementations.
    Definition: postfix_evaluation.c:105
    +
    int top
    stores index of the top element
    Definition: infix_to_postfix2.c:23
    +
    +Here is the call graph for this function:
    +
    +
    +
    +
    + +
    +
    + +

    ◆ pop()

    + +
    +
    + + + + + + + + +
    int8_t pop (void )
    +
    + +

    Function to pop from the stack.

    +
    Returns
    popped number
    +

    < to store the popped value to be returned

    +
    44 {
    +
    45 int8_t item; ///< to store the popped value to be returned
    +
    46 if(st.top == -1) { // underflow condition
    +
    47 printf("Stack underflow...");
    +
    48 exit(1);
    +
    49 }
    +
    50 item = st.stack[st.top];
    +
    51 st.top--;
    +
    52 return item;
    +
    53}
    +
    char stack[10]
    array stack
    Definition: infix_to_postfix2.c:22
    +
    +
    +
    + +

    ◆ push()

    + +
    +
    + + + + + + + + +
    void push (int8_t opd)
    +
    + +

    Function to push on the stack.

    +
    Parameters
    + + +
    opdnumber to be pushed in the stack
    +
    +
    +
    Returns
    void
    +
    31 {
    +
    32 if(st.top == 19) { // overflow condition
    +
    33 printf("Stack overflow...");
    +
    34 exit(1);
    +
    35 }
    +
    36 st.top++;
    +
    37 st.stack[st.top] = opd;
    +
    38}
    +
    +
    +
    + +

    ◆ test()

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

    Self-test implementations.

    +
    Returns
    void
    +

    this ensures that the algorithm works as expected

    +

    this ensures that the algorithm works as expected

    +
    105 {
    +
    106 /* check sample test case
    +
    107 input: "2 10 + 9 6 - /"
    +
    108 expected output: 4
    +
    109 */
    +
    110 char temp1[50] = "2 10 + 9 6 - /";
    +
    111 assert(evaluate(temp1) == 4); /// this ensures that the algorithm works as expected
    +
    112 /* input: "4 2 + 3 5 1 - * +"
    +
    113 expected output: 18
    +
    114 */
    +
    115 char temp2[50] = "4 2 + 3 5 1 - * +";
    +
    116 assert(evaluate(temp2) == 18); /// this ensures that the algorithm works as expected
    +
    117 printf("All tests have successfully passed!\n");
    +
    118}
    +
    int8_t evaluate(char post[])
    Function to evaluate postfix expression.
    Definition: postfix_evaluation.c:60
    +
    +Here is the call graph for this function:
    +
    +
    +
    +
    + +
    +
    +
    +
    + + + + diff --git a/df/d43/postfix__evaluation_8c.js b/df/d43/postfix__evaluation_8c.js new file mode 100644 index 000000000..7c9b7f0e9 --- /dev/null +++ b/df/d43/postfix__evaluation_8c.js @@ -0,0 +1,10 @@ +var postfix__evaluation_8c = +[ + [ "Stack", "dd/d10/struct_stack.html", "dd/d10/struct_stack" ], + [ "evaluate", "df/d43/postfix__evaluation_8c.html#a4494492c8fc2509f602acc8228a3b623", null ], + [ "main", "df/d43/postfix__evaluation_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], + [ "pop", "df/d43/postfix__evaluation_8c.html#a8546e4b3f61be1f09ce47f428116ad7d", null ], + [ "push", "df/d43/postfix__evaluation_8c.html#af395c540f7e70a8d82d055a0aa42bbef", null ], + [ "test", "df/d43/postfix__evaluation_8c.html#aa8dca7b867074164d5f45b0f3851269d", null ], + [ "st", "df/d43/postfix__evaluation_8c.html#a791cc5e78425bce611db4e3bdc4b19d5", null ] +]; \ No newline at end of file diff --git a/df/d43/postfix__evaluation_8c_a4494492c8fc2509f602acc8228a3b623_cgraph.map b/df/d43/postfix__evaluation_8c_a4494492c8fc2509f602acc8228a3b623_cgraph.map new file mode 100644 index 000000000..c5fe676cf --- /dev/null +++ b/df/d43/postfix__evaluation_8c_a4494492c8fc2509f602acc8228a3b623_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/df/d43/postfix__evaluation_8c_a4494492c8fc2509f602acc8228a3b623_cgraph.md5 b/df/d43/postfix__evaluation_8c_a4494492c8fc2509f602acc8228a3b623_cgraph.md5 new file mode 100644 index 000000000..e1428c562 --- /dev/null +++ b/df/d43/postfix__evaluation_8c_a4494492c8fc2509f602acc8228a3b623_cgraph.md5 @@ -0,0 +1 @@ +03be7e444cdc716111aec2ca1db20a36 \ No newline at end of file diff --git a/df/d43/postfix__evaluation_8c_a4494492c8fc2509f602acc8228a3b623_cgraph.svg b/df/d43/postfix__evaluation_8c_a4494492c8fc2509f602acc8228a3b623_cgraph.svg new file mode 100644 index 000000000..90e798e49 --- /dev/null +++ b/df/d43/postfix__evaluation_8c_a4494492c8fc2509f602acc8228a3b623_cgraph.svg @@ -0,0 +1,52 @@ + + + + + + +evaluate + + + +Node1 + + +evaluate + + + + + +Node2 + + +pop + + + + + +Node1->Node2 + + + + + +Node3 + + +push + + + + + +Node1->Node3 + + + + + diff --git a/df/d43/postfix__evaluation_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map b/df/d43/postfix__evaluation_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map new file mode 100644 index 000000000..6d8549b83 --- /dev/null +++ b/df/d43/postfix__evaluation_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/df/d43/postfix__evaluation_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 b/df/d43/postfix__evaluation_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 new file mode 100644 index 000000000..5641a90f7 --- /dev/null +++ b/df/d43/postfix__evaluation_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 @@ -0,0 +1 @@ +e40f8d10eec3f68db31d994ef01f3d95 \ No newline at end of file diff --git a/df/d43/postfix__evaluation_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/df/d43/postfix__evaluation_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg new file mode 100644 index 000000000..8d7083931 --- /dev/null +++ b/df/d43/postfix__evaluation_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg @@ -0,0 +1,67 @@ + + + + + + +test + + + +Node1 + + +test + + + + + +Node2 + + +evaluate + + + + + +Node1->Node2 + + + + + +Node3 + + +pop + + + + + +Node2->Node3 + + + + + +Node4 + + +push + + + + + +Node2->Node4 + + + + + diff --git a/df/d43/postfix__evaluation_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/df/d43/postfix__evaluation_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..fd6f0f75d --- /dev/null +++ b/df/d43/postfix__evaluation_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/df/d43/postfix__evaluation_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/df/d43/postfix__evaluation_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..21ea33a31 --- /dev/null +++ b/df/d43/postfix__evaluation_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +9915881cc48556793bfe4af3a5360c29 \ No newline at end of file diff --git a/df/d43/postfix__evaluation_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/df/d43/postfix__evaluation_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..1d92ce9da --- /dev/null +++ b/df/d43/postfix__evaluation_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,82 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +test + + + + + +Node1->Node2 + + + + + +Node3 + + +evaluate + + + + + +Node2->Node3 + + + + + +Node4 + + +pop + + + + + +Node3->Node4 + + + + + +Node5 + + +push + + + + + +Node3->Node5 + + + + + diff --git a/df/d58/md_leetcode__r_e_a_d_m_e.html b/df/d58/md_leetcode__r_e_a_d_m_e.html index 1aabf62b1..2c4acdf6d 100644 --- a/df/d58/md_leetcode__r_e_a_d_m_e.html +++ b/df/d58/md_leetcode__r_e_a_d_m_e.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: LeetCode @@ -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() {
@@ -89,186 +89,185 @@ $(document).ready(function(){initNavTree('df/d58/md_leetcode__r_e_a_d_m_e.html',
-
-
-
LeetCode
+
+
LeetCode
-

+

LeetCode Algorithm

- + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +
# Title Solution Difficulty
1 Two Sum C Easy
1 Two Sum C Easy
2 Add Two Numbers C Medium
2 Add Two Numbers C Medium
3 Longest Substring Without Repeating Characters C Medium
3 Longest Substring Without Repeating Characters C Medium
4 Median of Two Sorted Arrays C Hard
4 Median of Two Sorted Arrays C Hard
7 Reverse Integer C Easy
7 Reverse Integer C Easy
8 String to Integer (atoi) C Medium
8 String to Integer (atoi) C Medium
9 Palindrome Number C Easy
9 Palindrome Number C Easy
11 Container With Most Water C Medium
11 Container With Most Water C Medium
12 Integer to Roman C Medium
12 Integer to Roman C Medium
13 Roman to Integer C Easy
13 Roman to Integer C Easy
20 Valid Parentheses C Easy
20 Valid Parentheses C Easy
21 Merge Two Sorted Lists C Easy
21 Merge Two Sorted Lists C Easy
24 Swap Nodes in Pairs C Medium
24 Swap Nodes in Pairs C Medium
26 Remove Duplicates from Sorted Array C Easy
26 Remove Duplicates from Sorted Array C Easy
27 Remove Element C Easy
27 Remove Element C Easy
28 Implement strStr() C Easy
28 Implement strStr() C Easy
29 Divide Two Integers C Medium
29 Divide Two Integers C Medium
35 Search Insert Position C Easy
35 Search Insert Position C Easy
38 Count and Say C Easy
38 Count and Say C Easy
53 Maximum Subarray C Easy
53 Maximum Subarray C Easy
66 Plus One C Easy
66 Plus One C Easy
82 Remove Duplicates from Sorted List II C Medium
82 Remove Duplicates from Sorted List II C Medium
83 Remove Duplicates from Sorted List C Easy
83 Remove Duplicates from Sorted List C Easy
94 Binary Tree Inorder Traversal C Medium
94 Binary Tree Inorder Traversal C Medium
101 Symmetric Tree C Easy
101 Symmetric Tree C Easy
104 Maximum Depth of Binary Tree C Easy
104 Maximum Depth of Binary Tree C Easy
108 Convert Sorted Array to Binary Search Tree C Easy
108 Convert Sorted Array to Binary Search Tree C Easy
109 Convert Sorted List to Binary Search Tree C Medium
109 Convert Sorted List to Binary Search Tree C Medium
110 Balanced Binary Tree C Easy
110 Balanced Binary Tree C Easy
112 Path Sum C Easy
112 Path Sum C Easy
121 Best Time to Buy and Sell Stock C Easy
121 Best Time to Buy and Sell Stock C Easy
125 Valid Palindrome C Easy
125 Valid Palindrome C Easy
136 Single Number C Easy
136 Single Number C Easy
141 Linked List Cycle C Easy
141 Linked List Cycle C Easy
142 Linked List Cycle II C Medium
142 Linked List Cycle II C Medium
153 Find Minimum in Rotated Sorted Array C Medium
153 Find Minimum in Rotated Sorted Array C Medium
160 Intersection of Two Linked Lists C Easy
160 Intersection of Two Linked Lists C Easy
169 Majority Element C Easy
169 Majority Element C Easy
173 Binary Search Tree Iterator C Medium
173 Binary Search Tree Iterator C Medium
189 Rotate Array C Easy
189 Rotate Array C Easy
190 Reverse Bits C Easy
190 Reverse Bits C Easy
191 Number of 1 Bits C Easy
191 Number of 1 Bits C Easy
201 Bitwise AND of Numbers Range C Medium
201 Bitwise AND of Numbers Range C Medium
203 Remove Linked List Elements C Easy
203 Remove Linked List Elements C Easy
206 Reverse Linked List C Easy
206 Reverse Linked List C Easy
215 Kth Largest Element in an Array C Medium
215 Kth Largest Element in an Array C Medium
217 Contains Duplicate C Easy
217 Contains Duplicate C Easy
226 Invert Binary Tree C Easy
226 Invert Binary Tree C Easy
231 Power of Two C Easy
231 Power of Two C Easy
234 Palindrome Linked List C Easy
234 Palindrome Linked List C Easy
242 Valid Anagram C Easy
242 Valid Anagram C Easy
268 Missing Number C Easy
268 Missing Number C Easy
278 First Bad Version C Easy
278 First Bad Version C Easy
283 Move Zeroes C Easy
283 Move Zeroes C Easy
287 Find the Duplicate Number C Medium
287 Find the Duplicate Number C Medium
344 Reverse String C Easy
344 Reverse String C Easy
367 Valid Perfect Square C Easy
367 Valid Perfect Square C Easy
387 First Unique Character in a String C Easy
387 First Unique Character in a String C Easy
389 Find the Difference C Easy
389 Find the Difference C Easy
404 Sum of Left Leaves C Easy
404 Sum of Left Leaves C Easy
442 Find All Duplicates in an Array C Medium
442 Find All Duplicates in an Array C Medium
461 Hamming Distance C Easy
461 Hamming Distance C Easy
476 Number Complement C Easy
476 Number Complement C Easy
509 Fibonacci Number C Easy
509 Fibonacci Number C Easy
520 Detect Capital C Easy
520 Detect Capital C Easy
561 Array Partition I C Easy
561 Array Partition I C Easy
617 Merge Two Binary Trees C Easy
617 Merge Two Binary Trees C Easy
647 Palindromic Substring C Medium
647 Palindromic Substring C Medium
674 Longest Continuous Increasing Subsequence C Easy
674 Longest Continuous Increasing Subsequence C Easy
700 Search in a Binary Search Tree C Easy
700 Search in a Binary Search Tree C Easy
701 Insert into a Binary Search Tree C Medium
701 Insert into a Binary Search Tree C Medium
704 Binary Search C Easy
704 Binary Search C Easy
709 To Lower Case C Easy
709 To Lower Case C Easy
771 Jewels and Stones C Easy
771 Jewels and Stones C Easy
852 Peak Index in a Mountain Array C Easy
852 Peak Index in a Mountain Array C Easy
876 Middle of the Linked List C Easy
876 Middle of the Linked List C Easy
905 Sort Array By Parity C Easy
905 Sort Array By Parity C Easy
917 Reverse Only Letters C Easy
917 Reverse Only Letters C Easy
938 Range Sum of BST C Easy
938 Range Sum of BST C Easy
965 Univalued Binary Tree C Easy
965 Univalued Binary Tree C Easy
977 Squares of a Sorted Array C Easy
977 Squares of a Sorted Array C Easy
1089 Duplicate Zeros C Easy
1089 Duplicate Zeros C Easy
1184 Distance Between Bus Stops C Easy
1184 Distance Between Bus Stops C Easy
1189 Maximum Number of Balloons C Easy
1189 Maximum Number of Balloons C Easy
1207 Unique Number of Occurrences C Easy
1207 Unique Number of Occurrences C Easy

@@ -276,7 +275,7 @@ LeetCode Algorithm diff --git a/df/d83/selection__sort_8c.html b/df/d83/selection__sort_8c.html index 2025cec1e..1cbcf027b 100644 --- a/df/d83/selection__sort_8c.html +++ b/df/d83/selection__sort_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: sorting/selection_sort.c 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('df/d83/selection__sort_8c.html','../..
-
-
selection_sort.c File Reference
+
selection_sort.c File Reference
-

Selection sort algorithm implementation. +

Selection sort algorithm implementation. More...

#include <assert.h>
#include <stdio.h>
@@ -110,7 +109,7 @@ Include dependency graph for selection_sort.c:
- @@ -121,15 +120,57 @@ Functions - - + +

+

Functions

void swap (int *first, int *second)
 Swapped two numbers using pointer. More...
static void test ()
 Test function. More...
 
-int main (int argc, const char *argv[])
 Driver Code.
int main (int argc, const char *argv[])
 Driver Code. More...
 

Detailed Description

-

Selection sort algorithm implementation.

+

Selection sort algorithm implementation.

Function Documentation

- + +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
const char * argv[] 
)
+
+ +

Driver Code.

+
70{
+
71 /* Intializes random number generator */
+
72 srand(time(NULL));
+
73 test();
+
74 return 0;
+
75}
+
static void test()
Test function.
Definition: selection_sort.c:50
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+

◆ selectionSort()

@@ -163,23 +204,23 @@ int 
29 {
-
30  for (int i = 0; i < size - 1; i++)
-
31  {
-
32  int min_index = i;
-
33  for (int j = i + 1; j < size; j++)
-
34  {
-
35  if (arr[min_index] > arr[j])
-
36  {
-
37  min_index = j;
-
38  }
-
39  }
-
40  if (min_index != i)
-
41  {
-
42  swap(arr + i, arr + min_index);
-
43  }
-
44  }
-
45 }
+
29{
+
30 for (int i = 0; i < size - 1; i++)
+
31 {
+
32 int min_index = i;
+
33 for (int j = i + 1; j < size; j++)
+
34 {
+
35 if (arr[min_index] > arr[j])
+
36 {
+
37 min_index = j;
+
38 }
+
39 }
+
40 if (min_index != i)
+
41 {
+
42 swap(arr + i, arr + min_index);
+
43 }
+
44 }
+
45}
void swap(int *first, int *second)
Swapped two numbers using pointer.
Definition: selection_sort.c:16
Here is the call graph for this function:
@@ -190,7 +231,7 @@ Here is the call graph for this function:
- +

◆ swap()

@@ -224,15 +265,15 @@ Here is the call graph for this function:
-
17 {
-
18  int temp = *first;
-
19  *first = *second;
-
20  *second = temp;
-
21 }
+
17{
+
18 int temp = *first;
+
19 *first = *second;
+
20 *second = temp;
+
21}
- +

◆ test()

@@ -258,22 +299,22 @@ Here is the call graph for this function:

Test function.

Returns
None
-
51 {
-
52  const int size = rand() % 500; /* random array size */
-
53  int *arr = (int *)calloc(size, sizeof(int));
-
54 
-
55  /* generate size random numbers from -50 to 49 */
-
56  for (int i = 0; i < size; i++)
-
57  {
-
58  arr[i] = (rand() % 100) - 50; /* signed random numbers */
-
59  }
-
60  selectionSort(arr, size);
-
61  for (int i = 0; i < size - 1; ++i)
-
62  {
-
63  assert(arr[i] <= arr[i + 1]);
-
64  }
-
65  free(arr);
-
66 }
+
51{
+
52 const int size = rand() % 500; /* random array size */
+
53 int *arr = (int *)calloc(size, sizeof(int));
+
54
+
55 /* generate size random numbers from -50 to 49 */
+
56 for (int i = 0; i < size; i++)
+
57 {
+
58 arr[i] = (rand() % 100) - 50; /* signed random numbers */
+
59 }
+
60 selectionSort(arr, size);
+
61 for (int i = 0; i < size - 1; ++i)
+
62 {
+
63 assert(arr[i] <= arr[i + 1]);
+
64 }
+
65 free(arr);
+
66}
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
#define calloc(elemCount, elemSize)
This macro replace the standard calloc function with calloc_dbg.
Definition: malloc_dbg.h:22
void selectionSort(int *arr, int size)
Selection sort algorithm implements.
Definition: selection_sort.c:28
@@ -292,7 +333,7 @@ Here is the call graph for this function:
diff --git a/df/d83/selection__sort_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/df/d83/selection__sort_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg index fbbe6d05f..d82e52ed5 100644 --- a/df/d83/selection__sort_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg +++ b/df/d83/selection__sort_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg @@ -1,7 +1,7 @@ - + + + + + diff --git a/df/d83/selection__sort_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.md5 b/df/d83/selection__sort_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.md5 new file mode 100644 index 000000000..f0428303f --- /dev/null +++ b/df/d83/selection__sort_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.md5 @@ -0,0 +1 @@ +03f7e3a9c5d470c330b2f221b3e7b586 \ No newline at end of file diff --git a/df/d83/selection__sort_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.svg b/df/d83/selection__sort_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.svg new file mode 100644 index 000000000..9a02e2df6 --- /dev/null +++ b/df/d83/selection__sort_8c_ac0f2228420376f4db7e1274f2b41667c_cgraph.svg @@ -0,0 +1,67 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +test + + + + + +Node1->Node2 + + + + + +Node3 + + +selectionSort + + + + + +Node2->Node3 + + + + + +Node4 + + +swap + + + + + +Node3->Node4 + + + + + diff --git a/df/d83/selection__sort_8c_aeafe7419cfceaeccaf49f22842d9a617_cgraph.svg b/df/d83/selection__sort_8c_aeafe7419cfceaeccaf49f22842d9a617_cgraph.svg index 8b97cffce..e4aae6087 100644 --- a/df/d83/selection__sort_8c_aeafe7419cfceaeccaf49f22842d9a617_cgraph.svg +++ b/df/d83/selection__sort_8c_aeafe7419cfceaeccaf49f22842d9a617_cgraph.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C: term 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() {
@@ -92,8 +92,7 @@ $(document).ready(function(){initNavTree('df/d86/structterm.html','../../'); ini
-
-
term Struct Reference
+
term Struct Reference
@@ -106,23 +105,23 @@ Collaboration diagram for term:
[legend]
- - + - + - +

+

Data Fields

-int coef
+int coef
 coefficient value
 
-int pow
+int pow
 power of the polynomial term
 
-struct term * next
+struct term * next
 pointer to the successive term
 

Detailed Description

-

identifier for single-variable polynomial coefficients as a linked list

+

identifier for single-variable polynomial coefficients as a linked list


The documentation for this struct was generated from the following file: @@ -132,7 +131,7 @@ struct term * 
    - +
diff --git a/df/d98/quaternions_8c.html b/df/d98/quaternions_8c.html index 41504b1f2..3e618492d 100644 --- a/df/d98/quaternions_8c.html +++ b/df/d98/quaternions_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: geometry/quaternions.c 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('df/d98/quaternions_8c.html','../../');
-
-
quaternions.c File Reference
+
quaternions.c File Reference
@@ -106,11 +105,11 @@ $(document).ready(function(){initNavTree('df/d98/quaternions_8c.html','../../');
Include dependency graph for quaternions.c:
-
+
- @@ -121,23 +120,97 @@ Functions - + - +

+

Functions

quaternion quat_from_euler (const euler *in_euler)
 Function to convert given Euler angles to a quaternion. More...
quaternion quaternion_multiply (const quaternion *in_quat1, const quaternion *in_quat2)
 Function to multiply two quaternions. More...
 
-static void test ()
static void test ()
 
-int main ()
int main ()
 

Detailed Description

-

Functions related to 3D quaternions and Euler angles.

+

Functions related to 3D quaternions and Euler angles.

Author
Krishna Vedala
-
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + + +
int main (void )
+
+
170{
+
171 test();
+
172 return 0;
+
173}
+
void test()
Test function.
Definition: decimal_to_binary_recursion.c:20
+
+
+
+ +

◆ test()

+ +
+
+ + + + + +
+ + + + + + + + +
static void test (void )
+
+static
+
+
154{
+
155 quaternion quat = {0.7071f, 0.7071f, 0.f, 0.f};
+
156 euler eul = euler_from_quat(&quat);
+
157 printf("Euler: %.4g, %.4g, %.4g\n", eul.pitch, eul.roll, eul.yaw);
+
158
+
159 quaternion test_quat = quat_from_euler(&eul);
+
160 printf("Quaternion: %.4g %+.4g %+.4g %+.4g\n", test_quat.w,
+
161 test_quat.dual.x, test_quat.dual.y, test_quat.dual.z);
+
162
+
163 assert(fabsf(test_quat.w - quat.w) < .01);
+
164 assert(fabsf(test_quat.q1 - quat.q1) < .01);
+
165 assert(fabsf(test_quat.q2 - quat.q2) < .01);
+
166 assert(fabsf(test_quat.q3 - quat.q3) < .01);
+
167}
+
euler euler_from_quat(const quaternion *in_quat)
Function to convert given quaternion to Euler angles.
Definition: quaternions.c:88
+
quaternion quat_from_euler(const euler *in_euler)
Function to convert given Euler angles to a quaternion.
Definition: quaternions.c:47
+
3D Euler or Tait-Bryan angles (in radian)
Definition: geometry_datatypes.h:81
+
float roll
or bank = rotation about X axis
Definition: geometry_datatypes.h:84
+
float pitch
or elevation = rotation about Y axis
Definition: geometry_datatypes.h:89
+
float yaw
or heading = rotation about Z axis
Definition: geometry_datatypes.h:94
+
a Quaternion type represented using a scalar or and a 3D vector
Definition: geometry_datatypes.h:61
+
vec_3d dual
can be a 3D vector
Definition: geometry_datatypes.h:70
+
float w
real part of quaternion
Definition: geometry_datatypes.h:64
+
float z
Z co-ordinate.
Definition: geometry_datatypes.h:25
+
float x
X co-ordinate.
Definition: geometry_datatypes.h:23
+
float y
Y co-ordinate.
Definition: geometry_datatypes.h:24
+
+
+
+ diff --git a/df/d98/quaternions_8c.js b/df/d98/quaternions_8c.js index 6f398690a..e2c2043fd 100644 --- a/df/d98/quaternions_8c.js +++ b/df/d98/quaternions_8c.js @@ -1,8 +1,6 @@ var quaternions_8c = [ [ "euler_from_quat", "dc/d9a/group__quats.html#ga1afd165100e9b02b86e3bd11b50f3b06", null ], - [ "main", "df/d98/quaternions_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], [ "quat_from_euler", "dc/d9a/group__quats.html#ga4779f448daaf806ce5e750c13b3e0965", null ], - [ "quaternion_multiply", "dc/d9a/group__quats.html#gaf5ad0f9c4f0facc5a9c3735a178156b1", null ], - [ "test", "df/d98/quaternions_8c.html#aa8dca7b867074164d5f45b0f3851269d", null ] + [ "quaternion_multiply", "dc/d9a/group__quats.html#gaf5ad0f9c4f0facc5a9c3735a178156b1", null ] ]; \ No newline at end of file diff --git a/df/da5/problem__9_2sol1_8c.html b/df/da5/problem__9_2sol1_8c.html index 59909f5b9..8091e5847 100644 --- a/df/da5/problem__9_2sol1_8c.html +++ b/df/da5/problem__9_2sol1_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_9/sol1.c 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,38 +92,73 @@ $(document).ready(function(){initNavTree('df/da5/problem__9_2sol1_8c.html','../.
-
-
sol1.c File Reference
+
sol1.c File Reference
-

Problem 9 solution - A naive implementation +

Problem 9 solution - A naive implementation More...

#include <stdio.h>
Include dependency graph for sol1.c:
-
+
- - - + +

+

Functions

-int main (void)
 Main function.
int main (void)
 Main function. More...
 

Detailed Description

-

Problem 9 solution - A naive implementation

-
Author
Krishna Vedala
-
+

Problem 9 solution - A naive implementation

+
Author
Krishna Vedala
+

Function Documentation

+ +

◆ main()

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

Main function.

+
11{
+
12 for (int a = 1; a < 300; a++)
+
13 for (int b = a + 1; b < 400; b++)
+
14 for (int c = b + 1; c < 500; c++)
+
15 {
+
16 if (a * a + b * b == c * c)
+
17 if (a + b + c == 1000)
+
18 {
+
19 printf("%d x %d x %d = %ld\n", a, b, c,
+
20 (long int)a * b * c);
+
21 return 0;
+
22 }
+
23 }
+
24
+
25 return 0;
+
26}
+
+
+
+
diff --git a/df/da6/naval__battle_8c__incl.map b/df/da6/naval__battle_8c__incl.map index 35def35a1..3eefbbaa8 100644 --- a/df/da6/naval__battle_8c__incl.map +++ b/df/da6/naval__battle_8c__incl.map @@ -1,4 +1,4 @@ - - + + diff --git a/df/da6/naval__battle_8c__incl.svg b/df/da6/naval__battle_8c__incl.svg index 05fddad80..03dd2dba8 100644 --- a/df/da6/naval__battle_8c__incl.svg +++ b/df/da6/naval__battle_8c__incl.svg @@ -1,20 +1,20 @@ - - + games/naval_battle.c - + Node1 - -games/naval_battle.c + +games/naval_battle.c @@ -22,16 +22,16 @@ Node2 - -stdio.h + +stdio.h Node1->Node2 - - + + diff --git a/df/db0/factorial__large__number_8c__incl.map b/df/db0/factorial__large__number_8c__incl.map index a4b25bd0d..5f03e1e28 100644 --- a/df/db0/factorial__large__number_8c__incl.map +++ b/df/db0/factorial__large__number_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/df/db0/factorial__large__number_8c__incl.svg b/df/db0/factorial__large__number_8c__incl.svg index 3caa91684..b0572bd3f 100644 --- a/df/db0/factorial__large__number_8c__incl.svg +++ b/df/db0/factorial__large__number_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - -misc/factorial_large + +misc/factorial_large _number.c diff --git a/df/db3/struct_l.html b/df/db3/struct_l.html index 0ed5d546d..90ac66f77 100644 --- a/df/db3/struct_l.html +++ b/df/db3/struct_l.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: L 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() {
@@ -92,8 +92,7 @@ $(document).ready(function(){initNavTree('df/db3/struct_l.html','../../'); initR
-
-
L Struct Reference
+
L Struct Reference
@@ -103,12 +102,12 @@ Collaboration diagram for L:
[legend]
- - -

+

Data Fields

+
void * val
 
+
L next
 
@@ -121,7 +120,7 @@ void * val diff --git a/df/db3/struct_l.js b/df/db3/struct_l.js deleted file mode 100644 index 41e632e14..000000000 --- a/df/db3/struct_l.js +++ /dev/null @@ -1,5 +0,0 @@ -var struct_l = -[ - [ "next", "df/db3/struct_l.html#adbf91f5f6cc3047e13bb3dbbfb277be0", null ], - [ "val", "df/db3/struct_l.html#a4d585643a6364fbf79f54de5fa49d17f", null ] -]; \ No newline at end of file diff --git a/df/dbc/problem__6_2sol_8c__incl.map b/df/dbc/problem__6_2sol_8c__incl.map index 7ecd4d398..e805ae40e 100644 --- a/df/dbc/problem__6_2sol_8c__incl.map +++ b/df/dbc/problem__6_2sol_8c__incl.map @@ -1,4 +1,4 @@ - - + + diff --git a/df/dbc/problem__6_2sol_8c__incl.svg b/df/dbc/problem__6_2sol_8c__incl.svg index 97a174431..1789301c3 100644 --- a/df/dbc/problem__6_2sol_8c__incl.svg +++ b/df/dbc/problem__6_2sol_8c__incl.svg @@ -1,21 +1,21 @@ - - + project_euler/problem_6/sol.c - + Node1 - + project_euler/problem -_6/sol.c +_6/sol.c @@ -23,16 +23,16 @@ Node2 - -stdio.h + +stdio.h Node1->Node2 - - + + diff --git a/df/dc6/acronym_8h_source.html b/df/dc6/acronym_8h_source.html index 36c7e893f..abdc3438f 100644 --- a/df/dc6/acronym_8h_source.html +++ b/df/dc6/acronym_8h_source.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: exercism/acronym/acronym.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,23 +90,22 @@ $(document).ready(function(){initNavTree('df/dc6/acronym_8h_source.html','../../
-
-
acronym.h
+
acronym.h
-
1 #ifndef ACRONYM_H
-
2 #define ACRONYM_H
-
3 
-
4 char *abbreviate(const char *phrase);
-
5 
-
6 #endif
+
1#ifndef ACRONYM_H
+
2#define ACRONYM_H
+
3
+
4char *abbreviate(const char *phrase);
+
5
+
6#endif
diff --git a/df/dda/ode__midpoint__euler_8c__incl.map b/df/dda/ode__midpoint__euler_8c__incl.map index a2aa4fcf7..3620605af 100644 --- a/df/dda/ode__midpoint__euler_8c__incl.map +++ b/df/dda/ode__midpoint__euler_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/df/dda/ode__midpoint__euler_8c__incl.svg b/df/dda/ode__midpoint__euler_8c__incl.svg index 6529d5adc..523e879ac 100644 --- a/df/dda/ode__midpoint__euler_8c__incl.svg +++ b/df/dda/ode__midpoint__euler_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - -numerical_methods/ode + +numerical_methods/ode _midpoint_euler.c diff --git a/df/ddb/structword__count__word.html b/df/ddb/structword__count__word.html index 2309c4fc3..00427f7d3 100644 --- a/df/ddb/structword__count__word.html +++ b/df/ddb/structword__count__word.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: word_count_word 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() {
@@ -92,17 +92,16 @@ $(document).ready(function(){initNavTree('df/ddb/structword__count__word.html','
-
-
word_count_word Struct Reference
+
word_count_word Struct Reference
- - -

+

Data Fields

+
char text [MAX_WORD_LENGTH]
 
+
int count
 
@@ -115,7 +114,7 @@ int count diff --git a/df/ddb/structword__count__word.js b/df/ddb/structword__count__word.js deleted file mode 100644 index 695e2cc8e..000000000 --- a/df/ddb/structword__count__word.js +++ /dev/null @@ -1,5 +0,0 @@ -var structword__count__word = -[ - [ "count", "df/ddb/structword__count__word.html#a44e237e11196ffa56574b90ea807e8fc", null ], - [ "text", "df/ddb/structword__count__word.html#a9c018b5f83b2aeeefac5cc09e5f41efd", null ] -]; \ No newline at end of file diff --git a/df/ddc/cantor__set_8c__incl.map b/df/ddc/cantor__set_8c__incl.map index 948f81f10..b3d6e4b2a 100644 --- a/df/ddc/cantor__set_8c__incl.map +++ b/df/ddc/cantor__set_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/df/ddc/cantor__set_8c__incl.svg b/df/ddc/cantor__set_8c__incl.svg index dd6e98269..4e50cf70b 100644 --- a/df/ddc/cantor__set_8c__incl.svg +++ b/df/ddc/cantor__set_8c__incl.svg @@ -1,7 +1,7 @@ - Node1 - + misc/cantor_set.c diff --git a/df/ddc/struct_node__coll__graph.map b/df/ddc/struct_node__coll__graph.map index 16578ccac..bb594fc78 100644 --- a/df/ddc/struct_node__coll__graph.map +++ b/df/ddc/struct_node__coll__graph.map @@ -1,3 +1,3 @@ - + diff --git a/df/ddc/struct_node__coll__graph.md5 b/df/ddc/struct_node__coll__graph.md5 index 2bff89083..3ddf8f0c2 100644 --- a/df/ddc/struct_node__coll__graph.md5 +++ b/df/ddc/struct_node__coll__graph.md5 @@ -1 +1 @@ -144ad36b3afc71963f84485a1e7e218d \ No newline at end of file +543d6074e952940c0e39db7a3dfa06d5 \ No newline at end of file diff --git a/df/ddc/struct_node__coll__graph.svg b/df/ddc/struct_node__coll__graph.svg index 6d3f2b715..3e7eea8a7 100644 --- a/df/ddc/struct_node__coll__graph.svg +++ b/df/ddc/struct_node__coll__graph.svg @@ -1,31 +1,33 @@ - - - + + Node - + Node1 - -Node + +Node Node1->Node1 - - - llink -next -rlink + + + left +llink +next +right +rlink diff --git a/df/ddf/structmat__3x3____coll__graph.map b/df/ddf/structmat__3x3____coll__graph.map index 349b18a14..a10b69b48 100644 --- a/df/ddf/structmat__3x3____coll__graph.map +++ b/df/ddf/structmat__3x3____coll__graph.map @@ -1,4 +1,4 @@ - - + + diff --git a/df/ddf/structmat__3x3____coll__graph.svg b/df/ddf/structmat__3x3____coll__graph.svg index 09647d8da..997d6b04d 100644 --- a/df/ddf/structmat__3x3____coll__graph.svg +++ b/df/ddf/structmat__3x3____coll__graph.svg @@ -1,20 +1,20 @@ - - + mat_3x3_ - + Node1 - -mat_3x3_ + +mat_3x3_ @@ -22,16 +22,16 @@ Node2 - -vec_3d_ + +vec_3d_ Node2->Node1 - - + + vec1 vec2 vec3 diff --git a/df/dea/structdata.html b/df/dea/structdata.html index 44c2d5559..7fe0c6e99 100644 --- a/df/dea/structdata.html +++ b/df/dea/structdata.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: data 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() {
@@ -92,17 +92,16 @@ $(document).ready(function(){initNavTree('df/dea/structdata.html','../../'); ini
-
-
data Struct Reference
+
data Struct Reference
- - -

+

Data Fields

+
int * range
 
+
int length
 
@@ -115,7 +114,7 @@ int length diff --git a/df/dea/structdata.js b/df/dea/structdata.js deleted file mode 100644 index ef75f43f1..000000000 --- a/df/dea/structdata.js +++ /dev/null @@ -1,5 +0,0 @@ -var structdata = -[ - [ "length", "df/dea/structdata.html#ab1464d70ed28af0a16cdd2ebaa64027c", null ], - [ "range", "df/dea/structdata.html#a7a7e33023945ddb393dc306c489c4049", null ] -]; \ No newline at end of file diff --git a/df/df3/union__find_8c.html b/df/df3/union__find_8c.html index 283fa00e6..235cf0f39 100644 --- a/df/df3/union__find_8c.html +++ b/df/df3/union__find_8c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: misc/union_find.c 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('df/df3/union__find_8c.html','../../'); -
-
union_find.c File Reference
+
union_find.c File Reference
-

Union find algorithm. +

Union find algorithm. More...

#include <stdio.h>
#include <stdlib.h>
@@ -109,14 +108,14 @@ Include dependency graph for union_find.c:
- - +

+

Macros

-#define MAX_SIZE   1000
+#define MAX_SIZE   1000
 maximum number of elements in the set
 
- @@ -124,15 +123,14 @@ Functions - - + +

+

Functions

int find (int *p, int x)
 Find index of or value in an array. More...
void join (int *p, int x, int y)
 Function to join. More...
 
-int main ()
 Main function.
int main ()
 Main function. More...
 

Detailed Description

-

Union find algorithm.

+

Union find algorithm.

Function Documentation

- +

◆ find()

@@ -167,29 +165,35 @@ int 
Returns
value at the index x
-
18 {
-
19  if (x >= MAX_SIZE)
-
20  {
-
21  fprintf(stderr, "Out-of bounds value\n");
-
22  exit(EXIT_FAILURE);
-
23  }
-
24 
-
25  if (p[x] == x)
-
26  {
-
27  return x;
-
28  }
-
29  else
-
30  {
-
31  p[x] = find(p, p[x]);
-
32  return p[x];
-
33  }
-
34 }
+
18{
+
19 if (x >= MAX_SIZE)
+
20 {
+
21 fprintf(stderr, "Out-of bounds value\n");
+
22 exit(EXIT_FAILURE);
+
23 }
+
24
+
25 if (p[x] == x)
+
26 {
+
27 return x;
+
28 }
+
29 else
+
30 {
+
31 p[x] = find(p, p[x]);
+
32 return p[x];
+
33 }
+
34}
#define MAX_SIZE
maximum number of elements in the set
Definition: union_find.c:8
int find(int *p, int x)
Find index of or value in an array.
Definition: union_find.c:17
-
+
+Here is the call graph for this function:
+
+
- + +
+
+

◆ join()

@@ -230,11 +234,82 @@ int 
42 { p[find(p, x)] = find(p, y); }
+
42{ p[find(p, x)] = find(p, y); }
Here is the call graph for this function:
-
+
+
+
+ +
+
+ +

◆ main()

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

Main function.

+
46{
+
47 int union_set[MAX_SIZE];
+
48
+
49 // Have all array indexes that you need to use reference themselves
+
50 for (int i = 0; i < 10; i++)
+
51 {
+
52 union_set[i] = i;
+
53 }
+
54 // p = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
+
55
+
56 join(union_set, 3, 5);
+
57 printf("The array is now: ");
+
58 for (int i = 0; i < 10; i++)
+
59 {
+
60 printf("%d ", union_set[i]);
+
61 }
+
62 printf("\n");
+
63 // Now 3 and 5 are groupped together, that is find(3) = find(5)
+
64 // p = {0, 1, 2, 5, 4, 5, 6, 7, 8, 9}
+
65
+
66 join(union_set, 3, 8);
+
67 printf("The array is now: ");
+
68 for (int i = 0; i < 10; i++)
+
69 {
+
70 printf("%d ", union_set[i]);
+
71 }
+
72 printf("\n");
+
73
+
74 // Now 3, 5 and are groupped together, find(3) = find(5) = find(8)
+
75 // p = {0, 1, 2, 5, 4, 8, 6, 7, 8, 9}
+
76 join(union_set, 0, 5);
+
77 if (find(union_set, 0) == find(union_set, 3))
+
78 {
+
79 printf("0 and 3 are groupped together\n");
+
80 }
+
81 printf("The array is now: ");
+
82 for (int i = 0; i < 10; i++)
+
83 {
+
84 printf("%d ", union_set[i]);
+
85 }
+
86 printf("\n");
+
87
+
88 return 0;
+
89}
+
void join(int *p, int x, int y)
Function to join.
Definition: union_find.c:42
+
+Here is the call graph for this function:
+
+
@@ -246,7 +321,7 @@ Here is the call graph for this function:
diff --git a/df/df3/union__find_8c_a3e13b69cce5a1b25ae034798092f3d86_cgraph.map b/df/df3/union__find_8c_a3e13b69cce5a1b25ae034798092f3d86_cgraph.map new file mode 100644 index 000000000..7ec6ebf78 --- /dev/null +++ b/df/df3/union__find_8c_a3e13b69cce5a1b25ae034798092f3d86_cgraph.map @@ -0,0 +1,3 @@ + + + diff --git a/df/df3/union__find_8c_a3e13b69cce5a1b25ae034798092f3d86_cgraph.md5 b/df/df3/union__find_8c_a3e13b69cce5a1b25ae034798092f3d86_cgraph.md5 new file mode 100644 index 000000000..c586b402d --- /dev/null +++ b/df/df3/union__find_8c_a3e13b69cce5a1b25ae034798092f3d86_cgraph.md5 @@ -0,0 +1 @@ +0cff7c9ee04f8c4df3edcced8992f166 \ No newline at end of file diff --git a/df/df3/union__find_8c_a3e13b69cce5a1b25ae034798092f3d86_cgraph.svg b/df/df3/union__find_8c_a3e13b69cce5a1b25ae034798092f3d86_cgraph.svg new file mode 100644 index 000000000..9fb77104b --- /dev/null +++ b/df/df3/union__find_8c_a3e13b69cce5a1b25ae034798092f3d86_cgraph.svg @@ -0,0 +1,28 @@ + + + + + + +find + + + +Node1 + + +find + + + + + +Node1->Node1 + + + + + diff --git a/df/df3/union__find_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/df/df3/union__find_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..7dd580aa9 --- /dev/null +++ b/df/df3/union__find_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/df/df3/union__find_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/df/df3/union__find_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..d24e9075e --- /dev/null +++ b/df/df3/union__find_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +001d8dc8655feadd825afbcb703cc681 \ No newline at end of file diff --git a/df/df3/union__find_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/df/df3/union__find_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..02fc3a496 --- /dev/null +++ b/df/df3/union__find_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,64 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +find + + + + + +Node1->Node2 + + + + + +Node3 + + +join + + + + + +Node1->Node3 + + + + + +Node2->Node2 + + + + + +Node3->Node2 + + + + + diff --git a/df/df3/union__find_8c_af2f3ff6d98641f7d3be11f071c97908a_cgraph.map b/df/df3/union__find_8c_af2f3ff6d98641f7d3be11f071c97908a_cgraph.map index 461836883..f5fa7eb87 100644 --- a/df/df3/union__find_8c_af2f3ff6d98641f7d3be11f071c97908a_cgraph.map +++ b/df/df3/union__find_8c_af2f3ff6d98641f7d3be11f071c97908a_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/df/df3/union__find_8c_af2f3ff6d98641f7d3be11f071c97908a_cgraph.md5 b/df/df3/union__find_8c_af2f3ff6d98641f7d3be11f071c97908a_cgraph.md5 index 83d6157d4..b5a7fd929 100644 --- a/df/df3/union__find_8c_af2f3ff6d98641f7d3be11f071c97908a_cgraph.md5 +++ b/df/df3/union__find_8c_af2f3ff6d98641f7d3be11f071c97908a_cgraph.md5 @@ -1 +1 @@ -23aaec78ffc7741b73fefb45a6808dc2 \ No newline at end of file +e4fd6337c58ec7702a1827964b4017fe \ No newline at end of file diff --git a/df/df3/union__find_8c_af2f3ff6d98641f7d3be11f071c97908a_cgraph.svg b/df/df3/union__find_8c_af2f3ff6d98641f7d3be11f071c97908a_cgraph.svg index c7bb95b47..a45205b5c 100644 --- a/df/df3/union__find_8c_af2f3ff6d98641f7d3be11f071c97908a_cgraph.svg +++ b/df/df3/union__find_8c_af2f3ff6d98641f7d3be11f071c97908a_cgraph.svg @@ -1,14 +1,14 @@ - - - + + join - + Node1 @@ -22,16 +22,22 @@ Node2 - -find + +find Node1->Node2 - - + + + + + +Node2->Node2 + + diff --git a/dir_03902f230b9e9b7c999f936617a23997.html b/dir_03902f230b9e9b7c999f936617a23997.html index e75c2938a..28e0da3df 100644 --- a/dir_03902f230b9e9b7c999f936617a23997.html +++ b/dir_03902f230b9e9b7c999f936617a23997.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: leetcode Directory 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,12 +90,11 @@ $(document).ready(function(){initNavTree('dir_03902f230b9e9b7c999f936617a23997.h
-
-
leetcode Directory Reference
+
leetcode Directory Reference
-

+

Directories

@@ -104,7 +103,7 @@ Directories diff --git a/dir_0472225043064b54f3dfff9011a9fae0.html b/dir_0472225043064b54f3dfff9011a9fae0.html index 7aeec66fe..8828b2053 100644 --- a/dir_0472225043064b54f3dfff9011a9fae0.html +++ b/dir_0472225043064b54f3dfff9011a9fae0.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: data_structures/stack/stack_linked_list Directory 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('dir_0472225043064b54f3dfff9011a9fae0.h
-
-
stack_linked_list Directory Reference
+
stack_linked_list Directory Reference
@@ -100,7 +99,7 @@ $(document).ready(function(){initNavTree('dir_0472225043064b54f3dfff9011a9fae0.h diff --git a/dir_079e1f799fb08a8a0b98cb030ab15687.html b/dir_079e1f799fb08a8a0b98cb030ab15687.html index 6f7501131..e75f0ef54 100644 --- a/dir_079e1f799fb08a8a0b98cb030ab15687.html +++ b/dir_079e1f799fb08a8a0b98cb030ab15687.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_25 Directory 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,15 +90,14 @@ $(document).ready(function(){initNavTree('dir_079e1f799fb08a8a0b98cb030ab15687.h
-
-
problem_25 Directory Reference
+
problem_25 Directory Reference
- - - + +

+

Files

file  sol1.c
 Problem 25 solution implemented using arbitrarily large numbers represented as arrays
file  sol1.c
 Problem 25 solution implemented using arbitrarily large numbers represented as arrays
 
@@ -107,7 +106,7 @@ Files diff --git a/dir_0bc3e2a5baf077fa21dadc079776fcac.html b/dir_0bc3e2a5baf077fa21dadc079776fcac.html index f97453b1a..bbe078a20 100644 --- a/dir_0bc3e2a5baf077fa21dadc079776fcac.html +++ b/dir_0bc3e2a5baf077fa21dadc079776fcac.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_19 Directory 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,15 +90,14 @@ $(document).ready(function(){initNavTree('dir_0bc3e2a5baf077fa21dadc079776fcac.h
-
-
problem_19 Directory Reference
+
problem_19 Directory Reference
- - - + +

+

Files

file  sol1.c
 Problem 19 solution
file  sol1.c
 Problem 19 solution
 
@@ -107,7 +106,7 @@ Files diff --git a/dir_167af11096b7752ff31b3d4bec489317.html b/dir_167af11096b7752ff31b3d4bec489317.html index 324fc842c..4f8ae57ed 100644 --- a/dir_167af11096b7752ff31b3d4bec489317.html +++ b/dir_167af11096b7752ff31b3d4bec489317.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_6 Directory 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,15 +90,14 @@ $(document).ready(function(){initNavTree('dir_167af11096b7752ff31b3d4bec489317.h
-
-
problem_6 Directory Reference
+
problem_6 Directory Reference
- - - + +

+

Files

file  sol.c
 Problem 6 solution
file  sol.c
 Problem 6 solution
 
@@ -107,7 +106,7 @@ Files diff --git a/dir_16b947d8e9a05fe119d0675493324331.html b/dir_16b947d8e9a05fe119d0675493324331.html index a9b151653..dc28db729 100644 --- a/dir_16b947d8e9a05fe119d0675493324331.html +++ b/dir_16b947d8e9a05fe119d0675493324331.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_10 Directory 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,18 +90,17 @@ $(document).ready(function(){initNavTree('dir_16b947d8e9a05fe119d0675493324331.h
-
-
problem_10 Directory Reference
+
problem_10 Directory Reference
- - - + + - - + +

+

Files

file  sol1.c
 Problem 10 solution
file  sol1.c
 Problem 10 solution
 
file  sol2.c
 Problem 10 solution
file  sol2.c
 Problem 10 solution
 
@@ -110,7 +109,7 @@ Files diff --git a/dir_16e00c78ef36d1842d0d8a4afc46b852.html b/dir_16e00c78ef36d1842d0d8a4afc46b852.html index 12e01b0f1..7704c4f0c 100644 --- a/dir_16e00c78ef36d1842d0d8a4afc46b852.html +++ b/dir_16e00c78ef36d1842d0d8a4afc46b852.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_26 Directory 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,15 +90,14 @@ $(document).ready(function(){initNavTree('dir_16e00c78ef36d1842d0d8a4afc46b852.h
-
-
problem_26 Directory Reference
+
problem_26 Directory Reference
- - - + +

+

Files

file  sol1.c
 Problem 26 solution
file  sol1.c
 Problem 26 solution
 
@@ -107,7 +106,7 @@ Files diff --git a/dir_1833eb69ceee7a265ffba4c38c8243d2.html b/dir_1833eb69ceee7a265ffba4c38c8243d2.html index 639e9b829..1b88e4d5f 100644 --- a/dir_1833eb69ceee7a265ffba4c38c8243d2.html +++ b/dir_1833eb69ceee7a265ffba4c38c8243d2.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_4 Directory 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,15 +90,14 @@ $(document).ready(function(){initNavTree('dir_1833eb69ceee7a265ffba4c38c8243d2.h
-
-
problem_4 Directory Reference
+
problem_4 Directory Reference
- - - + +

+

Files

file  sol.c
 Problem 4 solution
file  sol.c
 Problem 4 solution
 
@@ -107,7 +106,7 @@ Files diff --git a/dir_18cba55772148686552805a354a79093.html b/dir_18cba55772148686552805a354a79093.html index 10dd052ec..9de29d313 100644 --- a/dir_18cba55772148686552805a354a79093.html +++ b/dir_18cba55772148686552805a354a79093.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_16 Directory 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,15 +90,14 @@ $(document).ready(function(){initNavTree('dir_18cba55772148686552805a354a79093.h
-
-
problem_16 Directory Reference
+
problem_16 Directory Reference
- - - + +

+

Files

file  sol1.c
 Problem 16 solution
file  sol1.c
 Problem 16 solution
 
@@ -107,7 +106,7 @@ Files diff --git a/dir_2176ba3565d8b1fe2a106d18679cc7bf.html b/dir_2176ba3565d8b1fe2a106d18679cc7bf.html index 1c9fad770..bfa0e47e7 100644 --- a/dir_2176ba3565d8b1fe2a106d18679cc7bf.html +++ b/dir_2176ba3565d8b1fe2a106d18679cc7bf.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: data_structures/stack Directory 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,12 +90,11 @@ $(document).ready(function(){initNavTree('dir_2176ba3565d8b1fe2a106d18679cc7bf.h
-
-
stack Directory Reference
+
stack Directory Reference
-

+

Directories

@@ -104,7 +103,7 @@ Directories diff --git a/dir_261dd1200fad5b2fe1eca9af8320656e.html b/dir_261dd1200fad5b2fe1eca9af8320656e.html index 5ee30647f..8e50b43bc 100644 --- a/dir_261dd1200fad5b2fe1eca9af8320656e.html +++ b/dir_261dd1200fad5b2fe1eca9af8320656e.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: data_structures/linked_list Directory 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,15 +90,14 @@ $(document).ready(function(){initNavTree('dir_261dd1200fad5b2fe1eca9af8320656e.h
-
-
linked_list Directory Reference
+
linked_list Directory Reference
- - - + +

+

Files

file  doubly_linked_list.c
 Implementation of Doubly linked list
file  doubly_linked_list.c
 Implementation of Doubly linked list
 
@@ -107,7 +106,7 @@ Files diff --git a/dir_2abe2c0880d3fb0dba0f784bee3fc9e0.html b/dir_2abe2c0880d3fb0dba0f784bee3fc9e0.html index 2bec22897..715aa5d09 100644 --- a/dir_2abe2c0880d3fb0dba0f784bee3fc9e0.html +++ b/dir_2abe2c0880d3fb0dba0f784bee3fc9e0.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_22 Directory 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,15 +90,14 @@ $(document).ready(function(){initNavTree('dir_2abe2c0880d3fb0dba0f784bee3fc9e0.h
-
-
problem_22 Directory Reference
+
problem_22 Directory Reference
- - - + +

+

Files

file  sol1.c
 Problem 22 solution
file  sol1.c
 Problem 22 solution
 
@@ -107,7 +106,7 @@ Files diff --git a/dir_2b14f32f14b51065d3a322bea21da3c0.html b/dir_2b14f32f14b51065d3a322bea21da3c0.html index 793d4b9ef..7657988db 100644 --- a/dir_2b14f32f14b51065d3a322bea21da3c0.html +++ b/dir_2b14f32f14b51065d3a322bea21da3c0.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_15 Directory 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,15 +90,14 @@ $(document).ready(function(){initNavTree('dir_2b14f32f14b51065d3a322bea21da3c0.h
-
-
problem_15 Directory Reference
+
problem_15 Directory Reference
- - - + +

+

Files

file  sol1.c
 Problem 15 solution
file  sol1.c
 Problem 15 solution
 
@@ -107,7 +106,7 @@ Files diff --git a/dir_2e746e9d06bf2d8ff842208bcc6ebcfc.html b/dir_2e746e9d06bf2d8ff842208bcc6ebcfc.html index d2b89b49b..c6f64d276 100644 --- a/dir_2e746e9d06bf2d8ff842208bcc6ebcfc.html +++ b/dir_2e746e9d06bf2d8ff842208bcc6ebcfc.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: data_structures Directory 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,12 +90,11 @@ $(document).ready(function(){initNavTree('dir_2e746e9d06bf2d8ff842208bcc6ebcfc.h
-
-
data_structures Directory Reference
+
data_structures Directory Reference
-

+

Directories

@@ -104,7 +103,7 @@ Directories diff --git a/dir_2e746e9d06bf2d8ff842208bcc6ebcfc.js b/dir_2e746e9d06bf2d8ff842208bcc6ebcfc.js index 97ed057af..f2e1b7314 100644 --- a/dir_2e746e9d06bf2d8ff842208bcc6ebcfc.js +++ b/dir_2e746e9d06bf2d8ff842208bcc6ebcfc.js @@ -8,5 +8,6 @@ var dir_2e746e9d06bf2d8ff842208bcc6ebcfc = [ "hash_set", "dir_955029374964e51cf770754b424e7d39.html", "dir_955029374964e51cf770754b424e7d39" ], [ "linked_list", "dir_261dd1200fad5b2fe1eca9af8320656e.html", "dir_261dd1200fad5b2fe1eca9af8320656e" ], [ "list", "dir_b6018f60d424a2ef7e4c942ac681e38b.html", "dir_b6018f60d424a2ef7e4c942ac681e38b" ], + [ "queue", "dir_fb09f588f9daea69f78b63a0310e98cc.html", "dir_fb09f588f9daea69f78b63a0310e98cc" ], [ "stack", "dir_2176ba3565d8b1fe2a106d18679cc7bf.html", "dir_2176ba3565d8b1fe2a106d18679cc7bf" ] ]; \ No newline at end of file diff --git a/dir_2f070f19f76dfadabbc24fe483d7e98d.html b/dir_2f070f19f76dfadabbc24fe483d7e98d.html index 85c06be09..d434c8027 100644 --- a/dir_2f070f19f76dfadabbc24fe483d7e98d.html +++ b/dir_2f070f19f76dfadabbc24fe483d7e98d.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_401 Directory 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,15 +90,14 @@ $(document).ready(function(){initNavTree('dir_2f070f19f76dfadabbc24fe483d7e98d.h
-
-
problem_401 Directory Reference
+
problem_401 Directory Reference
- - - + +

+

Files

file  sol1.c
 Problem 401 solution - Sum of squares of divisors
file  sol1.c
 Problem 401 solution - Sum of squares of divisors
 
@@ -107,7 +106,7 @@ Files diff --git a/dir_2fede762f95c9c526850a639b984c56b.html b/dir_2fede762f95c9c526850a639b984c56b.html index 92888eaaf..7f0bbf6ab 100644 --- a/dir_2fede762f95c9c526850a639b984c56b.html +++ b/dir_2fede762f95c9c526850a639b984c56b.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: data_structures/graphs Directory 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('dir_2fede762f95c9c526850a639b984c56b.h
-
-
graphs Directory Reference
+
graphs Directory Reference
@@ -100,7 +99,7 @@ $(document).ready(function(){initNavTree('dir_2fede762f95c9c526850a639b984c56b.h diff --git a/dir_32e2b2b829773774d6890224447e777d.html b/dir_32e2b2b829773774d6890224447e777d.html index bcf69ccf1..5df35d207 100644 --- a/dir_32e2b2b829773774d6890224447e777d.html +++ b/dir_32e2b2b829773774d6890224447e777d.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: data_structures/heap Directory 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('dir_32e2b2b829773774d6890224447e777d.h
-
-
heap Directory Reference
+
heap Directory Reference
@@ -100,7 +99,7 @@ $(document).ready(function(){initNavTree('dir_32e2b2b829773774d6890224447e777d.h diff --git a/dir_3343723ae086de42ee4ca9774da3a13f.html b/dir_3343723ae086de42ee4ca9774da3a13f.html index ca4ca9074..edb7875e4 100644 --- a/dir_3343723ae086de42ee4ca9774da3a13f.html +++ b/dir_3343723ae086de42ee4ca9774da3a13f.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: machine_learning Directory 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('dir_3343723ae086de42ee4ca9774da3a13f.h
-
-
machine_learning Directory Reference
+
machine_learning Directory Reference
- - - + + - + - - + + - - + +

+

Files

file  adaline_learning.c
 Adaptive Linear Neuron (ADALINE) implementation
file  adaline_learning.c
 Adaptive Linear Neuron (ADALINE) implementation
 
file  k_means_clustering.c
file  k_means_clustering.c
 K Means Clustering Algorithm implemented.
 
file  kohonen_som_topology.c
 Kohonen self organizing map (topological map)
file  kohonen_som_topology.c
 Kohonen self organizing map (topological map)
 
file  kohonen_som_trace.c
 Kohonen self organizing map (data tracing)
file  kohonen_som_trace.c
 Kohonen self organizing map (data tracing)
 
@@ -116,7 +115,7 @@ Files diff --git a/dir_3c8f35d77556eca8a7a90921c2c197ad.html b/dir_3c8f35d77556eca8a7a90921c2c197ad.html index 1fc22e24e..60f7d1409 100644 --- a/dir_3c8f35d77556eca8a7a90921c2c197ad.html +++ b/dir_3c8f35d77556eca8a7a90921c2c197ad.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: searching/pattern_search Directory 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('dir_3c8f35d77556eca8a7a90921c2c197ad.h
-
-
pattern_search Directory Reference
+
pattern_search Directory Reference
@@ -100,7 +99,7 @@ $(document).ready(function(){initNavTree('dir_3c8f35d77556eca8a7a90921c2c197ad.h diff --git a/dir_4500de955d1eddb82f69331d96e39ed9.html b/dir_4500de955d1eddb82f69331d96e39ed9.html index 7991a7ebb..74e32552e 100644 --- a/dir_4500de955d1eddb82f69331d96e39ed9.html +++ b/dir_4500de955d1eddb82f69331d96e39ed9.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: exercism/hello_world Directory 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('dir_4500de955d1eddb82f69331d96e39ed9.h
-
-
hello_world Directory Reference
+
hello_world Directory Reference
@@ -100,7 +99,7 @@ $(document).ready(function(){initNavTree('dir_4500de955d1eddb82f69331d96e39ed9.h diff --git a/dir_475f56e0a4ef6254f5610544d8d68aa3.html b/dir_475f56e0a4ef6254f5610544d8d68aa3.html index 0882b285f..b7d135e9d 100644 --- a/dir_475f56e0a4ef6254f5610544d8d68aa3.html +++ b/dir_475f56e0a4ef6254f5610544d8d68aa3.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: exercism/word_count Directory 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('dir_475f56e0a4ef6254f5610544d8d68aa3.h
-
-
word_count Directory Reference
+
word_count Directory Reference
@@ -100,7 +99,7 @@ $(document).ready(function(){initNavTree('dir_475f56e0a4ef6254f5610544d8d68aa3.h diff --git a/dir_48bf5503321d91c557399989fed5dabd.html b/dir_48bf5503321d91c557399989fed5dabd.html index 8718730a7..9df5dcc9c 100644 --- a/dir_48bf5503321d91c557399989fed5dabd.html +++ b/dir_48bf5503321d91c557399989fed5dabd.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: exercism Directory 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,12 +90,11 @@ $(document).ready(function(){initNavTree('dir_48bf5503321d91c557399989fed5dabd.h
-
-
exercism Directory Reference
+
exercism Directory Reference
-

+

Directories

@@ -104,7 +103,7 @@ Directories diff --git a/dir_4991c92e00761dd3d764efa2906b4318.html b/dir_4991c92e00761dd3d764efa2906b4318.html index e8d8bd100..3e3ead351 100644 --- a/dir_4991c92e00761dd3d764efa2906b4318.html +++ b/dir_4991c92e00761dd3d764efa2906b4318.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_20 Directory 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,15 +90,14 @@ $(document).ready(function(){initNavTree('dir_4991c92e00761dd3d764efa2906b4318.h
-
-
problem_20 Directory Reference
+
problem_20 Directory Reference
- - - + +

+

Files

file  sol1.c
 Problem 20 solution
file  sol1.c
 Problem 20 solution
 
@@ -107,7 +106,7 @@ Files diff --git a/dir_4a15c8553efb9e59e3f1091cc0d3a27d.html b/dir_4a15c8553efb9e59e3f1091cc0d3a27d.html index 6e7c7960d..d7974430f 100644 --- a/dir_4a15c8553efb9e59e3f1091cc0d3a27d.html +++ b/dir_4a15c8553efb9e59e3f1091cc0d3a27d.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_8 Directory 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,18 +90,17 @@ $(document).ready(function(){initNavTree('dir_4a15c8553efb9e59e3f1091cc0d3a27d.h
-
-
problem_8 Directory Reference
+
problem_8 Directory Reference
- - - + + - - + +

+

Files

file  sol1.c
 Problem 8 solution
file  sol1.c
 Problem 8 solution
 
file  sol2.c
 Problem 8 solution
file  sol2.c
 Problem 8 solution
 
@@ -110,7 +109,7 @@ Files diff --git a/dir_4b6f782e158b0b98da980a0e11a23a15.html b/dir_4b6f782e158b0b98da980a0e11a23a15.html index 8f06266d9..89185a092 100644 --- a/dir_4b6f782e158b0b98da980a0e11a23a15.html +++ b/dir_4b6f782e158b0b98da980a0e11a23a15.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: games Directory 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,15 +90,14 @@ $(document).ready(function(){initNavTree('dir_4b6f782e158b0b98da980a0e11a23a15.h
-
-
games Directory Reference
+
games Directory Reference
- - - + +

+

Files

file  naval_battle.c
 naval_battle implementation in C using only the stdio.h for Standard Input and Output.
file  naval_battle.c
 naval_battle implementation in C using only the stdio.h for Standard Input and Output.
 
@@ -107,7 +106,7 @@ Files diff --git a/dir_4bae997a2671812c2140d5abfb6305a4.html b/dir_4bae997a2671812c2140d5abfb6305a4.html index 6a6424e6b..087edbb95 100644 --- a/dir_4bae997a2671812c2140d5abfb6305a4.html +++ b/dir_4bae997a2671812c2140d5abfb6305a4.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_7 Directory 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,18 +90,17 @@ $(document).ready(function(){initNavTree('dir_4bae997a2671812c2140d5abfb6305a4.h
-
-
problem_7 Directory Reference
+
problem_7 Directory Reference
- - - + + - - + +

+

Files

file  sol.c
 Problem 7 solution.
file  sol.c
 Problem 7 solution.
 
file  sol2.c
 Problem 7 solution.
file  sol2.c
 Problem 7 solution.
 
@@ -110,7 +109,7 @@ Files diff --git a/dir_607f15d36c772334f988bb9ef82d102c.html b/dir_607f15d36c772334f988bb9ef82d102c.html index b0d16220d..f480ee815 100644 --- a/dir_607f15d36c772334f988bb9ef82d102c.html +++ b/dir_607f15d36c772334f988bb9ef82d102c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_5 Directory 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,21 +90,20 @@ $(document).ready(function(){initNavTree('dir_607f15d36c772334f988bb9ef82d102c.h
-
-
problem_5 Directory Reference
+
problem_5 Directory Reference
- - - + + - - + + - - + +

+

Files

file  sol1.c
 Problem 5 solution - Naive algorithm (slowest)
file  sol1.c
 Problem 5 solution - Naive algorithm (slowest)
 
file  sol2.c
 Problem 5 solution - Naive algorithm (Improved over problem_5/sol1.c)
file  sol2.c
 Problem 5 solution - Naive algorithm (Improved over problem_5/sol1.c)
 
file  sol3.c
 Problem 5 solution (Fastest).
file  sol3.c
 Problem 5 solution (Fastest).
 
@@ -113,7 +112,7 @@ Files diff --git a/dir_614f310c248f2b9541b559085cafcb40.html b/dir_614f310c248f2b9541b559085cafcb40.html index 44431693d..0661f2243 100644 --- a/dir_614f310c248f2b9541b559085cafcb40.html +++ b/dir_614f310c248f2b9541b559085cafcb40.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: leetcode/src Directory 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('dir_614f310c248f2b9541b559085cafcb40.h
-
-
src Directory Reference
+
src Directory Reference
@@ -100,7 +99,7 @@ $(document).ready(function(){initNavTree('dir_614f310c248f2b9541b559085cafcb40.h diff --git a/dir_72aaf47615111200018c039a56ef48be.html b/dir_72aaf47615111200018c039a56ef48be.html index 611c203f0..03d73c1a5 100644 --- a/dir_72aaf47615111200018c039a56ef48be.html +++ b/dir_72aaf47615111200018c039a56ef48be.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: hash Directory 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,27 +90,26 @@ $(document).ready(function(){initNavTree('dir_72aaf47615111200018c039a56ef48be.h
-
-
hash Directory Reference
+
hash Directory Reference
- - - + + - - + + - - + + - - + + - - + +

+

Files

file  hash_adler32.c
 32-bit Adler hash algorithm
file  hash_adler32.c
 32-bit Adler hash algorithm
 
file  hash_crc32.c
 32-bit CRC hash algorithm
file  hash_crc32.c
 32-bit CRC hash algorithm
 
file  hash_djb2.c
 DJB2 hash algorithm
file  hash_djb2.c
 DJB2 hash algorithm
 
file  hash_sdbm.c
 SDBM hash algorithm
file  hash_sdbm.c
 SDBM hash algorithm
 
file  hash_xor8.c
 8-bit XOR hash algorithm for ASCII characters
file  hash_xor8.c
 8-bit XOR hash algorithm for ASCII characters
 
@@ -119,7 +118,7 @@ Files diff --git a/dir_7445e5a68245b48f3c03982b6d501815.html b/dir_7445e5a68245b48f3c03982b6d501815.html index e596abaad..4d13bb328 100644 --- a/dir_7445e5a68245b48f3c03982b6d501815.html +++ b/dir_7445e5a68245b48f3c03982b6d501815.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: data_structures/dictionary Directory 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('dir_7445e5a68245b48f3c03982b6d501815.h
-
-
dictionary Directory Reference
+
dictionary Directory Reference
@@ -100,7 +99,7 @@ $(document).ready(function(){initNavTree('dir_7445e5a68245b48f3c03982b6d501815.h diff --git a/dir_76784a7b04633629b9ecb5543b9ad889.html b/dir_76784a7b04633629b9ecb5543b9ad889.html index a1abd9779..8c7cef826 100644 --- a/dir_76784a7b04633629b9ecb5543b9ad889.html +++ b/dir_76784a7b04633629b9ecb5543b9ad889.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: exercism/isogram Directory 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('dir_76784a7b04633629b9ecb5543b9ad889.h
-
-
isogram Directory Reference
+
isogram Directory Reference
@@ -100,7 +99,7 @@ $(document).ready(function(){initNavTree('dir_76784a7b04633629b9ecb5543b9ad889.h diff --git a/dir_81f43aa0067826ea5befe80cd7aefcc5.html b/dir_81f43aa0067826ea5befe80cd7aefcc5.html index b37b7c236..4fb1c8511 100644 --- a/dir_81f43aa0067826ea5befe80cd7aefcc5.html +++ b/dir_81f43aa0067826ea5befe80cd7aefcc5.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: exercism/rna_transcription Directory 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('dir_81f43aa0067826ea5befe80cd7aefcc5.h
-
-
rna_transcription Directory Reference
+
rna_transcription Directory Reference
@@ -100,7 +99,7 @@ $(document).ready(function(){initNavTree('dir_81f43aa0067826ea5befe80cd7aefcc5.h diff --git a/dir_8c6743d405e8ed13cc39f42e382307fd.html b/dir_8c6743d405e8ed13cc39f42e382307fd.html index 87aeba55d..935f3c74e 100644 --- a/dir_8c6743d405e8ed13cc39f42e382307fd.html +++ b/dir_8c6743d405e8ed13cc39f42e382307fd.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_1 Directory 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('dir_8c6743d405e8ed13cc39f42e382307fd.h
-
-
problem_1 Directory Reference
+
problem_1 Directory Reference
- - - + + - - + + - - + + - - + +

+

Files

file  sol1.c
 Problem 1 solution
file  sol1.c
 Problem 1 solution
 
file  sol2.c
 Problem 1 solution
file  sol2.c
 Problem 1 solution
 
file  sol3.c
 Problem 1 solution.
file  sol3.c
 Problem 1 solution.
 
file  sol4.c
 Problem 1 solution
file  sol4.c
 Problem 1 solution
 
@@ -116,7 +115,7 @@ Files diff --git a/dir_955029374964e51cf770754b424e7d39.html b/dir_955029374964e51cf770754b424e7d39.html index 5ee1a72b9..db0390f1f 100644 --- a/dir_955029374964e51cf770754b424e7d39.html +++ b/dir_955029374964e51cf770754b424e7d39.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: data_structures/hash_set Directory 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('dir_955029374964e51cf770754b424e7d39.h
-
-
hash_set Directory Reference
+
hash_set Directory Reference
@@ -100,7 +99,7 @@ $(document).ready(function(){initNavTree('dir_955029374964e51cf770754b424e7d39.h diff --git a/dir_9babc524d57e25f3d9f4179cabc3599e.html b/dir_9babc524d57e25f3d9f4179cabc3599e.html index e8b300025..b758cf56d 100644 --- a/dir_9babc524d57e25f3d9f4179cabc3599e.html +++ b/dir_9babc524d57e25f3d9f4179cabc3599e.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: conversions Directory 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,29 +90,34 @@ $(document).ready(function(){initNavTree('dir_9babc524d57e25f3d9f4179cabc3599e.h
-
-
conversions Directory Reference
+
conversions Directory Reference
- - + - + + + + - + - - + + - + + + + - +

+

Files

file  c_atoi_str_to_integer.c
file  c_atoi_str_to_integer.c
 Recoding the original atoi function in stdlib.h.
 
file  decimal_to_binary_recursion.c
file  decimal_to_any_base.c
 Decimal to any-base is a C function wich convert positive decimal integer to any positive ascii base with the base's alphabet given in input and return it in a dynamically allocated string(recursive way)
 
file  decimal_to_binary_recursion.c
 Convert decimal to binary using recursion algorithm.
 
file  hexadecimal_to_octal2.c
file  hexadecimal_to_octal2.c
 Convert hexadecimal number to octal number (with decimal intermediary)
 
file  infix_to_postfix.c
 Infix to Postfix Expression Conversion
file  infix_to_postfix.c
 Infix to Postfix Expression Conversion
 
file  int_to_string.c
file  infix_to_postfix2.c
 Infix to Postfix converter implementation
 
file  int_to_string.c
 Convert a positive integer to string (non-standard function) representation.
 
file  octal_to_hexadecimal.c
file  octal_to_hexadecimal.c
 Octal to hexadecimal conversion by scanning user input.
 
@@ -122,7 +127,7 @@ Files diff --git a/dir_9babc524d57e25f3d9f4179cabc3599e.js b/dir_9babc524d57e25f3d9f4179cabc3599e.js index 5a02b0ca1..e7b4138dd 100644 --- a/dir_9babc524d57e25f3d9f4179cabc3599e.js +++ b/dir_9babc524d57e25f3d9f4179cabc3599e.js @@ -1,9 +1,11 @@ var dir_9babc524d57e25f3d9f4179cabc3599e = [ [ "c_atoi_str_to_integer.c", "d7/dd8/c__atoi__str__to__integer_8c.html", "d7/dd8/c__atoi__str__to__integer_8c" ], + [ "decimal_to_any_base.c", "d1/dba/decimal__to__any__base_8c.html", "d1/dba/decimal__to__any__base_8c" ], [ "decimal_to_binary_recursion.c", "d8/d30/decimal__to__binary__recursion_8c.html", "d8/d30/decimal__to__binary__recursion_8c" ], [ "hexadecimal_to_octal2.c", "d0/dd9/hexadecimal__to__octal2_8c.html", "d0/dd9/hexadecimal__to__octal2_8c" ], [ "infix_to_postfix.c", "db/d0c/infix__to__postfix_8c.html", "db/d0c/infix__to__postfix_8c" ], + [ "infix_to_postfix2.c", "da/d96/infix__to__postfix2_8c.html", "da/d96/infix__to__postfix2_8c" ], [ "int_to_string.c", "dd/d53/int__to__string_8c.html", "dd/d53/int__to__string_8c" ], [ "octal_to_hexadecimal.c", "d0/d8a/octal__to__hexadecimal_8c.html", "d0/d8a/octal__to__hexadecimal_8c" ] ]; \ No newline at end of file diff --git a/dir_9c6faab82c22511b50177aa2e38e2780.html b/dir_9c6faab82c22511b50177aa2e38e2780.html index 0cfd90f4e..07706f8a8 100644 --- a/dir_9c6faab82c22511b50177aa2e38e2780.html +++ b/dir_9c6faab82c22511b50177aa2e38e2780.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: numerical_methods Directory 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,41 +90,40 @@ $(document).ready(function(){initNavTree('dir_9c6faab82c22511b50177aa2e38e2780.h
-
-
numerical_methods Directory Reference
+
numerical_methods Directory Reference
- - - + + - - + + - + - - + + - - + + - - + + - - + + - - + + - - + + - +

+

Files

file  durand_kerner_roots.c
 Compute all possible approximate roots of any given polynomial using Durand Kerner algorithm
file  durand_kerner_roots.c
 Compute all possible approximate roots of any given polynomial using Durand Kerner algorithm
 
file  lu_decompose.c
 LU decomposition of a square matrix
file  lu_decompose.c
 LU decomposition of a square matrix
 
file  newton_raphson_root.c
file  newton_raphson_root.c
 Find approximate solution for \(f(x) = 0\) using Newton-Raphson interpolation algorithm.
 
file  ode_forward_euler.c
 Solve a multivariable first order ordinary differential equation (ODEs) using forward Euler method
file  ode_forward_euler.c
 Solve a multivariable first order ordinary differential equation (ODEs) using forward Euler method
 
file  ode_midpoint_euler.c
 Solve a multivariable first order ordinary differential equation (ODEs) using midpoint Euler method
file  ode_midpoint_euler.c
 Solve a multivariable first order ordinary differential equation (ODEs) using midpoint Euler method
 
file  ode_semi_implicit_euler.c
 Solve a multivariable first order ordinary differential equation (ODEs) using semi implicit Euler method
file  ode_semi_implicit_euler.c
 Solve a multivariable first order ordinary differential equation (ODEs) using semi implicit Euler method
 
file  qr_decompose.h [code]
 Library functions to compute QR decomposition of a given matrix.
file  qr_decompose.h [code]
 Library functions to compute QR decomposition of a given matrix.
 
file  qr_decomposition.c
 Program to compute the QR decomposition of a given matrix.
file  qr_decomposition.c
 Program to compute the QR decomposition of a given matrix.
 
file  qr_eigen_values.c
 Compute real eigen values and eigen vectors of a symmetric matrix using QR decomposition method.
file  qr_eigen_values.c
 Compute real eigen values and eigen vectors of a symmetric matrix using QR decomposition method.
 
file  realtime_stats.c
file  realtime_stats.c
 Compute statistics for data entered in rreal-time.
 
@@ -134,7 +133,7 @@ Files diff --git a/dir_a4300992e825aa9b9238bf43160a241e.html b/dir_a4300992e825aa9b9238bf43160a241e.html index f20dbc157..f29239070 100644 --- a/dir_a4300992e825aa9b9238bf43160a241e.html +++ b/dir_a4300992e825aa9b9238bf43160a241e.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: greedy_approach Directory 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,17 +90,23 @@ $(document).ready(function(){initNavTree('dir_a4300992e825aa9b9238bf43160a241e.h
-
-
greedy_approach Directory Reference
+
greedy_approach Directory Reference
+ + + + + +

+Files

file  prim.c
 Prim's algorithm implementation in C to find the MST of a weighted, connected graph.
 
diff --git a/dir_a4300992e825aa9b9238bf43160a241e.js b/dir_a4300992e825aa9b9238bf43160a241e.js new file mode 100644 index 000000000..a0f10a87d --- /dev/null +++ b/dir_a4300992e825aa9b9238bf43160a241e.js @@ -0,0 +1,4 @@ +var dir_a4300992e825aa9b9238bf43160a241e = +[ + [ "prim.c", "d9/dcc/prim_8c.html", "d9/dcc/prim_8c" ] +]; \ No newline at end of file diff --git a/dir_a52f4d3d586a58b02f3a4ddf0a992157.html b/dir_a52f4d3d586a58b02f3a4ddf0a992157.html index 0a8601e6a..dbaca1f17 100644 --- a/dir_a52f4d3d586a58b02f3a4ddf0a992157.html +++ b/dir_a52f4d3d586a58b02f3a4ddf0a992157.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: misc Directory 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,48 +90,50 @@ $(document).ready(function(){initNavTree('dir_a52f4d3d586a58b02f3a4ddf0a992157.h
-
-
misc Directory Reference
+
misc Directory Reference
- - - + + - + - - + + - + - + - - + + - - + + - - + + - - + + - + + + + - + - - + +

+

Files

file  cantor_set.c
 Program to generate Cantor ternary set
file  cantor_set.c
 Program to generate Cantor ternary set
 
file  cartesian_to_polar.c
file  cartesian_to_polar.c
 Function to convert a Cartesian co-ordinate to polar form.
 
file  collatz.c
 Implementation of Collatz' conjecture
file  collatz.c
 Implementation of Collatz' conjecture
 
file  factorial_large_number.c
file  factorial_large_number.c
 Compute factorial of arbitrarily large numbers by storing individual digits in a byte.
 
file  fibonacci_fast.c
file  fibonacci_fast.c
 Compute \(m^{mth}\) Fibonacci number using the formulae:
 
file  palindrome.c
 Program to identify if a number is palindrome number or not.
file  palindrome.c
 Program to identify if a number is palindrome number or not.
 
file  poly_add.c
 Implementation of Addition of two polynomials
file  poly_add.c
 Implementation of Addition of two polynomials
 
file  prime.c
 Program to identify if a number is prime number or not.
file  postfix_evaluation.c
 Postfix evaluation algorithm implementation
 
file  prime_seive.c
 Prime Seive algorithm implementation.
file  prime.c
 Program to identify if a number is prime number or not.
 
file  strong_number.c
file  prime_seive.c
 Prime Seive algorithm implementation.
 
file  strong_number.c
 Strong number is a number whose sum of all digits’ factorial is equal to the number n For example: 145 = 1!(1) + 4!(24) + 5!(120)
 
file  sudoku_solver.c
file  sudoku_solver.c
 Sudoku Solver using recursive implementation of brute-force algorithm.
 
file  union_find.c
 Union find algorithm.
file  union_find.c
 Union find algorithm.
 
@@ -140,7 +142,7 @@ Files diff --git a/dir_a52f4d3d586a58b02f3a4ddf0a992157.js b/dir_a52f4d3d586a58b02f3a4ddf0a992157.js index e76f729bb..99382d501 100644 --- a/dir_a52f4d3d586a58b02f3a4ddf0a992157.js +++ b/dir_a52f4d3d586a58b02f3a4ddf0a992157.js @@ -7,6 +7,7 @@ var dir_a52f4d3d586a58b02f3a4ddf0a992157 = [ "fibonacci_fast.c", "d4/d99/fibonacci__fast_8c.html", "d4/d99/fibonacci__fast_8c" ], [ "palindrome.c", "df/d16/palindrome_8c.html", "df/d16/palindrome_8c" ], [ "poly_add.c", "d0/dcb/poly__add_8c.html", "d0/dcb/poly__add_8c" ], + [ "postfix_evaluation.c", "df/d43/postfix__evaluation_8c.html", "df/d43/postfix__evaluation_8c" ], [ "prime.c", "da/d93/prime_8c.html", "da/d93/prime_8c" ], [ "prime_seive.c", "db/dd5/prime__seive_8c.html", "db/dd5/prime__seive_8c" ], [ "strong_number.c", "d4/dcc/strong__number_8c.html", "d4/dcc/strong__number_8c" ], diff --git a/dir_a5f32cf82ad289a7dac212f63f40f55b.html b/dir_a5f32cf82ad289a7dac212f63f40f55b.html new file mode 100644 index 000000000..349968cd2 --- /dev/null +++ b/dir_a5f32cf82ad289a7dac212f63f40f55b.html @@ -0,0 +1,113 @@ + + + + + + + +Algorithms_in_C: audio Directory Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Algorithms_in_C 1.0.0 +
+
Set of algorithms implemented in C.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
audio Directory Reference
+
+
+ + + + + +

+Files

file  alaw.c
 A-law algorithm for encoding and decoding (16bit pcm <=> a-law). This is the implementation of G.711 in C.
 
+
+
+ + + + diff --git a/dir_a5f32cf82ad289a7dac212f63f40f55b.js b/dir_a5f32cf82ad289a7dac212f63f40f55b.js new file mode 100644 index 000000000..b7e76fd49 --- /dev/null +++ b/dir_a5f32cf82ad289a7dac212f63f40f55b.js @@ -0,0 +1,4 @@ +var dir_a5f32cf82ad289a7dac212f63f40f55b = +[ + [ "alaw.c", "df/d27/alaw_8c.html", "df/d27/alaw_8c" ] +]; \ No newline at end of file diff --git a/dir_aba97bf327db94061e830e9bc18e925d.html b/dir_aba97bf327db94061e830e9bc18e925d.html index 79ca59ce1..b02969db2 100644 --- a/dir_aba97bf327db94061e830e9bc18e925d.html +++ b/dir_aba97bf327db94061e830e9bc18e925d.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_14 Directory 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,15 +90,14 @@ $(document).ready(function(){initNavTree('dir_aba97bf327db94061e830e9bc18e925d.h
-
-
problem_14 Directory Reference
+
problem_14 Directory Reference
- - - + +

+

Files

file  sol1.c
 Problem 14 solution
file  sol1.c
 Problem 14 solution
 
@@ -107,7 +106,7 @@ Files diff --git a/dir_abf1a26ece768c4076e73592705ae077.html b/dir_abf1a26ece768c4076e73592705ae077.html index 1490fb1fc..c22383ee8 100644 --- a/dir_abf1a26ece768c4076e73592705ae077.html +++ b/dir_abf1a26ece768c4076e73592705ae077.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: developer_tools Directory 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,27 @@ $(document).ready(function(){initNavTree('dir_abf1a26ece768c4076e73592705ae077.h
-
-
developer_tools Directory Reference
+
developer_tools Directory Reference
- - + - + - + + + + + + +

+

Files

file  malloc_dbg.c
file  malloc_dbg.c
 This file contains malloc_dbg, calloc_dbg, free_dbg and printLeaks implementations.
 
file  malloc_dbg.h [code]
file  malloc_dbg.h [code]
 Header file that contains macros used to replace malloc/calloc and free.
 
file  test_malloc_dbg.c
file  min_printf.h [code]
 Implementation of a function similar to printf
 
file  test_malloc_dbg.c
 File used to test the malloc_dbg, calloc_dbg and free_dbg functions.
 
file  test_min_printf.c
 File used to test min_printf function.
 
@@ -113,7 +118,7 @@ Files diff --git a/dir_abf1a26ece768c4076e73592705ae077.js b/dir_abf1a26ece768c4076e73592705ae077.js index 059e5ea16..3f2cc7d65 100644 --- a/dir_abf1a26ece768c4076e73592705ae077.js +++ b/dir_abf1a26ece768c4076e73592705ae077.js @@ -2,5 +2,7 @@ var dir_abf1a26ece768c4076e73592705ae077 = [ [ "malloc_dbg.c", "db/d84/malloc__dbg_8c.html", "db/d84/malloc__dbg_8c" ], [ "malloc_dbg.h", "d2/ddd/malloc__dbg_8h.html", "d2/ddd/malloc__dbg_8h" ], - [ "test_malloc_dbg.c", "dd/d11/test__malloc__dbg_8c.html", "dd/d11/test__malloc__dbg_8c" ] + [ "min_printf.h", "d9/deb/min__printf_8h.html", "d9/deb/min__printf_8h" ], + [ "test_malloc_dbg.c", "dd/d11/test__malloc__dbg_8c.html", "dd/d11/test__malloc__dbg_8c" ], + [ "test_min_printf.c", "d5/d5c/test__min__printf_8c.html", "d5/d5c/test__min__printf_8c" ] ]; \ No newline at end of file diff --git a/dir_b2dbfa46230fd9f775c32c1836ed3764.html b/dir_b2dbfa46230fd9f775c32c1836ed3764.html index a3196e323..220902dba 100644 --- a/dir_b2dbfa46230fd9f775c32c1836ed3764.html +++ b/dir_b2dbfa46230fd9f775c32c1836ed3764.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_3 Directory 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,18 +90,17 @@ $(document).ready(function(){initNavTree('dir_b2dbfa46230fd9f775c32c1836ed3764.h
-
-
problem_3 Directory Reference
+
problem_3 Directory Reference
- - - + + - - + +

+

Files

file  sol1.c
 Problem 3 solution
file  sol1.c
 Problem 3 solution
 
file  sol2.c
 Problem 3 solution
file  sol2.c
 Problem 3 solution
 
@@ -110,7 +109,7 @@ Files diff --git a/dir_b3d331eabd4234f247030c297aaf021c.html b/dir_b3d331eabd4234f247030c297aaf021c.html index 2d2aad1ca..83e06e626 100644 --- a/dir_b3d331eabd4234f247030c297aaf021c.html +++ b/dir_b3d331eabd4234f247030c297aaf021c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler Directory 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,12 +90,11 @@ $(document).ready(function(){initNavTree('dir_b3d331eabd4234f247030c297aaf021c.h
-
-
project_euler Directory Reference
+
project_euler Directory Reference
-

+

Directories

@@ -104,7 +103,7 @@ Directories diff --git a/dir_b6018f60d424a2ef7e4c942ac681e38b.html b/dir_b6018f60d424a2ef7e4c942ac681e38b.html index 0f0a9f92e..6e434031a 100644 --- a/dir_b6018f60d424a2ef7e4c942ac681e38b.html +++ b/dir_b6018f60d424a2ef7e4c942ac681e38b.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: data_structures/list Directory 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('dir_b6018f60d424a2ef7e4c942ac681e38b.h
-
-
list Directory Reference
+
list Directory Reference
@@ -100,7 +99,7 @@ $(document).ready(function(){initNavTree('dir_b6018f60d424a2ef7e4c942ac681e38b.h diff --git a/dir_bb1b521853a9c46347182a9d10420771.html b/dir_bb1b521853a9c46347182a9d10420771.html index f7145110e..8f8db3dd1 100644 --- a/dir_bb1b521853a9c46347182a9d10420771.html +++ b/dir_bb1b521853a9c46347182a9d10420771.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: sorting Directory 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,42 +90,47 @@ $(document).ready(function(){initNavTree('dir_bb1b521853a9c46347182a9d10420771.h
-
-
sorting Directory Reference
+
sorting Directory Reference
- - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + +

+

Files

file  bead_sort.c
 Sorting of array list using bead sort
file  bead_sort.c
 Sorting of array list using bead sort
 
file  bubble_sort.c
 Bubble sort algorithm implementation
file  bubble_sort.c
 Bubble sort algorithm implementation
 
file  bubble_sort_2.c
 implementation of Bubble sort algorithm
file  bubble_sort_2.c
 implementation of Bubble sort algorithm
 
file  bubble_sort_recursion.c
 Bubble sort algorithm implementation using recursion.
file  bubble_sort_recursion.c
 Bubble sort algorithm implementation using recursion.
 
file  insertion_sort.c
 Insertion sort algorithm implementation.
file  heap_sort_2.c
 Heap Sort implementation
 
file  insertion_sort_recursive.c
 Insertion sort algorithm implementation.
file  insertion_sort.c
 Insertion sort algorithm implementation.
 
file  merge_sort.c
 Implementation of merge sort algorithm.
file  insertion_sort_recursive.c
 Insertion sort algorithm implementation.
 
file  selection_sort.c
 Selection sort algorithm implementation.
file  merge_sort.c
 Implementation of merge sort algorithm.
 
file  selection_sort_recursive.c
 Selection Sort implementation using recursion.
file  odd_even_sort.c
 Odd Even Sort implementation
 
file  shell_sort2.c
 Shell sort algorithm implementation.
file  selection_sort.c
 Selection sort algorithm implementation.
 
file  selection_sort_recursive.c
 Selection Sort implementation using recursion.
 
file  shell_sort2.c
 Shell sort algorithm implementation.
 
@@ -134,7 +139,7 @@ Files diff --git a/dir_bb1b521853a9c46347182a9d10420771.js b/dir_bb1b521853a9c46347182a9d10420771.js index 7f843e521..e8eac86ca 100644 --- a/dir_bb1b521853a9c46347182a9d10420771.js +++ b/dir_bb1b521853a9c46347182a9d10420771.js @@ -4,9 +4,11 @@ var dir_bb1b521853a9c46347182a9d10420771 = [ "bubble_sort.c", "dd/de4/bubble__sort_8c.html", "dd/de4/bubble__sort_8c" ], [ "bubble_sort_2.c", "d2/d6d/bubble__sort__2_8c.html", "d2/d6d/bubble__sort__2_8c" ], [ "bubble_sort_recursion.c", "d5/d38/bubble__sort__recursion_8c.html", "d5/d38/bubble__sort__recursion_8c" ], + [ "heap_sort_2.c", "de/dff/heap__sort__2_8c.html", "de/dff/heap__sort__2_8c" ], [ "insertion_sort.c", "db/ddf/insertion__sort_8c.html", "db/ddf/insertion__sort_8c" ], [ "insertion_sort_recursive.c", "de/d0c/insertion__sort__recursive_8c.html", "de/d0c/insertion__sort__recursive_8c" ], [ "merge_sort.c", "d2/d83/merge__sort_8c.html", "d2/d83/merge__sort_8c" ], + [ "odd_even_sort.c", "d1/d94/odd__even__sort_8c.html", "d1/d94/odd__even__sort_8c" ], [ "selection_sort.c", "df/d83/selection__sort_8c.html", "df/d83/selection__sort_8c" ], [ "selection_sort_recursive.c", "dc/d39/selection__sort__recursive_8c.html", "dc/d39/selection__sort__recursive_8c" ], [ "shell_sort2.c", "d6/ded/shell__sort2_8c.html", "d6/ded/shell__sort2_8c" ] diff --git a/dir_bd4a7dd282074645ef41b1ea31ac813a.html b/dir_bd4a7dd282074645ef41b1ea31ac813a.html index 1618691ee..29e61c7e4 100644 --- a/dir_bd4a7dd282074645ef41b1ea31ac813a.html +++ b/dir_bd4a7dd282074645ef41b1ea31ac813a.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: data_structures/dynamic_array Directory 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('dir_bd4a7dd282074645ef41b1ea31ac813a.h
-
-
dynamic_array Directory Reference
+
dynamic_array Directory Reference
@@ -100,7 +99,7 @@ $(document).ready(function(){initNavTree('dir_bd4a7dd282074645ef41b1ea31ac813a.h diff --git a/dir_c7ef0fcb2f2095a74f0a3a1634dfc798.html b/dir_c7ef0fcb2f2095a74f0a3a1634dfc798.html index d8ef9ef6a..6752fcfb3 100644 --- a/dir_c7ef0fcb2f2095a74f0a3a1634dfc798.html +++ b/dir_c7ef0fcb2f2095a74f0a3a1634dfc798.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: data_structures/array Directory 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('dir_c7ef0fcb2f2095a74f0a3a1634dfc798.h
-
-
array Directory Reference
+
array Directory Reference
@@ -100,7 +99,7 @@ $(document).ready(function(){initNavTree('dir_c7ef0fcb2f2095a74f0a3a1634dfc798.h diff --git a/dir_d20ad0b8de644c123692ba5582cc7a7b.html b/dir_d20ad0b8de644c123692ba5582cc7a7b.html index 3fc8bb747..815384f81 100644 --- a/dir_d20ad0b8de644c123692ba5582cc7a7b.html +++ b/dir_d20ad0b8de644c123692ba5582cc7a7b.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: client_server Directory 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,34 @@ $(document).ready(function(){initNavTree('dir_d20ad0b8de644c123692ba5582cc7a7b.h
-
-
client_server Directory Reference
+
client_server Directory Reference
- - + - + - + + + + + + + + + + + + + - +

+

Files

file  client.c
file  client.c
 Client side implementation of Server-Client system.
 
file  server.c
file  server.c
 Server side implementation of Server-Client system.
 
file  udp_client.c
file  tcp_full_duplex_client.c
 Client-side implementation of TCP Full Duplex Communication
 
file  tcp_full_duplex_server.c
 Server-side implementation of TCP Full Duplex Communication
 
file  tcp_half_duplex_client.c
 Client-side implementation of TCP Half Duplex Communication
 
file  tcp_half_duplex_server.c
 Server-side implementation of TCP Half Duplex Communication
 
file  udp_client.c
 Client side implementation of UDP client-server model.
 
file  udp_server.c
file  udp_server.c
 Server side implementation of UDP client-server model.
 
@@ -116,7 +127,7 @@ Files diff --git a/dir_d20ad0b8de644c123692ba5582cc7a7b.js b/dir_d20ad0b8de644c123692ba5582cc7a7b.js index 6b42725fb..e67652137 100644 --- a/dir_d20ad0b8de644c123692ba5582cc7a7b.js +++ b/dir_d20ad0b8de644c123692ba5582cc7a7b.js @@ -2,6 +2,10 @@ var dir_d20ad0b8de644c123692ba5582cc7a7b = [ [ "client.c", "dd/d93/client_8c.html", "dd/d93/client_8c" ], [ "server.c", "d1/d20/server_8c.html", "d1/d20/server_8c" ], + [ "tcp_full_duplex_client.c", "d1/d98/tcp__full__duplex__client_8c.html", "d1/d98/tcp__full__duplex__client_8c" ], + [ "tcp_full_duplex_server.c", "d1/d6b/tcp__full__duplex__server_8c.html", "d1/d6b/tcp__full__duplex__server_8c" ], + [ "tcp_half_duplex_client.c", "da/d07/tcp__half__duplex__client_8c.html", "da/d07/tcp__half__duplex__client_8c" ], + [ "tcp_half_duplex_server.c", "d6/d2b/tcp__half__duplex__server_8c.html", "d6/d2b/tcp__half__duplex__server_8c" ], [ "udp_client.c", "da/de6/udp__client_8c.html", "da/de6/udp__client_8c" ], [ "udp_server.c", "d8/dca/udp__server_8c.html", "d8/dca/udp__server_8c" ] ]; \ No newline at end of file diff --git a/dir_d4c35186c199e728d69dee6bf5b2473c.html b/dir_d4c35186c199e728d69dee6bf5b2473c.html index 391ce517a..ac711d700 100644 --- a/dir_d4c35186c199e728d69dee6bf5b2473c.html +++ b/dir_d4c35186c199e728d69dee6bf5b2473c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_9 Directory 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,18 +90,17 @@ $(document).ready(function(){initNavTree('dir_d4c35186c199e728d69dee6bf5b2473c.h
-
-
problem_9 Directory Reference
+
problem_9 Directory Reference
- - - + + - - + +

+

Files

file  sol1.c
 Problem 9 solution - A naive implementation
file  sol1.c
 Problem 9 solution - A naive implementation
 
file  sol2.c
 Problem 9 solution
file  sol2.c
 Problem 9 solution
 
@@ -110,7 +109,7 @@ Files diff --git a/dir_d9112ab06cf4d4e5a25d385a268d1949.html b/dir_d9112ab06cf4d4e5a25d385a268d1949.html index bc1e9231c..cf115d758 100644 --- a/dir_d9112ab06cf4d4e5a25d385a268d1949.html +++ b/dir_d9112ab06cf4d4e5a25d385a268d1949.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_12 Directory 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,15 +90,14 @@ $(document).ready(function(){initNavTree('dir_d9112ab06cf4d4e5a25d385a268d1949.h
-
-
problem_12 Directory Reference
+
problem_12 Directory Reference
- - - + +

+

Files

file  sol1.c
 Problem 12 solution
file  sol1.c
 Problem 12 solution
 
@@ -107,7 +106,7 @@ Files diff --git a/dir_d9e100c82ada2163abea49688a71e81c.html b/dir_d9e100c82ada2163abea49688a71e81c.html index 9f301b443..b547e173c 100644 --- a/dir_d9e100c82ada2163abea49688a71e81c.html +++ b/dir_d9e100c82ada2163abea49688a71e81c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_21 Directory 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,15 +90,14 @@ $(document).ready(function(){initNavTree('dir_d9e100c82ada2163abea49688a71e81c.h
-
-
problem_21 Directory Reference
+
problem_21 Directory Reference
- - - + +

+

Files

file  sol1.c
 Problem 21 solution
file  sol1.c
 Problem 21 solution
 
@@ -107,7 +106,7 @@ Files diff --git a/dir_da574daf9ce9c05b45556bdc871ed1e3.html b/dir_da574daf9ce9c05b45556bdc871ed1e3.html index cbad1165f..f73c5176e 100644 --- a/dir_da574daf9ce9c05b45556bdc871ed1e3.html +++ b/dir_da574daf9ce9c05b45556bdc871ed1e3.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: searching Directory 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,32 @@ $(document).ready(function(){initNavTree('dir_da574daf9ce9c05b45556bdc871ed1e3.h
-
-
searching Directory Reference
+
searching Directory Reference
-

+

Directories

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

+

Files

file  binary_search.c
 Program to perform binary search of a target value in a given sorted array.
file  binary_search.c
 Program to perform binary search of a target value in a given sorted array.
 
file  jump_search.c
 Implementation of jump search algorithm.
file  exponential_search.c
 Exponential Search
 
file  modified_binary_search.c
 Modified binary search algorithm
file  floyd_cycle_detection_algorithm.c
 Implementation of Floyd's Cycle Detection algorithm.
 
file  jump_search.c
 Implementation of jump search algorithm.
 
file  modified_binary_search.c
 Modified binary search algorithm
 
file  sentinel_linear_search.c
 Linear Search with Sentinel algorithm implementation
 
@@ -116,7 +124,7 @@ Files diff --git a/dir_da574daf9ce9c05b45556bdc871ed1e3.js b/dir_da574daf9ce9c05b45556bdc871ed1e3.js index 30b7a4f13..fe4368475 100644 --- a/dir_da574daf9ce9c05b45556bdc871ed1e3.js +++ b/dir_da574daf9ce9c05b45556bdc871ed1e3.js @@ -1,6 +1,9 @@ var dir_da574daf9ce9c05b45556bdc871ed1e3 = [ [ "binary_search.c", "df/d3b/binary__search_8c.html", "df/d3b/binary__search_8c" ], + [ "exponential_search.c", "da/d6c/exponential__search_8c.html", "da/d6c/exponential__search_8c" ], + [ "floyd_cycle_detection_algorithm.c", "d2/d9b/floyd__cycle__detection__algorithm_8c.html", "d2/d9b/floyd__cycle__detection__algorithm_8c" ], [ "jump_search.c", "d6/d7b/jump__search_8c.html", "d6/d7b/jump__search_8c" ], - [ "modified_binary_search.c", "d3/d47/modified__binary__search_8c.html", "d3/d47/modified__binary__search_8c" ] + [ "modified_binary_search.c", "d3/d47/modified__binary__search_8c.html", "d3/d47/modified__binary__search_8c" ], + [ "sentinel_linear_search.c", "d5/de2/sentinel__linear__search_8c.html", "d5/de2/sentinel__linear__search_8c" ] ]; \ No newline at end of file diff --git a/dir_e3380d2178455503f266746fb14246a5.html b/dir_e3380d2178455503f266746fb14246a5.html index 3df71b2f3..adaeaf360 100644 --- a/dir_e3380d2178455503f266746fb14246a5.html +++ b/dir_e3380d2178455503f266746fb14246a5.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: geometry Directory 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,20 +90,19 @@ $(document).ready(function(){initNavTree('dir_e3380d2178455503f266746fb14246a5.h
-
-
geometry Directory Reference
+
geometry Directory Reference
- - + - + - +

+

Files

file  geometry_datatypes.h [code]
file  geometry_datatypes.h [code]
 Generic header that provides data types for 3D vectors and quaternions.
 
file  quaternions.c
file  quaternions.c
 Functions related to 3D quaternions and Euler angles.
 
file  vectors_3d.c
file  vectors_3d.c
 Functions related to 3D vector operations.
 
@@ -113,7 +112,7 @@ Files diff --git a/dir_e39df94f82619fa5256f1786519937be.html b/dir_e39df94f82619fa5256f1786519937be.html index c2fb8a596..e8437466a 100644 --- a/dir_e39df94f82619fa5256f1786519937be.html +++ b/dir_e39df94f82619fa5256f1786519937be.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: data_structures/binary_trees Directory 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,24 @@ $(document).ready(function(){initNavTree('dir_e39df94f82619fa5256f1786519937be.h
-
-
binary_trees Directory Reference
+
binary_trees Directory Reference
- - + - + - + + + +

+

Files

file  binary_search_tree.c
file  binary_search_tree.c
 A basic unbalanced binary search tree implementation in C.
 
file  segment_tree.c
file  segment_tree.c
 segment trees with only point updates
 
file  threaded_binary_trees.c
file  threaded_binary_trees.c
 This file is a simple implementation of a Threaded Binary Tree.
 
file  words_alphabetical.c
 Printing the words contained in a file named file.txt in alphabetical order and also their frequencies in to another file "wordcount.txt".
 
@@ -113,7 +115,7 @@ Files diff --git a/dir_e39df94f82619fa5256f1786519937be.js b/dir_e39df94f82619fa5256f1786519937be.js index e7c0f28ba..2a8d59569 100644 --- a/dir_e39df94f82619fa5256f1786519937be.js +++ b/dir_e39df94f82619fa5256f1786519937be.js @@ -2,5 +2,6 @@ var dir_e39df94f82619fa5256f1786519937be = [ [ "binary_search_tree.c", "da/d02/binary__search__tree_8c.html", "da/d02/binary__search__tree_8c" ], [ "segment_tree.c", "da/da0/segment__tree_8c.html", "da/da0/segment__tree_8c" ], - [ "threaded_binary_trees.c", "df/d3c/threaded__binary__trees_8c.html", "df/d3c/threaded__binary__trees_8c" ] + [ "threaded_binary_trees.c", "df/d3c/threaded__binary__trees_8c.html", "df/d3c/threaded__binary__trees_8c" ], + [ "words_alphabetical.c", "d3/d78/words__alphabetical_8c.html", "d3/d78/words__alphabetical_8c" ] ]; \ No newline at end of file diff --git a/dir_e79632891301b850df87e9c0030293fa.html b/dir_e79632891301b850df87e9c0030293fa.html index 609e979e8..ca4a8bbb0 100644 --- a/dir_e79632891301b850df87e9c0030293fa.html +++ b/dir_e79632891301b850df87e9c0030293fa.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: graphics Directory 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,15 +90,14 @@ $(document).ready(function(){initNavTree('dir_e79632891301b850df87e9c0030293fa.h
-
-
graphics Directory Reference
+
graphics Directory Reference
- - - + +

+

Files

file  spirograph.c
 Implementation of Spirograph
file  spirograph.c
 Implementation of Spirograph
 
@@ -107,7 +106,7 @@ Files diff --git a/dir_eeeea13e3a5e5edad3499183767ce312.html b/dir_eeeea13e3a5e5edad3499183767ce312.html index 4aaaf97cc..44630d35f 100644 --- a/dir_eeeea13e3a5e5edad3499183767ce312.html +++ b/dir_eeeea13e3a5e5edad3499183767ce312.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_2 Directory 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,15 +90,14 @@ $(document).ready(function(){initNavTree('dir_eeeea13e3a5e5edad3499183767ce312.h
-
-
problem_2 Directory Reference
+
problem_2 Directory Reference
- - - + +

+

Files

file  so1.c
 Problem 2 solution
file  so1.c
 Problem 2 solution
 
@@ -107,7 +106,7 @@ Files diff --git a/dir_f75ccd45e00436eafed446b9b2682984.html b/dir_f75ccd45e00436eafed446b9b2682984.html index 04f60dc8c..75d05f664 100644 --- a/dir_f75ccd45e00436eafed446b9b2682984.html +++ b/dir_f75ccd45e00436eafed446b9b2682984.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_23 Directory 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,18 +90,17 @@ $(document).ready(function(){initNavTree('dir_f75ccd45e00436eafed446b9b2682984.h
-
-
problem_23 Directory Reference
+
problem_23 Directory Reference
- - - + + - - + +

+

Files

file  sol1.c
 Problem 23 solution
file  sol1.c
 Problem 23 solution
 
file  sol2.c
 Problem 23 solution - optimization using look-up array
file  sol2.c
 Problem 23 solution - optimization using look-up array
 
@@ -110,7 +109,7 @@ Files diff --git a/dir_f7d3c03fcac84aef1b0c66cc497ed1ea.html b/dir_f7d3c03fcac84aef1b0c66cc497ed1ea.html index b8232b830..1a77668f7 100644 --- a/dir_f7d3c03fcac84aef1b0c66cc497ed1ea.html +++ b/dir_f7d3c03fcac84aef1b0c66cc497ed1ea.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: project_euler/problem_13 Directory 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,15 +90,14 @@ $(document).ready(function(){initNavTree('dir_f7d3c03fcac84aef1b0c66cc497ed1ea.h
-
-
problem_13 Directory Reference
+
problem_13 Directory Reference
- - - + +

+

Files

file  sol1.c
 Problem 13 solution
file  sol1.c
 Problem 13 solution
 
@@ -107,7 +106,7 @@ Files diff --git a/dir_fb09f588f9daea69f78b63a0310e98cc.html b/dir_fb09f588f9daea69f78b63a0310e98cc.html new file mode 100644 index 000000000..a97173e89 --- /dev/null +++ b/dir_fb09f588f9daea69f78b63a0310e98cc.html @@ -0,0 +1,106 @@ + + + + + + + +Algorithms_in_C: data_structures/queue Directory Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Algorithms_in_C 1.0.0 +
+
Set of algorithms implemented in C.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
queue Directory Reference
+
+
+
+
+ + + + diff --git a/dir_fb09f588f9daea69f78b63a0310e98cc.js b/dir_fb09f588f9daea69f78b63a0310e98cc.js new file mode 100644 index 000000000..66659cf0c --- /dev/null +++ b/dir_fb09f588f9daea69f78b63a0310e98cc.js @@ -0,0 +1,4 @@ +var dir_fb09f588f9daea69f78b63a0310e98cc = +[ + [ "include.h", "d1/dbe/include_8h_source.html", null ] +]; \ No newline at end of file diff --git a/dir_fbc6c771d18f1a35ad2bd30260ea0fc8.html b/dir_fbc6c771d18f1a35ad2bd30260ea0fc8.html index 3295ed9b4..487e6d3ba 100644 --- a/dir_fbc6c771d18f1a35ad2bd30260ea0fc8.html +++ b/dir_fbc6c771d18f1a35ad2bd30260ea0fc8.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: data_structures/trie Directory 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('dir_fbc6c771d18f1a35ad2bd30260ea0fc8.h
-
-
trie Directory Reference
+
trie Directory Reference
@@ -100,7 +99,7 @@ $(document).ready(function(){initNavTree('dir_fbc6c771d18f1a35ad2bd30260ea0fc8.h diff --git a/dir_fe5d69ed7d90cb356556070c2a2e5478.html b/dir_fe5d69ed7d90cb356556070c2a2e5478.html index dd45491a0..aeb4cefb6 100644 --- a/dir_fe5d69ed7d90cb356556070c2a2e5478.html +++ b/dir_fe5d69ed7d90cb356556070c2a2e5478.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: exercism/acronym Directory 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('dir_fe5d69ed7d90cb356556070c2a2e5478.h
-
-
acronym Directory Reference
+
acronym Directory Reference
@@ -100,7 +99,7 @@ $(document).ready(function(){initNavTree('dir_fe5d69ed7d90cb356556070c2a2e5478.h diff --git a/doxygen.css b/doxygen.css index ffbff0224..8e9cca36a 100644 --- a/doxygen.css +++ b/doxygen.css @@ -1,4 +1,4 @@ -/* The standard CSS for doxygen 1.9.1 */ +/* The standard CSS for doxygen 1.9.2 */ body, table, div, p, dl { font: 400 14px/22px Roboto,sans-serif; @@ -228,6 +228,33 @@ a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited { color: #4665A2; } +a.code.hl_class { /* style for links to class names in code snippets */ } +a.code.hl_struct { /* style for links to struct names in code snippets */ } +a.code.hl_union { /* style for links to union names in code snippets */ } +a.code.hl_interface { /* style for links to interface names in code snippets */ } +a.code.hl_protocol { /* style for links to protocol names in code snippets */ } +a.code.hl_category { /* style for links to category names in code snippets */ } +a.code.hl_exception { /* style for links to exception names in code snippets */ } +a.code.hl_service { /* style for links to service names in code snippets */ } +a.code.hl_singleton { /* style for links to singleton names in code snippets */ } +a.code.hl_concept { /* style for links to concept names in code snippets */ } +a.code.hl_namespace { /* style for links to namespace names in code snippets */ } +a.code.hl_package { /* style for links to package names in code snippets */ } +a.code.hl_define { /* style for links to macro names in code snippets */ } +a.code.hl_function { /* style for links to function names in code snippets */ } +a.code.hl_variable { /* style for links to variable names in code snippets */ } +a.code.hl_typedef { /* style for links to typedef names in code snippets */ } +a.code.hl_enumvalue { /* style for links to enum value names in code snippets */ } +a.code.hl_enumeration { /* style for links to enumeration names in code snippets */ } +a.code.hl_signal { /* style for links to Qt signal names in code snippets */ } +a.code.hl_slot { /* style for links to Qt slot names in code snippets */ } +a.code.hl_friend { /* style for links to friend names in code snippets */ } +a.code.hl_dcop { /* style for links to KDE3 DCOP names in code snippets */ } +a.code.hl_property { /* style for links to property names in code snippets */ } +a.code.hl_event { /* style for links to event names in code snippets */ } +a.code.hl_sequence { /* style for links to sequence names in code snippets */ } +a.code.hl_dictionary { /* style for links to dictionary names in code snippets */ } + /* @end */ dl.el { @@ -313,6 +340,7 @@ div.line.glow { span.lineno { padding-right: 4px; + margin-right: 9px; text-align: right; border-right: 2px solid #0F0; background-color: #E8E8E8; @@ -439,6 +467,12 @@ img.footer { vertical-align: middle; } +.compoundTemplParams { + color: #4665A2; + font-size: 80%; + line-height: 120%; +} + /* @group Code Colorization */ span.keyword { @@ -1341,14 +1375,14 @@ dl.section dd { #projectname { - font: 300% Tahoma, Arial,sans-serif; + font: 200% Tahoma, Arial,sans-serif; margin: 0px; padding: 2px 0px; } #projectbrief { - font: 120% Tahoma, Arial,sans-serif; + font: 90% Tahoma, Arial,sans-serif; margin: 0px; padding: 0px; } diff --git a/files.html b/files.html index 01afbffe6..70ca85fcd 100644 --- a/files.html +++ b/files.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: File 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,179 +90,199 @@ $(document).ready(function(){initNavTree('files.html',''); initResizable(); });
-
-
File List
+
File List
Here is a list of all documented files with brief descriptions:
[detail level 1234]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 ► client_server
 ► conversions
 ► data_structures
 ► developer_tools
 ► exercism
 ► games
 ► geometry
 ► graphics
 ► hash
 ► machine_learning
 ► misc
 ► numerical_methods
 ► project_euler
 ► searching
 ► sorting
 ► audio
 ► client_server
 ► conversions
 ► data_structures
 ► developer_tools
 ► exercism
 ► games
 ► geometry
 ► graphics
 ► greedy_approach
 ► hash
 ► machine_learning
 ► misc
 ► numerical_methods
 ► project_euler
 ► searching
 ► sorting
@@ -270,7 +290,7 @@ $(document).ready(function(){initNavTree('files.html',''); initResizable(); }); diff --git a/files_dup.js b/files_dup.js index 49256d92c..faa1a04b8 100644 --- a/files_dup.js +++ b/files_dup.js @@ -1,5 +1,6 @@ var files_dup = [ + [ "audio", "dir_a5f32cf82ad289a7dac212f63f40f55b.html", "dir_a5f32cf82ad289a7dac212f63f40f55b" ], [ "client_server", "dir_d20ad0b8de644c123692ba5582cc7a7b.html", "dir_d20ad0b8de644c123692ba5582cc7a7b" ], [ "conversions", "dir_9babc524d57e25f3d9f4179cabc3599e.html", "dir_9babc524d57e25f3d9f4179cabc3599e" ], [ "data_structures", "dir_2e746e9d06bf2d8ff842208bcc6ebcfc.html", "dir_2e746e9d06bf2d8ff842208bcc6ebcfc" ], @@ -8,6 +9,7 @@ var files_dup = [ "games", "dir_4b6f782e158b0b98da980a0e11a23a15.html", "dir_4b6f782e158b0b98da980a0e11a23a15" ], [ "geometry", "dir_e3380d2178455503f266746fb14246a5.html", "dir_e3380d2178455503f266746fb14246a5" ], [ "graphics", "dir_e79632891301b850df87e9c0030293fa.html", "dir_e79632891301b850df87e9c0030293fa" ], + [ "greedy_approach", "dir_a4300992e825aa9b9238bf43160a241e.html", "dir_a4300992e825aa9b9238bf43160a241e" ], [ "hash", "dir_72aaf47615111200018c039a56ef48be.html", "dir_72aaf47615111200018c039a56ef48be" ], [ "machine_learning", "dir_3343723ae086de42ee4ca9774da3a13f.html", "dir_3343723ae086de42ee4ca9774da3a13f" ], [ "misc", "dir_a52f4d3d586a58b02f3a4ddf0a992157.html", "dir_a52f4d3d586a58b02f3a4ddf0a992157" ], diff --git a/functions.html b/functions.html index bbc5f3f95..6df6dd670 100644 --- a/functions.html +++ b/functions.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Data Fields @@ -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,269 +92,153 @@ $(document).ready(function(){initNavTree('functions.html',''); initResizable();
Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:
-

- a -

diff --git a/functions_vars.html b/functions_vars.html index bc8bf4f86..c1f329b46 100644 --- a/functions_vars.html +++ b/functions_vars.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Data Fields - Variables @@ -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,269 +92,153 @@ $(document).ready(function(){initNavTree('functions_vars.html',''); initResizabl
  -

- a -

diff --git a/globals.html b/globals.html index a0d251473..31205969e 100644 --- a/globals.html +++ b/globals.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,24 +92,16 @@ $(document).ready(function(){initNavTree('globals.html',''); initResizable(); })
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:
-

- _ -

diff --git a/globals_a.html b/globals_a.html index d557468a9..577f5107c 100644 --- a/globals_a.html +++ b/globals_a.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,55 +92,29 @@ $(document).ready(function(){initNavTree('globals_a.html',''); initResizable();
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:
-

- a -

diff --git a/globals_b.html b/globals_b.html index 7f51dc468..fcda441ad 100644 --- a/globals_b.html +++ b/globals_b.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,39 +92,24 @@ $(document).ready(function(){initNavTree('globals_b.html',''); initResizable();
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:
-

- b -

diff --git a/globals_c.html b/globals_c.html index 1983ab840..fc60a233c 100644 --- a/globals_c.html +++ b/globals_c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,82 +92,39 @@ $(document).ready(function(){initNavTree('globals_c.html',''); initResizable();
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:
-

- c -

diff --git a/globals_d.html b/globals_d.html index 917fcadb3..2f595392c 100644 --- a/globals_d.html +++ b/globals_d.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,53 +92,29 @@ $(document).ready(function(){initNavTree('globals_d.html',''); initResizable();
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:
-

- d -

diff --git a/globals_defs.html b/globals_defs.html index fae0d6381..b87604266 100644 --- a/globals_defs.html +++ b/globals_defs.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,146 +92,86 @@ $(document).ready(function(){initNavTree('globals_defs.html',''); initResizable(
  -

- _ -

diff --git a/globals_dup.js b/globals_dup.js index 9091d518b..187720c01 100644 --- a/globals_dup.js +++ b/globals_dup.js @@ -23,5 +23,6 @@ var globals_dup = [ "t", "globals_t.html", null ], [ "u", "globals_u.html", null ], [ "v", "globals_v.html", null ], + [ "w", "globals_w.html", null ], [ "x", "globals_x.html", null ] ]; \ No newline at end of file diff --git a/globals_e.html b/globals_e.html index d621a1047..377d874fe 100644 --- a/globals_e.html +++ b/globals_e.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,38 +92,27 @@ $(document).ready(function(){initNavTree('globals_e.html',''); initResizable();
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:
-

- e -

diff --git a/globals_f.html b/globals_f.html index 2246e039f..75133af34 100644 --- a/globals_f.html +++ b/globals_f.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,48 +92,25 @@ $(document).ready(function(){initNavTree('globals_f.html',''); initResizable();
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:
-

- f -

diff --git a/globals_func.html b/globals_func.html index ab8ea1853..b7318b120 100644 --- a/globals_func.html +++ b/globals_func.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,18 +92,15 @@ $(document).ready(function(){initNavTree('globals_func.html',''); initResizable(
  -

- _ -

diff --git a/globals_func.js b/globals_func.js index e650a8481..541b73e8a 100644 --- a/globals_func.js +++ b/globals_func.js @@ -23,5 +23,6 @@ var globals_func = [ "t", "globals_func_t.html", null ], [ "u", "globals_func_u.html", null ], [ "v", "globals_func_v.html", null ], + [ "w", "globals_func_w.html", null ], [ "x", "globals_func_x.html", null ] ]; \ No newline at end of file diff --git a/globals_func_a.html b/globals_func_a.html index 14558b540..49d1837be 100644 --- a/globals_func_a.html +++ b/globals_func_a.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,42 +92,25 @@ $(document).ready(function(){initNavTree('globals_func_a.html',''); initResizabl
  -

- a -

diff --git a/globals_func_b.html b/globals_func_b.html index 689e9f47e..b0f6a79c9 100644 --- a/globals_func_b.html +++ b/globals_func_b.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,33 +92,21 @@ $(document).ready(function(){initNavTree('globals_func_b.html',''); initResizabl
  -

- b -

diff --git a/globals_func_c.html b/globals_func_c.html index 59db398cc..9975b4ae3 100644 --- a/globals_func_c.html +++ b/globals_func_c.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,73 +92,36 @@ $(document).ready(function(){initNavTree('globals_func_c.html',''); initResizabl
  -

- c -

diff --git a/globals_func_d.html b/globals_func_d.html index 7016d9a80..6a100fab3 100644 --- a/globals_func_d.html +++ b/globals_func_d.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,47 +92,27 @@ $(document).ready(function(){initNavTree('globals_func_d.html',''); initResizabl
  -

- d -

diff --git a/globals_func_e.html b/globals_func_e.html index 63fab223e..dec4b6b35 100644 --- a/globals_func_e.html +++ b/globals_func_e.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,31 +92,24 @@ $(document).ready(function(){initNavTree('globals_func_e.html',''); initResizabl
  -

- e -

diff --git a/globals_func_f.html b/globals_func_f.html index 6d3488d31..3806dc361 100644 --- a/globals_func_f.html +++ b/globals_func_f.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,45 +92,24 @@ $(document).ready(function(){initNavTree('globals_func_f.html',''); initResizabl
  -

- f -

diff --git a/globals_func_g.html b/globals_func_g.html index 0e3c7c678..751da2a33 100644 --- a/globals_func_g.html +++ b/globals_func_g.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,62 +92,34 @@ $(document).ready(function(){initNavTree('globals_func_g.html',''); initResizabl
  -

- g -

diff --git a/globals_func_h.html b/globals_func_h.html index 9d871c84a..9b93b147f 100644 --- a/globals_func_h.html +++ b/globals_func_h.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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('globals_func_h.html',''); initResizabl
  -

- h -

diff --git a/globals_func_i.html b/globals_func_i.html index c6408149a..d170caf48 100644 --- a/globals_func_i.html +++ b/globals_func_i.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,74 +92,35 @@ $(document).ready(function(){initNavTree('globals_func_i.html',''); initResizabl
  -

- i -

diff --git a/globals_func_j.html b/globals_func_j.html index c87392eab..fa192c4c2 100644 --- a/globals_func_j.html +++ b/globals_func_j.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,16 @@ $(document).ready(function(){initNavTree('globals_func_j.html',''); initResizabl
  -

- j -

diff --git a/globals_func_k.html b/globals_func_k.html index 72e9da702..a5c628554 100644 --- a/globals_func_k.html +++ b/globals_func_k.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,33 +92,20 @@ $(document).ready(function(){initNavTree('globals_func_k.html',''); initResizabl
  -

- k -

diff --git a/globals_func_l.html b/globals_func_l.html index 0ce6e09a8..202b97287 100644 --- a/globals_func_l.html +++ b/globals_func_l.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,23 +92,17 @@ $(document).ready(function(){initNavTree('globals_func_l.html',''); initResizabl
  -

- l -

diff --git a/globals_func_m.html b/globals_func_m.html index 1c35c110f..de403483a 100644 --- a/globals_func_m.html +++ b/globals_func_m.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,126 +92,25 @@ $(document).ready(function(){initNavTree('globals_func_m.html',''); initResizabl
  -

- m -

diff --git a/globals_func_n.html b/globals_func_n.html index bd9c5f743..16fb7bf68 100644 --- a/globals_func_n.html +++ b/globals_func_n.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,18 @@ $(document).ready(function(){initNavTree('globals_func_n.html',''); initResizabl
  -

- n -

diff --git a/globals_func_o.html b/globals_func_o.html index c963853da..fbc37d491 100644 --- a/globals_func_o.html +++ b/globals_func_o.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,21 @@ $(document).ready(function(){initNavTree('globals_func_o.html',''); initResizabl
  -

- o -

diff --git a/globals_func_p.html b/globals_func_p.html index d57b3eb2e..a25f28256 100644 --- a/globals_func_p.html +++ b/globals_func_p.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,85 +92,43 @@ $(document).ready(function(){initNavTree('globals_func_p.html',''); initResizabl
  -

- p -

diff --git a/globals_func_q.html b/globals_func_q.html index b840772cd..90584d725 100644 --- a/globals_func_q.html +++ b/globals_func_q.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,23 +92,17 @@ $(document).ready(function(){initNavTree('globals_func_q.html',''); initResizabl
  -

- q -

diff --git a/globals_func_r.html b/globals_func_r.html index 267bd26ce..2aadb5acc 100644 --- a/globals_func_r.html +++ b/globals_func_r.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,18 @@ $(document).ready(function(){initNavTree('globals_func_r.html',''); initResizabl
  -

- r -

diff --git a/globals_func_s.html b/globals_func_s.html index de58fba8e..f463cf14b 100644 --- a/globals_func_s.html +++ b/globals_func_s.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,99 +92,41 @@ $(document).ready(function(){initNavTree('globals_func_s.html',''); initResizabl
  -

- s -

diff --git a/globals_func_t.html b/globals_func_t.html index 7534c152f..25afa83d6 100644 --- a/globals_func_t.html +++ b/globals_func_t.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,99 +92,33 @@ $(document).ready(function(){initNavTree('globals_func_t.html',''); initResizabl
  -

- t -

diff --git a/globals_func_u.html b/globals_func_u.html index 77673db42..8c258b773 100644 --- a/globals_func_u.html +++ b/globals_func_u.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,17 +92,17 @@ $(document).ready(function(){initNavTree('globals_func_u.html',''); initResizabl
  -

- u -

diff --git a/globals_func_v.html b/globals_func_v.html index 502763848..a98cd9210 100644 --- a/globals_func_v.html +++ b/globals_func_v.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,42 +92,23 @@ $(document).ready(function(){initNavTree('globals_func_v.html',''); initResizabl
  -

- v -

diff --git a/globals_func_w.html b/globals_func_w.html new file mode 100644 index 000000000..b18d1781a --- /dev/null +++ b/globals_func_w.html @@ -0,0 +1,107 @@ + + + + + + + +Algorithms_in_C: Globals + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Algorithms_in_C 1.0.0 +
+
Set of algorithms implemented in C.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+  + +

- w -

+
+
+ + + + diff --git a/globals_func_x.html b/globals_func_x.html index 5a785f0e9..3bb271dda 100644 --- a/globals_func_x.html +++ b/globals_func_x.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,17 +92,15 @@ $(document).ready(function(){initNavTree('globals_func_x.html',''); initResizabl
  -

- x -

diff --git a/globals_g.html b/globals_g.html index 6bf4ff7c2..fbfbab28e 100644 --- a/globals_g.html +++ b/globals_g.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,62 +92,34 @@ $(document).ready(function(){initNavTree('globals_g.html',''); initResizable();
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:
-

- g -

diff --git a/globals_h.html b/globals_h.html index 550ad6c19..847bcd9d1 100644 --- a/globals_h.html +++ b/globals_h.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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('globals_h.html',''); initResizable();
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:
-

- h -

diff --git a/globals_i.html b/globals_i.html index f8e22e999..f30d2b7a0 100644 --- a/globals_i.html +++ b/globals_i.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,74 +92,36 @@ $(document).ready(function(){initNavTree('globals_i.html',''); initResizable();
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:
-

- i -

diff --git a/globals_j.html b/globals_j.html index 4389ed8db..2b5365d02 100644 --- a/globals_j.html +++ b/globals_j.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,16 @@ $(document).ready(function(){initNavTree('globals_j.html',''); initResizable();
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:
-

- j -

diff --git a/globals_k.html b/globals_k.html index a9f3e7b50..1e3ca658c 100644 --- a/globals_k.html +++ b/globals_k.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,33 +92,20 @@ $(document).ready(function(){initNavTree('globals_k.html',''); initResizable();
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:
-

- k -

diff --git a/globals_l.html b/globals_l.html index 03f187287..61864b821 100644 --- a/globals_l.html +++ b/globals_l.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,21 @@ $(document).ready(function(){initNavTree('globals_l.html',''); initResizable();
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:
-

- l -

diff --git a/globals_m.html b/globals_m.html index 2108c1167..2fc1c905b 100644 --- a/globals_m.html +++ b/globals_m.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,184 +92,42 @@ $(document).ready(function(){initNavTree('globals_m.html',''); initResizable();
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:
-

- m -

diff --git a/globals_n.html b/globals_n.html index 37f2ade35..f5a8dc945 100644 --- a/globals_n.html +++ b/globals_n.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,30 +92,19 @@ $(document).ready(function(){initNavTree('globals_n.html',''); initResizable();
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:
-

- n -

diff --git a/globals_o.html b/globals_o.html index e22b25317..4a1c2d9ae 100644 --- a/globals_o.html +++ b/globals_o.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,37 +92,22 @@ $(document).ready(function(){initNavTree('globals_o.html',''); initResizable();
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:
-

- o -

diff --git a/globals_p.html b/globals_p.html index 922869b73..753f527d3 100644 --- a/globals_p.html +++ b/globals_p.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,91 +92,44 @@ $(document).ready(function(){initNavTree('globals_p.html',''); initResizable();
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:
-

- p -

diff --git a/globals_q.html b/globals_q.html index 7717adde4..9f0e7abee 100644 --- a/globals_q.html +++ b/globals_q.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,18 @@ $(document).ready(function(){initNavTree('globals_q.html',''); initResizable();
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:
-

- q -

diff --git a/globals_r.html b/globals_r.html index cd831043e..21fcf1ea4 100644 --- a/globals_r.html +++ b/globals_r.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,18 @@ $(document).ready(function(){initNavTree('globals_r.html',''); initResizable();
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:
-

- r -

diff --git a/globals_s.html b/globals_s.html index 1e7575a56..945a16e24 100644 --- a/globals_s.html +++ b/globals_s.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,106 +92,44 @@ $(document).ready(function(){initNavTree('globals_s.html',''); initResizable();
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:
-

- s -

diff --git a/globals_t.html b/globals_t.html index 616a582d8..4b8a0bd33 100644 --- a/globals_t.html +++ b/globals_t.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,99 +92,33 @@ $(document).ready(function(){initNavTree('globals_t.html',''); initResizable();
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:
-

- t -

diff --git a/globals_type.html b/globals_type.html index e1f849cf4..edad74d36 100644 --- a/globals_type.html +++ b/globals_type.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,53 +91,27 @@ $(document).ready(function(){initNavTree('globals_type.html',''); initResizable(
 
diff --git a/globals_u.html b/globals_u.html index ea50c7b72..3adee4100 100644 --- a/globals_u.html +++ b/globals_u.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,17 +92,17 @@ $(document).ready(function(){initNavTree('globals_u.html',''); initResizable();
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:
-

- u -

diff --git a/globals_v.html b/globals_v.html index a2e621246..995e2e4b6 100644 --- a/globals_v.html +++ b/globals_v.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,45 +92,24 @@ $(document).ready(function(){initNavTree('globals_v.html',''); initResizable();
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:
-

- v -

diff --git a/globals_vars.html b/globals_vars.html index 3b711e645..d8c68647b 100644 --- a/globals_vars.html +++ b/globals_vars.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,28 +91,19 @@ $(document).ready(function(){initNavTree('globals_vars.html',''); initResizable(
 
diff --git a/globals_w.html b/globals_w.html new file mode 100644 index 000000000..c77133d67 --- /dev/null +++ b/globals_w.html @@ -0,0 +1,107 @@ + + + + + + + +Algorithms_in_C: Globals + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Algorithms_in_C 1.0.0 +
+
Set of algorithms implemented in C.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:
+ +

- w -

+
+
+ + + + diff --git a/globals_x.html b/globals_x.html index f67e71019..3aa50ed43 100644 --- a/globals_x.html +++ b/globals_x.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Globals @@ -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,17 +92,15 @@ $(document).ready(function(){initNavTree('globals_x.html',''); initResizable();
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:
-

- x -

diff --git a/graph_legend.html b/graph_legend.html index 7a15d521e..5217d1d85 100644 --- a/graph_legend.html +++ b/graph_legend.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Graph Legend @@ -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,12 +90,11 @@ $(document).ready(function(){initNavTree('graph_legend.html',''); initResizable(
-
-
Graph Legend
+
Graph Legend
-

This page explains how to interpret the graphs that are generated by doxygen.

-

Consider the following example:

/*! Invisible class because of truncation */
+

This page explains how to interpret the graphs that are generated by doxygen.

+

Consider the following example:

/*! Invisible class because of truncation */
class Invisible { };
/*! Truncated class, inheritance relation is hidden */
@@ -130,7 +129,7 @@ $(document).ready(function(){initNavTree('graph_legend.html',''); initResizable(
Used *m_usedClass;
};

This will result in the following graph:

-

The boxes in the above graph have the following meaning:

+

The boxes in the above graph have the following meaning:

  • A filled gray box represents the struct or class for which the graph is generated.
  • @@ -141,7 +140,7 @@ A box with a gray border denotes an undocumented struct or class.
  • A box with a red border denotes a documented struct or class forwhich not all inheritance/containment relations are shown. A graph is truncated if it does not fit within the specified boundaries.
-

The arrows have the following meaning:

+

The arrows have the following meaning:

  • A dark blue arrow is used to visualize a public inheritance relation between two classes.
  • @@ -159,7 +158,7 @@ A yellow dashed arrow denotes a relation between a template instance and the tem diff --git a/graph_legend.svg b/graph_legend.svg index 62f30a526..62b6a74d1 100644 --- a/graph_legend.svg +++ b/graph_legend.svg @@ -1,117 +1,117 @@ - - + Graph Legend - + Node9 - -Inherited + +Inherited Node10 - -PublicBase + +PublicBase Node10->Node9 - - + + Node11 - -Truncated + +Truncated Node11->Node10 - - + + Node13 - -ProtectedBase + +ProtectedBase Node13->Node9 - - + + Node14 - -PrivateBase + +PrivateBase Node14->Node9 - - + + Node15 - -Undocumented + +Undocumented Node15->Node9 - - + + Node16 - -Templ< int > + +Templ< int > Node16->Node9 - - + + Node17 - -Templ< T > + +Templ< T > Node17->Node16 - - -< int > + + +< int > Node18 - -Used + +Used Node18->Node9 - - -m_usedClass + + +m_usedClass diff --git a/index.html b/index.html index 6f85b4b6c..3b028c99b 100644 --- a/index.html +++ b/index.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: The Algorithms - C @@ -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,42 +89,41 @@ $(document).ready(function(){initNavTree('index.html',''); initResizable(); }); -
-
-
The Algorithms - C
+
+
The Algorithms - C
-

-

Gitpod Ready-to-Code Language grade: C/C++ Gitter chat contributions welcome GitHub repo size Doxygen CI Awesome CI Income Donate

-

-Overview

-

The repository is a collection of open-source implementation of a variety of algorithms implemented in C and licensed under GPLv3 License. The algorithms span a variety of topics from computer science, mathematics and statistics, data science, machine learning, engineering, etc.. The implementations and the associated documentation are meant to provide a learning resource for educators and students. Hence, one may find more than one implementation for the same objective but using a different algorithm strategies and optimizations.

+

+

Gitpod Ready-to-Code Language grade: C/C++ CodeQL CI Gitter chat contributions welcome GitHub repo size Doxygen CI Awesome CI Income Discord chat Donate

+Overview

+

The repository is a collection of open-source implementations of a variety of algorithms implemented in C and licensed under GPLv3 License. The algorithms span a variety of topics from computer science, mathematics and statistics, data science, machine learning, engineering, etc.. The implementations and their associated documentations are meant to provide a learning resource for educators and students. Hence, one may find more than one implementation for the same objective but using different algorithm strategies and optimizations.

+

Features

    -
  • The repository provides implementations of various algorithms in one of the most fundamental general purpose languages - C.
  • +
  • The repository provides implementations of various algorithms in one of the most fundamental general purpose languages - C.
  • Well documented source code with detailed explanations provide a valuable resource for educators and students alike.
  • -
  • Each source code is atomic using standard C library libc and no external libraries are required for their compilation and execution. Thus the fundamentals of the algorithms can be studied in much depth.
  • -
  • Source codes are compiled and tested for every commit on the latest versions of three major operating systems viz., Windows, MacOS and Ubuntu (Linux) using MSVC 16 2019, AppleClang 11.0 and GNU 7.5.0 respectively.
  • -
  • Strict adherence to C11 standard ensures portability of code to embedded systems as well like ESP32, ARM Cortex, etc. with little to no changes.
  • +
  • Each source code is atomic using standard C library libc and no external libraries are required for their compilation and execution. Thus the fundamentals of the algorithms can be studied in much depth.
  • +
  • Source codes are compiled and tested for every commit on the latest versions of three major operating systems viz., Windows, MacOS and Ubuntu (Linux) using MSVC 16 2019, AppleClang 11.0 and GNU 7.5.0 respectively.
  • +
  • Strict adherence to C11 standard ensures portability of code to embedded systems as well like ESP32, ARM Cortex, etc. with little to no changes.
  • Self-checks within programs ensure correct implementations with confidence.
  • Modular implementations and OpenSource licensing enable the functions to be utilized conveniently in other applications.
-

-Documentation

-

Online Documentation is generated from the repository source codes directly. The documentation contains all resources including source code snippets, details on execution of the programs, diagrammatic representation of program flow, and links to external resources where necessary. Click on Files menu to see the list of all the files documented with the code.

-

Documentation of Algorithms in C by The Algorithms Contributors is licensed under CC BY-SA 4.0
- Creative Commons LicenseCredit must be given to the creatorAdaptations must be shared under the same terms

+Documentation

+

Online Documentation is generated from the repository source codes directly. The documentation contains all resources including source code snippets, details on execution of the programs, diagrammatic representation of program flow, and links to external resources where necessary. Click on Files menu to see the list of all the files documented with the code.

+

Documentation of Algorithms in C by The Algorithms Contributors is licensed under CC BY-SA 4.0
+ Creative Commons LicenseCredit must be given to the creatorAdaptations must be shared under the same terms

+

Contributions

-

As a community developed and maintained repository, we welcome new un-plagiarized quality contributions. Please read our Contribution Guidelines.

+

As a community developed and maintained repository, we welcome new un-plagiarized quality contributions. Please read our Contribution Guidelines.

diff --git a/jquery.js b/jquery.js index 103c32d79..c9ed3d99c 100644 --- a/jquery.js +++ b/jquery.js @@ -1,5 +1,5 @@ -/*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/license */ -!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.4.1",k=function(e,t){return new k.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function d(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp($),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ne=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(m.childNodes),m.childNodes),t[m.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&((e?e.ownerDocument||e:m)!==C&&T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!A[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&U.test(t)){(s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=k),o=(l=h(t)).length;while(o--)l[o]="#"+s+" "+xe(l[o]);c=l.join(","),f=ee.test(t)&&ye(e.parentNode)||e}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){A(t,!0)}finally{s===k&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[k]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:m;return r!==C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),m!==C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=k,!C.getElementsByName||!C.getElementsByName(k).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+k+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+k+"+*").length||v.push(".#.+[+~]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",$)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e===C||e.ownerDocument===m&&y(m,e)?-1:t===C||t.ownerDocument===m&&y(m,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===C?-1:t===C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]===m?-1:s[r]===m?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==C&&T(e),d.matchesSelector&&E&&!A[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){A(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=p[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&p(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?k.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?k.grep(e,function(e){return e===n!==r}):"string"!=typeof n?k.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),D.test(r[1])&&k.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(k):k.makeArray(e,this)}).prototype=k.fn,q=k(E);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?k.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;nx",y.noCloneChecked=!!me.cloneNode(!0).lastChild.defaultValue;var Te=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ee=/^([^.]*)(?:\.(.+)|)/;function ke(){return!0}function Se(){return!1}function Ne(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ae(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ae(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return k().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=k.guid++)),e.each(function(){k.event.add(this,t,i,r,n)})}function De(e,i,o){o?(Q.set(e,i,!1),k.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Q.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(k.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Q.set(this,i,r),t=o(this,i),this[i](),r!==(n=Q.get(this,i))||t?Q.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Q.set(this,i,{value:k.event.trigger(k.extend(r[0],k.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Q.get(e,i)&&k.event.add(e,i,ke)}k.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.get(t);if(v){n.handler&&(n=(o=n).handler,i=o.selector),i&&k.find.matchesSelector(ie,i),n.guid||(n.guid=k.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(R)||[""]).length;while(l--)d=g=(s=Ee.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=k.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=k.event.special[d]||{},c=k.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&k.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),k.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.hasData(e)&&Q.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(R)||[""]).length;while(l--)if(d=g=(s=Ee.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=k.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||k.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)k.event.remove(e,d+t[l],n,r,!0);k.isEmptyObject(u)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=k.event.fix(e),u=new Array(arguments.length),l=(Q.get(this,"events")||{})[s.type]||[],c=k.event.special[s.type]||{};for(u[0]=s,t=1;t\x20\t\r\n\f]*)[^>]*)\/>/gi,qe=/\s*$/g;function Oe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function Pe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Me(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Q.hasData(e)&&(o=Q.access(e),a=Q.set(t,o),l=o.events))for(i in delete a.handle,a.events={},l)for(n=0,r=l[i].length;n")},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=oe(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||k.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Vt,Gt=[],Yt=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Gt.pop()||k.expando+"_"+kt++;return this[e]=!0,e}}),k.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Yt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Yt,"$1"+r):!1!==e.jsonp&&(e.url+=(St.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||k.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?k(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Gt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Vt=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Vt.childNodes.length),k.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=D.exec(e))?[t.createElement(i[1])]:(i=we([e],t,o),o&&o.length&&k(o).remove(),k.merge([],i.childNodes)));var r,i,o},k.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(k.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){k.fn[t]=function(e){return this.on(t,e)}}),k.expr.pseudos.animated=function(t){return k.grep(k.timers,function(e){return t===e.elem}).length},k.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=k.css(e,"position"),c=k(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=k.css(e,"top"),u=k.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,k.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){k.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===k.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===k.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=k(e).offset()).top+=k.css(e,"borderTopWidth",!0),i.left+=k.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-k.css(r,"marginTop",!0),left:t.left-i.left-k.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===k.css(e,"position"))e=e.offsetParent;return e||ie})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;k.fn[t]=function(e){return _(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),k.each(["top","left"],function(e,n){k.cssHooks[n]=ze(y.pixelPosition,function(e,t){if(t)return t=_e(e,n),$e.test(t)?k(e).position()[n]+"px":t})}),k.each({Height:"height",Width:"width"},function(a,s){k.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){k.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return _(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?k.css(e,t,i):k.style(e,t,n,i)},s,n?e:void 0,n)}})}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){k.fn[n]=function(e,t){return 0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="
",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0
'); + searchBox='
'+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + '
'+ + '
'; } else { - $('#main-menu').append('
  • '); + searchBox='
    '+ + ''+ + ''+ + ''+ + ''+ + ''+ + '' + '' + '
    '; } } + + $('#main-nav').before('
    '+ + ''+ + ''+ + '
    '); + $('#main-nav').append(makeTree(menudata,relPath)); + $('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu'); + if (searchBox) { + $('#main-menu').append('
  • '); + } + var $mainMenuState = $('#main-menu-state'); + var prevWidth = 0; + if ($mainMenuState.length) { + function initResizableIfExists() { + if (typeof initResizable==='function') initResizable(); + } + // animate mobile menu + $mainMenuState.change(function(e) { + var $menu = $('#main-menu'); + var options = { duration: 250, step: initResizableIfExists }; + if (this.checked) { + options['complete'] = function() { $menu.css('display', 'block') }; + $menu.hide().slideDown(options); + } else { + options['complete'] = function() { $menu.css('display', 'none') }; + $menu.show().slideUp(options); + } + }); + // set default menu visibility + function resetState() { + var $menu = $('#main-menu'); + var $mainMenuState = $('#main-menu-state'); + var newWidth = $(window).outerWidth(); + if (newWidth!=prevWidth) { + if ($(window).outerWidth()<768) { + $mainMenuState.prop('checked',false); $menu.hide(); + $('#searchBoxPos1').html(searchBox); + $('#searchBoxPos2').hide(); + } else { + $menu.show(); + $('#searchBoxPos1').empty(); + $('#searchBoxPos2').html(searchBox); + $('#searchBoxPos2').show(); + } + prevWidth = newWidth; + } + } + $(window).ready(function() { resetState(); initResizableIfExists(); }); + $(window).resize(resetState); + } $('#main-menu').smartmenus(); } /* @license-end */ diff --git a/menudata.js b/menudata.js index 700ac814b..32ab1df76 100644 --- a/menudata.js +++ b/menudata.js @@ -101,6 +101,7 @@ var menudata={children:[ {text:"t",url:"globals_t.html#index_t"}, {text:"u",url:"globals_u.html#index_u"}, {text:"v",url:"globals_v.html#index_v"}, +{text:"w",url:"globals_w.html#index_w"}, {text:"x",url:"globals_x.html#index_x"}]}, {text:"Functions",url:"globals_func.html",children:[ {text:"_",url:"globals_func.html#index__5F"}, @@ -126,6 +127,7 @@ var menudata={children:[ {text:"t",url:"globals_func_t.html#index_t"}, {text:"u",url:"globals_func_u.html#index_u"}, {text:"v",url:"globals_func_v.html#index_v"}, +{text:"w",url:"globals_func_w.html#index_w"}, {text:"x",url:"globals_func_x.html#index_x"}]}, {text:"Variables",url:"globals_vars.html"}, {text:"Typedefs",url:"globals_type.html"}, @@ -136,6 +138,7 @@ var menudata={children:[ {text:"c",url:"globals_defs.html#index_c"}, {text:"e",url:"globals_defs.html#index_e"}, {text:"f",url:"globals_defs.html#index_f"}, +{text:"i",url:"globals_defs.html#index_i"}, {text:"l",url:"globals_defs.html#index_l"}, {text:"m",url:"globals_defs.html#index_m"}, {text:"o",url:"globals_defs.html#index_o"}, diff --git a/modules.html b/modules.html index 54bf13cf3..66c4fa1b1 100644 --- a/modules.html +++ b/modules.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Modules @@ -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('modules.html',''); initResizable(); })
    -
    -
    Modules
    +
    Modules
    Here is a list of all modules:
    @@ -117,7 +116,7 @@ $(document).ready(function(){initNavTree('modules.html',''); initResizable(); }) diff --git a/navtree.css b/navtree.css index 33341a67d..d8a311a2e 100644 --- a/navtree.css +++ b/navtree.css @@ -87,6 +87,7 @@ position: absolute; left: 0px; width: 250px; + overflow : hidden; } .ui-resizable .ui-resizable-handle { diff --git a/navtree.js b/navtree.js index 1e272d31d..27983687a 100644 --- a/navtree.js +++ b/navtree.js @@ -325,11 +325,14 @@ function selectAndHighlight(hash,n) $(n.itemDiv).addClass('selected'); $(n.itemDiv).attr('id','selected'); } - if ($('#nav-tree-contents .item:first').hasClass('selected')) { - $('#nav-sync').css('top','30px'); - } else { - $('#nav-sync').css('top','5px'); + var topOffset=5; + if (typeof page_layout!=='undefined' && page_layout==1) { + topOffset+=$('#top').outerHeight(); } + if ($('#nav-tree-contents .item:first').hasClass('selected')) { + topOffset+=25; + } + $('#nav-sync').css('top',topOffset+'px'); showRoot(); } diff --git a/navtreedata.js b/navtreedata.js index abede029c..15b588599 100644 --- a/navtreedata.js +++ b/navtreedata.js @@ -26,10 +26,10 @@ var NAVTREE = [ [ "Algorithms_in_C", "index.html", [ [ "The Algorithms - C", "index.html", [ - [ "Overview", "index.html#autotoc_md62", null ], - [ "Features", "index.html#autotoc_md63", null ], - [ "Documentation", "index.html#autotoc_md64", null ], - [ "Contributions", "index.html#autotoc_md65", null ] + [ "Overview", "index.html#autotoc_md63", null ], + [ "Features", "index.html#autotoc_md64", null ], + [ "Documentation", "index.html#autotoc_md65", null ], + [ "Contributions", "index.html#autotoc_md66", null ] ] ], [ "Contributor Covenant Code of Conduct", "d4/d4c/md__c_o_d_e__o_f__c_o_n_d_u_c_t.html", [ [ "Our Pledge", "d4/d4c/md__c_o_d_e__o_f__c_o_n_d_u_c_t.html#autotoc_md1", null ], @@ -46,7 +46,7 @@ var NAVTREE = [ "CONTRIBUTION GUIDELINES", "d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html", [ [ "Before contributing", "d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html#autotoc_md13", null ], [ "Contributing", "d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html#autotoc_md14", [ - [ "Maintainer/developer", "d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html#autotoc_md15", null ], + [ "Maintainer/reviewer", "d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html#autotoc_md15", null ], [ "Contributor", "d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html#autotoc_md16", null ], [ "Making Changes", "d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html#autotoc_md17", [ [ "Code", "d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html#autotoc_md18", null ], @@ -73,25 +73,26 @@ var NAVTREE = [ "Dictionary", "de/d20/md_data_structures_dictionary__r_e_a_d_m_e.html", null ], [ "Simple generic Stack", "d1/d12/md_data_structures_stack__r_e_a_d_m_e.html", null ], [ "List of all files", "d5/d88/md__d_i_r_e_c_t_o_r_y.html", [ - [ "Client Server", "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md40", null ], - [ "Conversions", "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md41", null ], - [ "Data Structures", "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md42", null ], - [ "Developer Tools", "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md43", null ], - [ "Exercism", "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md44", null ], - [ "Games", "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md45", null ], - [ "Geometry", "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md46", null ], - [ "Graphics", "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md47", null ], - [ "Greedy Approach", "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md48", null ], - [ "Hash", "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md49", null ], - [ "Leetcode", "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md50", null ], - [ "Machine Learning", "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md51", null ], - [ "Misc", "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md52", null ], - [ "Numerical Methods", "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md53", null ], - [ "Project Euler", "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md54", null ], - [ "Searching", "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md55", null ], - [ "Sorting", "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md56", null ] + [ "Audio", "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md40", null ], + [ "Client Server", "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md41", null ], + [ "Conversions", "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md42", null ], + [ "Data Structures", "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md43", null ], + [ "Developer Tools", "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md44", null ], + [ "Exercism", "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md45", null ], + [ "Games", "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md46", null ], + [ "Geometry", "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md47", null ], + [ "Graphics", "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md48", null ], + [ "Greedy Approach", "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md49", null ], + [ "Hash", "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md50", null ], + [ "Leetcode", "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md51", null ], + [ "Machine Learning", "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md52", null ], + [ "Misc", "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md53", null ], + [ "Numerical Methods", "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md54", null ], + [ "Project Euler", "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md55", null ], + [ "Searching", "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md56", null ], + [ "Sorting", "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md57", null ] ] ], - [ "Sample solutions for exercism.io", "d7/db5/md_exercism__r_e_a_d_m_e.html", null ], + [ "Sample solutions for exercism.io", "d7/db5/md_exercism__r_e_a_d_m_e.html", null ], [ "Hash algorithms", "d4/dcb/md_hash__r_e_a_d_m_e.html", null ], [ "LeetCode", "df/d58/md_leetcode__r_e_a_d_m_e.html", null ], [ "ProjectEuler", "d8/d81/md_project_euler__r_e_a_d_m_e.html", null ], @@ -121,10 +122,9 @@ var NAVTREE = var NAVTREEINDEX = [ "annotated.html", -"d4/d7b/problem__6_2sol_8c.html", -"d7/d98/spirograph_8c.html#a525335710b53cb064ca56b936120431e", -"dc/d9a/group__quats.html#ga8cc5e5b7a5fa492423ecf034c8bb52bd", -"globals_func_s.html" +"d4/dbd/problem__23_2sol2_8c.html#a3ab61b5a1c4f2288625d160aa0ea8478", +"d9/dd7/struct__cantor__set.html#abd2176c3cc3a1d85d15bbeaace35fa03", +"dd/de4/bubble__sort_8c.html#aa8989f6c9bfd1f040854fa18b180114f" ]; var SYNCONMSG = 'click to disable panel synchronisation'; diff --git a/navtreeindex0.js b/navtreeindex0.js index 283155c13..eb836ec05 100644 --- a/navtreeindex0.js +++ b/navtreeindex0.js @@ -2,228 +2,206 @@ var NAVTREEINDEX0 = { "annotated.html":[14,0], "classes.html":[14,1], -"d0/d10/struct_queue_rep.html":[14,0,31], -"d0/d10/struct_queue_rep.html#a5ca79e0a97550d8938331d90ce585a35":[14,0,31,2], -"d0/d10/struct_queue_rep.html#aad9e10b8e2e0a821d374a154240e22c6":[14,0,31,1], -"d0/d10/struct_queue_rep.html#ad4f9f3b0f81ea8c768d4c45548a590de":[14,0,31,0], -"d0/d43/structpid.html":[14,0,28], -"d0/d43/structpid.html#a3c54185f7b4867281786eff640443a00":[14,0,28,0], -"d0/d43/structpid.html#a5a7b54866748e12568f9b9599b31f8eb":[14,0,28,3], -"d0/d43/structpid.html#a65e8bc146e02bad2702a0286d37b81bc":[14,0,28,2], -"d0/d43/structpid.html#a6c721a7983511fb9f91777ae45481473":[14,0,28,1], -"d0/d43/structpid.html#ad661092f21ab1e0e6aa35fbcfcf6f161":[14,0,28,4], -"d0/d46/kohonen__som__trace_8c.html":[15,0,9,3], -"d0/d46/kohonen__som__trace_8c.html#a0283886819c7c140a023582b7269e2d0":[15,0,9,3,11], -"d0/d46/kohonen__som__trace_8c.html#a107f00650b8041f77767927073ddddb8":[15,0,9,3,14], -"d0/d46/kohonen__som__trace_8c.html#a1440a7779ac56f47a3f355ce4a8c7da0":[15,0,9,3,10], -"d0/d46/kohonen__som__trace_8c.html#a2256c10b16edba377b64a44b6c656908":[15,0,9,3,4], -"d0/d46/kohonen__som__trace_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,9,3,8], -"d0/d46/kohonen__som__trace_8c.html#a41ae16442e3e5b891a58d2e5932a2cd0":[15,0,9,3,13], -"d0/d46/kohonen__som__trace_8c.html#a525335710b53cb064ca56b936120431e":[15,0,9,3,0], -"d0/d46/kohonen__som__trace_8c.html#a6d0455dd5c30adda100e95f0423c786e":[15,0,9,3,12], -"d0/d46/kohonen__som__trace_8c.html#aa2246f940155472084ee461f3685d614":[15,0,9,3,15], -"d0/d57/hash__xor8_8c.html":[15,0,8,4], -"d0/d57/hash__xor8_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,8,4,0], -"d0/d6b/structelem.html":[14,0,13], -"d0/d6b/structelem.html#a738173725677dc7ccc8529cc8537c50d":[14,0,13,1], -"d0/d6b/structelem.html#ab9cf5c2e1c9a0ec2938275b90d39d5ca":[14,0,13,0], -"d0/d6c/problem__4_2sol_8c.html":[15,0,12,16,0], -"d0/d6c/problem__4_2sol_8c.html#a840291bc02cba5474a4cb46a9b9566fe":[15,0,12,16,0,1], -"d0/d6c/problem__4_2sol_8c.html#adf9bea8d35848959bde5b3f277edf0c4":[15,0,12,16,0,0], -"d0/d6d/problem__10_2sol1_8c.html":[15,0,12,1,0], -"d0/d6d/problem__10_2sol1_8c.html#a0ddf1224851353fc92bfbff6f499fa97":[15,0,12,1,0,1], -"d0/d6d/problem__10_2sol1_8c.html#acc871ab6bfead702e983a7f9c412915f":[15,0,12,1,0,0], -"d0/d6d/problem__10_2sol1_8c.html#ae3d987cb2ad0ddb0c3caa4c2506a20e5":[15,0,12,1,0,2], -"d0/d7f/so1_8c.html":[15,0,12,8,0], -"d0/d7f/so1_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,12,8,0,0], -"d0/d8a/octal__to__hexadecimal_8c.html":[15,0,1,5], -"d0/d8a/octal__to__hexadecimal_8c.html#a042035b4ba7b92974f0edf6eb1b0cbe1":[15,0,1,5,2], -"d0/d8a/octal__to__hexadecimal_8c.html#a86a4edb605c2a03d9175c59de679347d":[15,0,1,5,1], -"d0/d8a/octal__to__hexadecimal_8c.html#aa8dca7b867074164d5f45b0f3851269d":[15,0,1,5,3], -"d0/d8a/octal__to__hexadecimal_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,1,5,0], -"d0/d8a/structmax__heap.html":[14,0,22], -"d0/d8a/structmax__heap.html#a1b632c34e7304f9e0720834200696340":[14,0,22,1], -"d0/d8a/structmax__heap.html#a917b63797e1857ce994dd5e6cfcebf1e":[14,0,22,0], -"d0/d8a/structmax__heap.html#ac4d520821651b109fd2ba2a99c6c6015":[14,0,22,2], -"d0/dc7/geometry__datatypes_8h.html":[15,0,6,0], -"d0/dc7/geometry__datatypes_8h_source.html":[15,0,6,0], +"d0/d10/struct_queue_rep.html":[14,0,32], +"d0/d43/structpid.html":[14,0,29], +"d0/d46/kohonen__som__trace_8c.html":[15,0,11,3], +"d0/d46/kohonen__som__trace_8c.html#a0283886819c7c140a023582b7269e2d0":[15,0,11,3,11], +"d0/d46/kohonen__som__trace_8c.html#a107f00650b8041f77767927073ddddb8":[15,0,11,3,14], +"d0/d46/kohonen__som__trace_8c.html#a1440a7779ac56f47a3f355ce4a8c7da0":[15,0,11,3,10], +"d0/d46/kohonen__som__trace_8c.html#a2256c10b16edba377b64a44b6c656908":[15,0,11,3,4], +"d0/d46/kohonen__som__trace_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,11,3,8], +"d0/d46/kohonen__som__trace_8c.html#a41ae16442e3e5b891a58d2e5932a2cd0":[15,0,11,3,13], +"d0/d46/kohonen__som__trace_8c.html#a525335710b53cb064ca56b936120431e":[15,0,11,3,0], +"d0/d46/kohonen__som__trace_8c.html#a6d0455dd5c30adda100e95f0423c786e":[15,0,11,3,12], +"d0/d46/kohonen__som__trace_8c.html#aa2246f940155472084ee461f3685d614":[15,0,11,3,15], +"d0/d57/hash__xor8_8c.html":[15,0,10,4], +"d0/d57/hash__xor8_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,10,4,0], +"d0/d6b/structelem.html":[14,0,14], +"d0/d6c/problem__4_2sol_8c.html":[15,0,14,16,0], +"d0/d6c/problem__4_2sol_8c.html#a840291bc02cba5474a4cb46a9b9566fe":[15,0,14,16,0,1], +"d0/d6c/problem__4_2sol_8c.html#adf9bea8d35848959bde5b3f277edf0c4":[15,0,14,16,0,0], +"d0/d6d/problem__10_2sol1_8c.html":[15,0,14,1,0], +"d0/d6d/problem__10_2sol1_8c.html#a0ddf1224851353fc92bfbff6f499fa97":[15,0,14,1,0,1], +"d0/d6d/problem__10_2sol1_8c.html#acc871ab6bfead702e983a7f9c412915f":[15,0,14,1,0,0], +"d0/d6d/problem__10_2sol1_8c.html#ae3d987cb2ad0ddb0c3caa4c2506a20e5":[15,0,14,1,0,2], +"d0/d7f/so1_8c.html":[15,0,14,8,0], +"d0/d7f/so1_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,14,8,0,0], +"d0/d8a/octal__to__hexadecimal_8c.html":[15,0,2,7], +"d0/d8a/octal__to__hexadecimal_8c.html#a823ef5170955cfef40e07d9a4d2e87e2":[15,0,2,7,2], +"d0/d8a/octal__to__hexadecimal_8c.html#a86a4edb605c2a03d9175c59de679347d":[15,0,2,7,1], +"d0/d8a/octal__to__hexadecimal_8c.html#aa8dca7b867074164d5f45b0f3851269d":[15,0,2,7,3], +"d0/d8a/octal__to__hexadecimal_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,2,7,0], +"d0/d8a/structmax__heap.html":[14,0,23], +"d0/dc7/geometry__datatypes_8h.html":[15,0,7,0], +"d0/dc7/geometry__datatypes_8h_source.html":[15,0,7,0], "d0/dcb/group__kohonen__1d.html":[13,2,3], "d0/dcb/group__kohonen__1d.html#ga4a57a413a3cef286a7da6d4666575586":[13,2,3,3], -"d0/dcb/group__kohonen__1d.html#ga4a57a413a3cef286a7da6d4666575586":[15,0,9,3,5], -"d0/dcb/group__kohonen__1d.html#ga7b84b14e60f47812b581d1f93057c85a":[15,0,9,3,9], "d0/dcb/group__kohonen__1d.html#ga7b84b14e60f47812b581d1f93057c85a":[13,2,3,6], -"d0/dcb/group__kohonen__1d.html#gac6afabdc09a49a433ee19d8a9486056d":[15,0,9,3,2], "d0/dcb/group__kohonen__1d.html#gac6afabdc09a49a433ee19d8a9486056d":[13,2,3,1], -"d0/dcb/group__kohonen__1d.html#gae334493a0917a24736fe5ba82aa6f81f":[15,0,9,3,7], "d0/dcb/group__kohonen__1d.html#gae334493a0917a24736fe5ba82aa6f81f":[13,2,3,5], -"d0/dcb/group__kohonen__1d.html#gaeaeffbff2be4d5d15b0d4f10f846abde":[15,0,9,3,6], "d0/dcb/group__kohonen__1d.html#gaeaeffbff2be4d5d15b0d4f10f846abde":[13,2,3,4], -"d0/dcb/group__kohonen__1d.html#gaf5ce14f026d6d231bef29161bac2b485":[15,0,9,3,3], "d0/dcb/group__kohonen__1d.html#gaf5ce14f026d6d231bef29161bac2b485":[13,2,3,2], -"d0/dcb/group__kohonen__1d.html#gaffe776513b24d84b39af8ab0930fef7f":[15,0,9,3,1], "d0/dcb/group__kohonen__1d.html#gaffe776513b24d84b39af8ab0930fef7f":[13,2,3,0], -"d0/dcb/poly__add_8c.html":[15,0,10,6], -"d0/dcb/poly__add_8c.html#a0c5173884bd798a6ca6f437b9b932409":[15,0,10,6,7], -"d0/dcb/poly__add_8c.html#a29eace09ec1373a92003075f1c2f6d9d":[15,0,10,6,1], -"d0/dcb/poly__add_8c.html#a5a103fff33166d6e4d975b8b63c6e895":[15,0,10,6,3], -"d0/dcb/poly__add_8c.html#a6ff38afe4720527c9513139cbab460af":[15,0,10,6,5], -"d0/dcb/poly__add_8c.html#a840291bc02cba5474a4cb46a9b9566fe":[15,0,10,6,4], -"d0/dcb/poly__add_8c.html#ab138609c765e2fd8b89e9c107cd40d57":[15,0,10,6,8], -"d0/dcb/poly__add_8c.html#ab215107dbb50c7efa811a687ce9b95af":[15,0,10,6,6], -"d0/dcb/poly__add_8c.html#ab9b9bedcb99f279d491d1b856791a36d":[15,0,10,6,2], -"d0/dd9/hexadecimal__to__octal2_8c.html":[15,0,1,2], -"d0/dd9/hexadecimal__to__octal2_8c.html#a4d7524efe6e2917b3674445b7269906b":[15,0,1,2,2], -"d0/dd9/hexadecimal__to__octal2_8c.html#ab64e6838b9026996a18766d334beea20":[15,0,1,2,0], -"d0/dd9/hexadecimal__to__octal2_8c.html#ad47196c6a06f99a1437e9569bae13c5f":[15,0,1,2,1], -"d0/dd9/hexadecimal__to__octal2_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,1,2,3], -"d0/df1/structhash__set__t.html":[14,0,17], -"d0/df1/structhash__set__t.html#a1b52c6b78642e398f574c2ec9ed22e8a":[14,0,17,1], -"d0/df1/structhash__set__t.html#a5fd11ba3c74b2cc7fd161696fb951b82":[14,0,17,2], -"d0/df1/structhash__set__t.html#a66e37043817e37030d2e49fd5bf81d7f":[14,0,17,3], -"d0/df1/structhash__set__t.html#a6f21e4fb262dbabac311dadc7936aa68":[14,0,17,0], +"d0/dcb/poly__add_8c.html":[15,0,12,6], +"d0/dcb/poly__add_8c.html#a0c5173884bd798a6ca6f437b9b932409":[15,0,12,6,7], +"d0/dcb/poly__add_8c.html#a29eace09ec1373a92003075f1c2f6d9d":[15,0,12,6,1], +"d0/dcb/poly__add_8c.html#a5a103fff33166d6e4d975b8b63c6e895":[15,0,12,6,3], +"d0/dcb/poly__add_8c.html#a6ff38afe4720527c9513139cbab460af":[15,0,12,6,5], +"d0/dcb/poly__add_8c.html#a840291bc02cba5474a4cb46a9b9566fe":[15,0,12,6,4], +"d0/dcb/poly__add_8c.html#ab138609c765e2fd8b89e9c107cd40d57":[15,0,12,6,8], +"d0/dcb/poly__add_8c.html#ab215107dbb50c7efa811a687ce9b95af":[15,0,12,6,6], +"d0/dcb/poly__add_8c.html#ab9b9bedcb99f279d491d1b856791a36d":[15,0,12,6,2], +"d0/dd9/hexadecimal__to__octal2_8c.html":[15,0,2,3], +"d0/dd9/hexadecimal__to__octal2_8c.html#ab83549c0d43c88544be47fa6c4885ae4":[15,0,2,3,0], +"d0/dd9/hexadecimal__to__octal2_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,2,3,1], +"d0/df1/structhash__set__t.html":[14,0,18], "d1/d12/md_data_structures_stack__r_e_a_d_m_e.html":[6], -"d1/d12/md_data_structures_stack__r_e_a_d_m_e.html#autotoc_md37":[1], -"d1/d12/md_data_structures_stack__r_e_a_d_m_e.html#autotoc_md38":[2], -"d1/d20/server_8c.html":[15,0,0,1], -"d1/d20/server_8c.html#a1e43924adac4ae865aa0acf79710261c":[15,0,0,1,2], -"d1/d20/server_8c.html#a392fb874e547e582e9c66a08a1f23326":[15,0,0,1,0], -"d1/d20/server_8c.html#a614217d263be1fb1a5f76e2ff7be19a2":[15,0,0,1,1], -"d1/d20/server_8c.html#ac17020a38607ab29ce18939d5194a32a":[15,0,0,1,3], -"d1/d20/server_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,0,1,4], -"d1/d2f/problem__7_2sol_8c.html":[15,0,12,20,0], -"d1/d2f/problem__7_2sol_8c.html#a840291bc02cba5474a4cb46a9b9566fe":[15,0,12,20,0,0], +"d1/d20/server_8c.html":[15,0,1,1], +"d1/d20/server_8c.html#a1e43924adac4ae865aa0acf79710261c":[15,0,1,1,2], +"d1/d20/server_8c.html#a392fb874e547e582e9c66a08a1f23326":[15,0,1,1,0], +"d1/d20/server_8c.html#a614217d263be1fb1a5f76e2ff7be19a2":[15,0,1,1,1], +"d1/d20/server_8c.html#ac17020a38607ab29ce18939d5194a32a":[15,0,1,1,3], +"d1/d20/server_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,1,1,4], +"d1/d2f/problem__7_2sol_8c.html":[15,0,14,20,0], +"d1/d2f/problem__7_2sol_8c.html#a840291bc02cba5474a4cb46a9b9566fe":[15,0,14,20,0,0], "d1/d5e/structobservation.html":[13,2,1,0], "d1/d5e/structobservation.html#a04f3dcfd59dd91353395e35c9831fade":[13,2,1,0,1], "d1/d5e/structobservation.html#a2db8ace685c08aa7b52f5a28b0843aab":[13,2,1,0,0], "d1/d5e/structobservation.html#ab6be1fa7024b2d5f3a30d6c6b70efdd7":[13,2,1,0,2], "d1/d6b/group__kohonen__2d.html":[13,2,2], -"d1/d6b/group__kohonen__2d.html#ga49d35f68f5d11d8ef6f8cce0d0e7bcba":[15,0,9,2,11], "d1/d6b/group__kohonen__2d.html#ga49d35f68f5d11d8ef6f8cce0d0e7bcba":[13,2,2,9], -"d1/d6b/group__kohonen__2d.html#ga6824dc6d973eb3339af7aef5fea78b0c":[15,0,9,2,10], "d1/d6b/group__kohonen__2d.html#ga6824dc6d973eb3339af7aef5fea78b0c":[13,2,2,8], -"d1/d6b/group__kohonen__2d.html#ga83abb572c60d202e100595a989dfe123":[15,0,9,2,8], "d1/d6b/group__kohonen__2d.html#ga83abb572c60d202e100595a989dfe123":[13,2,2,7], -"d1/d6b/group__kohonen__2d.html#ga8df35f04c1762a01dcf108fa13b897d6":[15,0,9,2,6], -"d1/d6b/group__kohonen__2d.html#ga8df35f04c1762a01dcf108fa13b897d6":[13,2,2,5], -"d1/d6b/group__kohonen__2d.html#gac6afabdc09a49a433ee19d8a9486056d":[15,0,9,2,2], "d1/d6b/group__kohonen__2d.html#gac6afabdc09a49a433ee19d8a9486056d":[13,2,2,2], -"d1/d6b/group__kohonen__2d.html#gacb42eda8af6ebd6a141a34ab00a0b710":[15,0,9,2,7], +"d1/d6b/group__kohonen__2d.html#gac78022076d889bf2ebfb2c41d4527ceb":[13,2,2,5], "d1/d6b/group__kohonen__2d.html#gacb42eda8af6ebd6a141a34ab00a0b710":[13,2,2,6], -"d1/d6b/group__kohonen__2d.html#gadc22d512c00a9f5799ee067f4fb90b4b":[15,0,9,2,5], "d1/d6b/group__kohonen__2d.html#gadc22d512c00a9f5799ee067f4fb90b4b":[13,2,2,4], -"d1/d6b/group__kohonen__2d.html#gaf5ce14f026d6d231bef29161bac2b485":[15,0,9,2,3], "d1/d6b/group__kohonen__2d.html#gaf5ce14f026d6d231bef29161bac2b485":[13,2,2,3], -"d1/d6b/group__kohonen__2d.html#gaffe776513b24d84b39af8ab0930fef7f":[15,0,9,2,1], "d1/d6b/group__kohonen__2d.html#gaffe776513b24d84b39af8ab0930fef7f":[13,2,2,1], +"d1/d6b/tcp__full__duplex__server_8c.html":[15,0,1,3], +"d1/d6b/tcp__full__duplex__server_8c.html#a614217d263be1fb1a5f76e2ff7be19a2":[15,0,1,3,0], +"d1/d6b/tcp__full__duplex__server_8c.html#a7e15c8e2885871839fc2b820dfbdb4ce":[15,0,1,3,1], +"d1/d6b/tcp__full__duplex__server_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,1,3,2], +"d1/d94/odd__even__sort_8c.html":[15,0,16,8], +"d1/d94/odd__even__sort_8c.html#a17761a0788916faded6e2ca1f478ad33":[15,0,16,8,1], +"d1/d94/odd__even__sort_8c.html#aa8dca7b867074164d5f45b0f3851269d":[15,0,16,8,3], +"d1/d94/odd__even__sort_8c.html#ac2eee54959bc040cfcb56d2d8047853a":[15,0,16,8,2], +"d1/d94/odd__even__sort_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,16,8,0], +"d1/d98/tcp__full__duplex__client_8c.html":[15,0,1,2], +"d1/d98/tcp__full__duplex__client_8c.html#a614217d263be1fb1a5f76e2ff7be19a2":[15,0,1,2,0], +"d1/d98/tcp__full__duplex__client_8c.html#a7e15c8e2885871839fc2b820dfbdb4ce":[15,0,1,2,1], +"d1/d98/tcp__full__duplex__client_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,1,2,2], "d1/d99/structcluster.html":[13,2,1,1], "d1/d99/structcluster.html#a10fa7010c12d0f03a422d68321495479":[13,2,1,1,2], "d1/d99/structcluster.html#a13278ef636c1d9bd9ce8fad736f4c570":[13,2,1,1,1], "d1/d99/structcluster.html#aaacf0562ee2d9e8866c66ddaa6527c2b":[13,2,1,1,0], -"d1/dc2/ode__midpoint__euler_8c.html":[15,0,11,4], -"d1/dc2/ode__midpoint__euler_8c.html#a0ddf1224851353fc92bfbff6f499fa97":[15,0,11,4,2], -"d1/dc2/ode__midpoint__euler_8c.html#a148003d8b261d040c1c41e73b40af1dd":[15,0,11,4,3], -"d1/dc2/ode__midpoint__euler_8c.html#a8caee977b26888d34040b122e0e28e3a":[15,0,11,4,1], -"d1/dc2/ode__midpoint__euler_8c.html#a97075291390a68c262ed66e157a57eb4":[15,0,11,4,5], -"d1/dc2/ode__midpoint__euler_8c.html#a9ceb646336224ee890a269d0b4600d09":[15,0,11,4,0], -"d1/dc2/ode__midpoint__euler_8c.html#affe6cc2ab040b94a29e6c41782f72d51":[15,0,11,4,4], +"d1/dba/decimal__to__any__base_8c.html":[15,0,2,1], +"d1/dba/decimal__to__any__base_8c.html#a0c5ccb926a23bc0050f213ba3408e18d":[15,0,2,1,1], +"d1/dba/decimal__to__any__base_8c.html#a3e4a7cfc97a528faa4d6e5741461109c":[15,0,2,1,2], +"d1/dba/decimal__to__any__base_8c.html#a899b3a7e0f1fac5a465eac0d4b10d711":[15,0,2,1,0], +"d1/dba/decimal__to__any__base_8c.html#aa8dca7b867074164d5f45b0f3851269d":[15,0,2,1,5], +"d1/dba/decimal__to__any__base_8c.html#ae071f62d704823751bf9a085bf0a1bd7":[15,0,2,1,3], +"d1/dba/decimal__to__any__base_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,2,1,4], +"d1/dbe/include_8h_source.html":[15,0,3,8,0], +"d1/dc2/ode__midpoint__euler_8c.html":[15,0,13,4], +"d1/dc2/ode__midpoint__euler_8c.html#a0ddf1224851353fc92bfbff6f499fa97":[15,0,13,4,2], +"d1/dc2/ode__midpoint__euler_8c.html#a148003d8b261d040c1c41e73b40af1dd":[15,0,13,4,3], +"d1/dc2/ode__midpoint__euler_8c.html#a8caee977b26888d34040b122e0e28e3a":[15,0,13,4,1], +"d1/dc2/ode__midpoint__euler_8c.html#a97075291390a68c262ed66e157a57eb4":[15,0,13,4,5], +"d1/dc2/ode__midpoint__euler_8c.html#a9ceb646336224ee890a269d0b4600d09":[15,0,13,4,0], +"d1/dc2/ode__midpoint__euler_8c.html#affe6cc2ab040b94a29e6c41782f72d51":[15,0,13,4,4], "d1/ded/group__misc.html":[13,3], -"d1/ded/group__misc.html#ga6f8e8c9d25b5891d57e588d80d75028a":[15,0,10,8,0], "d1/ded/group__misc.html#ga6f8e8c9d25b5891d57e588d80d75028a":[13,3,0], -"d1/ded/group__misc.html#gaa8dca7b867074164d5f45b0f3851269d":[15,0,10,8,3], "d1/ded/group__misc.html#gaa8dca7b867074164d5f45b0f3851269d":[13,3,3], -"d1/ded/group__misc.html#gac0f2228420376f4db7e1274f2b41667c":[15,0,10,8,1], "d1/ded/group__misc.html#gac0f2228420376f4db7e1274f2b41667c":[13,3,1], -"d1/ded/group__misc.html#gac1a7a8e00eeb590511465c28fae16e54":[15,0,10,8,2], "d1/ded/group__misc.html#gac1a7a8e00eeb590511465c28fae16e54":[13,3,2], -"d1/df9/problem__26_2sol1_8c.html":[15,0,12,14,0], -"d1/df9/problem__26_2sol1_8c.html#a0ddf1224851353fc92bfbff6f499fa97":[15,0,12,14,0,3], -"d1/df9/problem__26_2sol1_8c.html#a619eec3220cebd7c5e455edbb14e9b12":[15,0,12,14,0,0], -"d1/df9/problem__26_2sol1_8c.html#aabf4f709c8199e41cf279c77112345fe":[15,0,12,14,0,1], -"d1/df9/problem__26_2sol1_8c.html#ac70138609ef6aa6fabca57aca8681e83":[15,0,12,14,0,2], -"d2/d36/structqueue.html":[14,0,30], -"d2/d36/structqueue.html#a0da4061b8634159fd21e72b34f289e01":[14,0,30,2], -"d2/d36/structqueue.html#a473ab80725514ce07817f87ed1fb136f":[14,0,30,3], -"d2/d36/structqueue.html#a6c50c7c8bcd9c5962996ed8b1be8771c":[14,0,30,0], -"d2/d36/structqueue.html#aa5eb0f1e96748486046b9543ace2082a":[14,0,30,4], -"d2/d36/structqueue.html#ade1be9c3ada77e8e182ee4fe1e1fff05":[14,0,30,1], -"d2/d6a/struct_graph_rep.html":[14,0,16], -"d2/d6a/struct_graph_rep.html#a081038f30741c196b7d84fe79b4732c9":[14,0,16,2], -"d2/d6a/struct_graph_rep.html#aaf306e1727ca6c84cc03635ef4ac4888":[14,0,16,1], -"d2/d6a/struct_graph_rep.html#aeb803dced884357ef0c7ea59525e382b":[14,0,16,0], -"d2/d6d/bubble__sort__2_8c.html":[15,0,14,2], -"d2/d6d/bubble__sort__2_8c.html#a392fb874e547e582e9c66a08a1f23326":[15,0,14,2,0], -"d2/d6d/bubble__sort__2_8c.html#a7406723363363b34f29d18f5a80f1281":[15,0,14,2,1], -"d2/d6d/bubble__sort__2_8c.html#aa8dca7b867074164d5f45b0f3851269d":[15,0,14,2,3], -"d2/d6d/bubble__sort__2_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,14,2,2], +"d1/df9/problem__26_2sol1_8c.html":[15,0,14,14,0], +"d1/df9/problem__26_2sol1_8c.html#a0ddf1224851353fc92bfbff6f499fa97":[15,0,14,14,0,3], +"d1/df9/problem__26_2sol1_8c.html#a619eec3220cebd7c5e455edbb14e9b12":[15,0,14,14,0,0], +"d1/df9/problem__26_2sol1_8c.html#aabf4f709c8199e41cf279c77112345fe":[15,0,14,14,0,1], +"d1/df9/problem__26_2sol1_8c.html#ac70138609ef6aa6fabca57aca8681e83":[15,0,14,14,0,2], +"d2/d36/structqueue.html":[14,0,31], +"d2/d6a/struct_graph_rep.html":[14,0,17], +"d2/d6d/bubble__sort__2_8c.html":[15,0,16,2], +"d2/d6d/bubble__sort__2_8c.html#a392fb874e547e582e9c66a08a1f23326":[15,0,16,2,0], +"d2/d6d/bubble__sort__2_8c.html#a7406723363363b34f29d18f5a80f1281":[15,0,16,2,1], +"d2/d6d/bubble__sort__2_8c.html#aa8dca7b867074164d5f45b0f3851269d":[15,0,16,2,3], +"d2/d6d/bubble__sort__2_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,16,2,2], "d2/d71/struct_a_v_lnode.html":[14,0,4], -"d2/d71/struct_a_v_lnode.html#a91349e8b477c6e9d45187997ca2e2a50":[14,0,4,2], -"d2/d71/struct_a_v_lnode.html#aaf07c08df1ee92ae2512869a178a14d9":[14,0,4,3], -"d2/d71/struct_a_v_lnode.html#ab3391d72c5ace9f85889430ce18383ef":[14,0,4,1], -"d2/d71/struct_a_v_lnode.html#af7b887a7fffb15778d53e167a95e40d9":[14,0,4,0], -"d2/d83/merge__sort_8c.html":[15,0,14,6], -"d2/d83/merge__sort_8c.html#a840291bc02cba5474a4cb46a9b9566fe":[15,0,14,6,0], -"d2/d93/problem__8_2sol2_8c.html":[15,0,12,21,1], -"d2/d93/problem__8_2sol2_8c.html#a0ddf1224851353fc92bfbff6f499fa97":[15,0,12,21,1,0], -"d2/da8/bead__sort_8c.html":[15,0,14,0], -"d2/da8/bead__sort_8c.html#ac0f2228420376f4db7e1274f2b41667c":[15,0,14,0,3], +"d2/d83/merge__sort_8c.html":[15,0,16,7], +"d2/d83/merge__sort_8c.html#a840291bc02cba5474a4cb46a9b9566fe":[15,0,16,7,0], +"d2/d93/problem__8_2sol2_8c.html":[15,0,14,21,1], +"d2/d93/problem__8_2sol2_8c.html#a0ddf1224851353fc92bfbff6f499fa97":[15,0,14,21,1,0], +"d2/d9b/floyd__cycle__detection__algorithm_8c.html":[15,0,15,2], +"d2/d9b/floyd__cycle__detection__algorithm_8c.html#aa8dca7b867074164d5f45b0f3851269d":[15,0,15,2,2], +"d2/d9b/floyd__cycle__detection__algorithm_8c.html#ac7af29ae53c6659f2881fb080b080f9d":[15,0,15,2,0], +"d2/d9b/floyd__cycle__detection__algorithm_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,15,2,1], +"d2/da8/bead__sort_8c.html":[15,0,16,0], +"d2/da8/bead__sort_8c.html#ac0f2228420376f4db7e1274f2b41667c":[15,0,16,0,3], "d2/daa/structadaline.html":[13,2,0,0], "d2/daa/structadaline.html#a32e58c03fd9258709eae6138ad0ec657":[13,2,0,0,2], "d2/daa/structadaline.html#a53314e737a0a5ff4552a03bcc9dafbc1":[13,2,0,0,1], "d2/daa/structadaline.html#a85dbd7cce6195d11ebb388220b96bde2":[13,2,0,0,0], -"d2/dae/problem__1_2sol2_8c.html":[15,0,12,0,1], -"d2/dae/problem__1_2sol2_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,12,0,1,0], -"d2/dbc/problem__3_2sol2_8c.html":[15,0,12,15,1], -"d2/dbc/problem__3_2sol2_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,12,15,1,0], -"d2/dc3/carray_8h_source.html":[15,0,2,0,0], -"d2/ddd/malloc__dbg_8h.html":[15,0,3,1], -"d2/ddd/malloc__dbg_8h.html#a10238aaeea60178d31fbb74347e941aa":[15,0,3,1,5], -"d2/ddd/malloc__dbg_8h.html#a3f9195a04ac8e8a9868ee3e416db7e8c":[15,0,3,1,4], -"d2/ddd/malloc__dbg_8h.html#a725f50ecaf1959d96de79b36b4788fee":[15,0,3,1,2], -"d2/ddd/malloc__dbg_8h.html#a9cc854374299a1dd933bf62029761768":[15,0,3,1,1], -"d2/ddd/malloc__dbg_8h.html#abfd0a4452069af4cfefe4a5d037e92ef":[15,0,3,1,6], -"d2/ddd/malloc__dbg_8h.html#aec6b5ee323e5338f23a1ce6fe9974f25":[15,0,3,1,3], -"d2/ddd/malloc__dbg_8h.html#afdddaa949a93c1ef559a638e98f9c21b":[15,0,3,1,0], -"d2/ddd/malloc__dbg_8h_source.html":[15,0,3,1], -"d2/de8/structeuler__.html":[13,0,7,1], -"d2/de8/structeuler__.html#a34941b75b9bb747cd68d28315fa9691a":[13,0,7,1,0], -"d2/de8/structeuler__.html#a3f1b77e489be443a8d84a84082b8092e":[13,0,7,1,4], -"d2/de8/structeuler__.html#a899572e1b6a43387128de3a402a0a5f8":[13,0,7,1,2], -"d2/de8/structeuler__.html#aa71f9aa6dfa32d8014b2d54ab8410e0b":[13,0,7,1,3], -"d2/de8/structeuler__.html#aad52507cc423ec49847471f6f15dd9d7":[13,0,7,1,5], -"d2/de8/structeuler__.html#abbbf12f0a960faf783d219f9012cdce6":[13,0,7,1,1], -"d2/df6/kohonen__som__topology_8c.html":[15,0,9,2], -"d2/df6/kohonen__som__topology_8c.html#a0283886819c7c140a023582b7269e2d0":[15,0,9,2,13], -"d2/df6/kohonen__som__topology_8c.html#a1440a7779ac56f47a3f355ce4a8c7da0":[15,0,9,2,12], -"d2/df6/kohonen__som__topology_8c.html#a2256c10b16edba377b64a44b6c656908":[15,0,9,2,4], -"d2/df6/kohonen__som__topology_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,9,2,9], -"d2/df6/kohonen__som__topology_8c.html#a525335710b53cb064ca56b936120431e":[15,0,9,2,0], -"d2/df6/kohonen__som__topology_8c.html#a5bb02a8322d717ead1b11182c5f02a3a":[15,0,9,2,17], -"d2/df6/kohonen__som__topology_8c.html#a6d0455dd5c30adda100e95f0423c786e":[15,0,9,2,14], -"d2/df6/kohonen__som__topology_8c.html#ad9e25202bb8b481461f932668f249dbc":[15,0,9,2,16], -"d2/df6/kohonen__som__topology_8c.html#adb5ded007be1fd666fab9affe6764018":[15,0,9,2,15], -"d3/d39/hash__adler32_8c.html":[15,0,8,0], -"d3/d39/hash__adler32_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,8,0,1], -"d3/d47/modified__binary__search_8c.html":[15,0,13,2], -"d3/d47/modified__binary__search_8c.html#a0cfaa56aacf960e4628a0fb27add8890":[15,0,13,2,0], -"d3/d47/modified__binary__search_8c.html#a7df9a198e30cded6229d79bef7591f8f":[15,0,13,2,2], -"d3/d47/modified__binary__search_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,13,2,1], +"d2/dae/problem__1_2sol2_8c.html":[15,0,14,0,1], +"d2/dae/problem__1_2sol2_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,14,0,1,0], +"d2/dbc/problem__3_2sol2_8c.html":[15,0,14,15,1], +"d2/dbc/problem__3_2sol2_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,14,15,1,0], +"d2/dc3/carray_8h_source.html":[15,0,3,0,0], +"d2/ddd/malloc__dbg_8h.html":[15,0,4,1], +"d2/ddd/malloc__dbg_8h.html#a37914d05ba1fe8848aa1b48cda719422":[15,0,4,1,5], +"d2/ddd/malloc__dbg_8h.html#a3f9195a04ac8e8a9868ee3e416db7e8c":[15,0,4,1,4], +"d2/ddd/malloc__dbg_8h.html#a725f50ecaf1959d96de79b36b4788fee":[15,0,4,1,2], +"d2/ddd/malloc__dbg_8h.html#a9cc854374299a1dd933bf62029761768":[15,0,4,1,1], +"d2/ddd/malloc__dbg_8h.html#ab07f946b77155ca78d0e14e231a99f5d":[15,0,4,1,3], +"d2/ddd/malloc__dbg_8h.html#abfd0a4452069af4cfefe4a5d037e92ef":[15,0,4,1,6], +"d2/ddd/malloc__dbg_8h.html#afdddaa949a93c1ef559a638e98f9c21b":[15,0,4,1,0], +"d2/ddd/malloc__dbg_8h_source.html":[15,0,4,1], +"d2/de8/structeuler__.html":[13,0,2,1], +"d2/de8/structeuler__.html#a34941b75b9bb747cd68d28315fa9691a":[13,0,2,1,0], +"d2/de8/structeuler__.html#a3f1b77e489be443a8d84a84082b8092e":[13,0,2,1,4], +"d2/de8/structeuler__.html#a899572e1b6a43387128de3a402a0a5f8":[13,0,2,1,2], +"d2/de8/structeuler__.html#aa71f9aa6dfa32d8014b2d54ab8410e0b":[13,0,2,1,3], +"d2/de8/structeuler__.html#aad52507cc423ec49847471f6f15dd9d7":[13,0,2,1,5], +"d2/de8/structeuler__.html#abbbf12f0a960faf783d219f9012cdce6":[13,0,2,1,1], +"d2/df6/kohonen__som__topology_8c.html":[15,0,11,2], +"d2/df6/kohonen__som__topology_8c.html#a0283886819c7c140a023582b7269e2d0":[15,0,11,2,13], +"d2/df6/kohonen__som__topology_8c.html#a1440a7779ac56f47a3f355ce4a8c7da0":[15,0,11,2,12], +"d2/df6/kohonen__som__topology_8c.html#a2256c10b16edba377b64a44b6c656908":[15,0,11,2,4], +"d2/df6/kohonen__som__topology_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,11,2,9], +"d2/df6/kohonen__som__topology_8c.html#a525335710b53cb064ca56b936120431e":[15,0,11,2,0], +"d2/df6/kohonen__som__topology_8c.html#a5bb02a8322d717ead1b11182c5f02a3a":[15,0,11,2,17], +"d2/df6/kohonen__som__topology_8c.html#a6d0455dd5c30adda100e95f0423c786e":[15,0,11,2,14], +"d2/df6/kohonen__som__topology_8c.html#ad9e25202bb8b481461f932668f249dbc":[15,0,11,2,16], +"d2/df6/kohonen__som__topology_8c.html#adb5ded007be1fd666fab9affe6764018":[15,0,11,2,15], +"d3/d39/hash__adler32_8c.html":[15,0,10,0], +"d3/d39/hash__adler32_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,10,0,1], +"d3/d47/modified__binary__search_8c.html":[15,0,15,4], +"d3/d47/modified__binary__search_8c.html#a0cfaa56aacf960e4628a0fb27add8890":[15,0,15,4,0], +"d3/d47/modified__binary__search_8c.html#a7df9a198e30cded6229d79bef7591f8f":[15,0,15,4,2], +"d3/d47/modified__binary__search_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,15,4,1], "d3/d5a/struct__large__num.html":[14,0,2], "d3/d5a/struct__large__num.html#a3fd11c0b413bbabfb8737d4ae73e5aa0":[14,0,2,1], "d3/d5a/struct__large__num.html#afaf353a072cf050ac86ac6e39868bcc9":[14,0,2,0], +"d3/d78/words__alphabetical_8c.html":[15,0,3,1,3], +"d3/d78/words__alphabetical_8c.html#a0ac11529daf94e98f7114a6e938679a9":[15,0,3,1,3,1], +"d3/d78/words__alphabetical_8c.html#a151b2c78ae821d0495faf936a1c2530f":[15,0,3,1,3,8], +"d3/d78/words__alphabetical_8c.html#a1e5ad8401396df36ab585d79f3309fd9":[15,0,3,1,3,2], +"d3/d78/words__alphabetical_8c.html#a22516c70583c9fa78e4edffb063836cc":[15,0,3,1,3,10], +"d3/d78/words__alphabetical_8c.html#a5157a5b4e164f934602fa78413504029":[15,0,3,1,3,4], +"d3/d78/words__alphabetical_8c.html#a840902ada0e956eb01b529be178748cc":[15,0,3,1,3,5], +"d3/d78/words__alphabetical_8c.html#a9e3cab68cf6557024f0073f674a307a1":[15,0,3,1,3,6], +"d3/d78/words__alphabetical_8c.html#aa8dca7b867074164d5f45b0f3851269d":[15,0,3,1,3,9], +"d3/d78/words__alphabetical_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,3,1,3,7], +"d3/d78/words__alphabetical_8c.html#af1f9b6eb320d872ba0766dc8bd070075":[15,0,3,1,3,3], "d4/d02/struct_b_s_t_iterator.html":[14,0,5], -"d4/d02/struct_b_s_t_iterator.html#a29a6586bff08dc6985b29abb50ddc2ff":[14,0,5,2], -"d4/d02/struct_b_s_t_iterator.html#a7b13dbbbe1bcbb12ec0bbe9949c66c5b":[14,0,5,0], -"d4/d02/struct_b_s_t_iterator.html#ae02c531c71091f43880fd7eb8f13cc53":[14,0,5,1], -"d4/d07/ode__forward__euler_8c.html":[15,0,11,3], -"d4/d07/ode__forward__euler_8c.html#a0ddf1224851353fc92bfbff6f499fa97":[15,0,11,3,4], -"d4/d07/ode__forward__euler_8c.html#a8caee977b26888d34040b122e0e28e3a":[15,0,11,3,1], -"d4/d07/ode__forward__euler_8c.html#a97075291390a68c262ed66e157a57eb4":[15,0,11,3,5], -"d4/d07/ode__forward__euler_8c.html#a9ceb646336224ee890a269d0b4600d09":[15,0,11,3,0], -"d4/d07/ode__forward__euler_8c.html#aaf88ad8f9f7c39fc38f3f03d6fea9df9":[15,0,11,3,2], -"d4/d07/ode__forward__euler_8c.html#ae6c9413953c8d9d4bc9e374b29586350":[15,0,11,3,3], -"d4/d2d/struct_c_array.html":[14,0,6], -"d4/d2d/struct_c_array.html#a53c08029937d9e4c45defcbf9c8898ae":[14,0,6,0], -"d4/d2d/struct_c_array.html#a7f7310046fa06b26a1ff7772500724ee":[14,0,6,1], +"d4/d07/ode__forward__euler_8c.html":[15,0,13,3], +"d4/d07/ode__forward__euler_8c.html#a0ddf1224851353fc92bfbff6f499fa97":[15,0,13,3,4], +"d4/d07/ode__forward__euler_8c.html#a8caee977b26888d34040b122e0e28e3a":[15,0,13,3,1], +"d4/d07/ode__forward__euler_8c.html#a97075291390a68c262ed66e157a57eb4":[15,0,13,3,5], +"d4/d07/ode__forward__euler_8c.html#a9ceb646336224ee890a269d0b4600d09":[15,0,13,3,0], +"d4/d07/ode__forward__euler_8c.html#aaf88ad8f9f7c39fc38f3f03d6fea9df9":[15,0,13,3,2], +"d4/d07/ode__forward__euler_8c.html#ae6c9413953c8d9d4bc9e374b29586350":[15,0,13,3,3], +"d4/d2d/struct_c_array.html":[14,0,7], "d4/d4c/md__c_o_d_e__o_f__c_o_n_d_u_c_t.html":[1], "d4/d4c/md__c_o_d_e__o_f__c_o_n_d_u_c_t.html#autotoc_md1":[1,0], "d4/d4c/md__c_o_d_e__o_f__c_o_n_d_u_c_t.html#autotoc_md2":[1,1], @@ -231,23 +209,45 @@ var NAVTREEINDEX0 = "d4/d4c/md__c_o_d_e__o_f__c_o_n_d_u_c_t.html#autotoc_md4":[1,3], "d4/d4c/md__c_o_d_e__o_f__c_o_n_d_u_c_t.html#autotoc_md5":[1,4], "d4/d4c/md__c_o_d_e__o_f__c_o_n_d_u_c_t.html#autotoc_md6":[1,5], -"d4/d68/qr__decompose_8h.html":[15,0,11,6], -"d4/d68/qr__decompose_8h.html#a3a584b79941a43d775f9d4ce446dbe05":[15,0,11,6,2], -"d4/d68/qr__decompose_8h.html#a45c7640d9d22c89c11beb1f567843c56":[15,0,11,6,1], -"d4/d68/qr__decompose_8h.html#a6b6a0e75e75ff7919057dd275bb69145":[15,0,11,6,5], -"d4/d68/qr__decompose_8h.html#a82b20e027437df768d7e994cf4cae29f":[15,0,11,6,4], -"d4/d68/qr__decompose_8h.html#a90562ce8c3707401e9c5809dece68d6a":[15,0,11,6,0], -"d4/d68/qr__decompose_8h.html#abeec1f78a7a7e7251687e75340331212":[15,0,11,6,3], -"d4/d68/qr__decompose_8h_source.html":[15,0,11,6], -"d4/d69/group__dual__quats.html":[13,0,8], -"d4/d69/group__dual__quats.html#ga27005601c47e5bb7aafe77659e76c88f":[15,0,6,0,1], -"d4/d69/group__dual__quats.html#ga27005601c47e5bb7aafe77659e76c88f":[13,0,8,1], -"d4/d73/struct_m_e_m_o_r_y___i_n_f_o_r_m_a_t_i_o_n.html":[14,0,23], -"d4/d73/struct_m_e_m_o_r_y___i_n_f_o_r_m_a_t_i_o_n.html#a1cec46413acf776e3ee2b0b9241490c3":[14,0,23,5], -"d4/d73/struct_m_e_m_o_r_y___i_n_f_o_r_m_a_t_i_o_n.html#a1f13725b3de5ca6ab99b238b712cb417":[14,0,23,2], -"d4/d73/struct_m_e_m_o_r_y___i_n_f_o_r_m_a_t_i_o_n.html#a6b0971c1415de6e0123b8d0d0a626fde":[14,0,23,6], -"d4/d73/struct_m_e_m_o_r_y___i_n_f_o_r_m_a_t_i_o_n.html#a731603550d2238abb179f2b572f20d99":[14,0,23,3], -"d4/d73/struct_m_e_m_o_r_y___i_n_f_o_r_m_a_t_i_o_n.html#a7f42967fd6562d77ac03445ea6e36a3d":[14,0,23,0], -"d4/d73/struct_m_e_m_o_r_y___i_n_f_o_r_m_a_t_i_o_n.html#a934ad84d159c35b24ff54f7eceb1c6be":[14,0,23,1], -"d4/d73/struct_m_e_m_o_r_y___i_n_f_o_r_m_a_t_i_o_n.html#aa296b903d0e2ac54acaa7c305bae8007":[14,0,23,4] +"d4/d68/qr__decompose_8h.html":[15,0,13,6], +"d4/d68/qr__decompose_8h.html#a2ed4977f38642dca8b10c16a823c740b":[15,0,13,6,4], +"d4/d68/qr__decompose_8h.html#a3a584b79941a43d775f9d4ce446dbe05":[15,0,13,6,2], +"d4/d68/qr__decompose_8h.html#a45c7640d9d22c89c11beb1f567843c56":[15,0,13,6,1], +"d4/d68/qr__decompose_8h.html#a5ee39e7c8fce8a604dcf7009ce101c02":[15,0,13,6,5], +"d4/d68/qr__decompose_8h.html#a90562ce8c3707401e9c5809dece68d6a":[15,0,13,6,0], +"d4/d68/qr__decompose_8h.html#abeec1f78a7a7e7251687e75340331212":[15,0,13,6,3], +"d4/d68/qr__decompose_8h_source.html":[15,0,13,6], +"d4/d69/group__dual__quats.html":[13,0,3], +"d4/d69/group__dual__quats.html#ga27005601c47e5bb7aafe77659e76c88f":[13,0,3,1], +"d4/d73/struct_m_e_m_o_r_y___i_n_f_o_r_m_a_t_i_o_n.html":[14,0,24], +"d4/d73/struct_m_e_m_o_r_y___i_n_f_o_r_m_a_t_i_o_n.html#a1cec46413acf776e3ee2b0b9241490c3":[14,0,24,5], +"d4/d73/struct_m_e_m_o_r_y___i_n_f_o_r_m_a_t_i_o_n.html#a1f13725b3de5ca6ab99b238b712cb417":[14,0,24,2], +"d4/d73/struct_m_e_m_o_r_y___i_n_f_o_r_m_a_t_i_o_n.html#a6b0971c1415de6e0123b8d0d0a626fde":[14,0,24,6], +"d4/d73/struct_m_e_m_o_r_y___i_n_f_o_r_m_a_t_i_o_n.html#a731603550d2238abb179f2b572f20d99":[14,0,24,3], +"d4/d73/struct_m_e_m_o_r_y___i_n_f_o_r_m_a_t_i_o_n.html#a7f42967fd6562d77ac03445ea6e36a3d":[14,0,24,0], +"d4/d73/struct_m_e_m_o_r_y___i_n_f_o_r_m_a_t_i_o_n.html#a934ad84d159c35b24ff54f7eceb1c6be":[14,0,24,1], +"d4/d73/struct_m_e_m_o_r_y___i_n_f_o_r_m_a_t_i_o_n.html#aa296b903d0e2ac54acaa7c305bae8007":[14,0,24,4], +"d4/d7b/problem__6_2sol_8c.html":[15,0,14,19,0], +"d4/d7b/problem__6_2sol_8c.html#a840291bc02cba5474a4cb46a9b9566fe":[15,0,14,19,0,0], +"d4/d83/problem__401_2sol1_8c.html":[15,0,14,17,0], +"d4/d83/problem__401_2sol1_8c.html#a236548478af932f1115a71f601a68788":[15,0,14,17,0,6], +"d4/d83/problem__401_2sol1_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,14,17,0,4], +"d4/d83/problem__401_2sol1_8c.html#a4441a6d27134cf3aed05727800d99456":[15,0,14,17,0,3], +"d4/d83/problem__401_2sol1_8c.html#a7380e14d595d560007b02ce516b6b215":[15,0,14,17,0,2], +"d4/d83/problem__401_2sol1_8c.html#a7a9a231e30b47bc0345749c8bd1e5077":[15,0,14,17,0,0], +"d4/d83/problem__401_2sol1_8c.html#aaf964739be92adc2f500e7da11e3f6be":[15,0,14,17,0,5], +"d4/d83/problem__401_2sol1_8c.html#ade1bdf2529e3c58f53bfb4d844f3a9d3":[15,0,14,17,0,1], +"d4/d99/fibonacci__fast_8c.html":[15,0,12,4], +"d4/d99/fibonacci__fast_8c.html#a0ddf1224851353fc92bfbff6f499fa97":[15,0,12,4,1], +"d4/d99/fibonacci__fast_8c.html#a7a3d55bd19854075cba2eed6b63cb2d3":[15,0,12,4,0], +"d4/d99/ode__semi__implicit__euler_8c.html":[15,0,13,5], +"d4/d99/ode__semi__implicit__euler_8c.html#a0ddf1224851353fc92bfbff6f499fa97":[15,0,13,5,2], +"d4/d99/ode__semi__implicit__euler_8c.html#a720b7e995d2bbc615f94a2c7dbcf84eb":[15,0,13,5,5], +"d4/d99/ode__semi__implicit__euler_8c.html#a8caee977b26888d34040b122e0e28e3a":[15,0,13,5,1], +"d4/d99/ode__semi__implicit__euler_8c.html#a97075291390a68c262ed66e157a57eb4":[15,0,13,5,3], +"d4/d99/ode__semi__implicit__euler_8c.html#a9ceb646336224ee890a269d0b4600d09":[15,0,13,5,0], +"d4/d99/ode__semi__implicit__euler_8c.html#ad80059877222f885b549f2d0a3dc6b55":[15,0,13,5,4], +"d4/dbd/problem__23_2sol2_8c.html":[15,0,14,12,1], +"d4/dbd/problem__23_2sol2_8c.html#a1aca7f530f82b27100262adba9e7556b":[15,0,14,12,1,1], +"d4/dbd/problem__23_2sol2_8c.html#a34f4ad85151e3a43368ae67f42347f56":[15,0,14,12,1,2] }; diff --git a/navtreeindex1.js b/navtreeindex1.js index fcd7f8a83..3b35e8acb 100644 --- a/navtreeindex1.js +++ b/navtreeindex1.js @@ -1,95 +1,49 @@ var NAVTREEINDEX1 = { -"d4/d7b/problem__6_2sol_8c.html":[15,0,12,19,0], -"d4/d7b/problem__6_2sol_8c.html#a840291bc02cba5474a4cb46a9b9566fe":[15,0,12,19,0,0], -"d4/d83/problem__401_2sol1_8c.html":[15,0,12,17,0], -"d4/d83/problem__401_2sol1_8c.html#a236548478af932f1115a71f601a68788":[15,0,12,17,0,7], -"d4/d83/problem__401_2sol1_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,12,17,0,5], -"d4/d83/problem__401_2sol1_8c.html#a4441a6d27134cf3aed05727800d99456":[15,0,12,17,0,4], -"d4/d83/problem__401_2sol1_8c.html#a7380e14d595d560007b02ce516b6b215":[15,0,12,17,0,3], -"d4/d83/problem__401_2sol1_8c.html#a7a9a231e30b47bc0345749c8bd1e5077":[15,0,12,17,0,1], -"d4/d83/problem__401_2sol1_8c.html#aacbb9e1f38be71e22df1584a37c56693":[15,0,12,17,0,0], -"d4/d83/problem__401_2sol1_8c.html#aaf964739be92adc2f500e7da11e3f6be":[15,0,12,17,0,6], -"d4/d83/problem__401_2sol1_8c.html#ade1bdf2529e3c58f53bfb4d844f3a9d3":[15,0,12,17,0,2], -"d4/d99/fibonacci__fast_8c.html":[15,0,10,4], -"d4/d99/fibonacci__fast_8c.html#a0ddf1224851353fc92bfbff6f499fa97":[15,0,10,4,1], -"d4/d99/fibonacci__fast_8c.html#a7a3d55bd19854075cba2eed6b63cb2d3":[15,0,10,4,0], -"d4/d99/ode__semi__implicit__euler_8c.html":[15,0,11,5], -"d4/d99/ode__semi__implicit__euler_8c.html#a0ddf1224851353fc92bfbff6f499fa97":[15,0,11,5,2], -"d4/d99/ode__semi__implicit__euler_8c.html#a720b7e995d2bbc615f94a2c7dbcf84eb":[15,0,11,5,5], -"d4/d99/ode__semi__implicit__euler_8c.html#a8caee977b26888d34040b122e0e28e3a":[15,0,11,5,1], -"d4/d99/ode__semi__implicit__euler_8c.html#a97075291390a68c262ed66e157a57eb4":[15,0,11,5,3], -"d4/d99/ode__semi__implicit__euler_8c.html#a9ceb646336224ee890a269d0b4600d09":[15,0,11,5,0], -"d4/d99/ode__semi__implicit__euler_8c.html#ad80059877222f885b549f2d0a3dc6b55":[15,0,11,5,4], -"d4/dbd/problem__23_2sol2_8c.html":[15,0,12,12,1], -"d4/dbd/problem__23_2sol2_8c.html#a1aca7f530f82b27100262adba9e7556b":[15,0,12,12,1,1], -"d4/dbd/problem__23_2sol2_8c.html#a34f4ad85151e3a43368ae67f42347f56":[15,0,12,12,1,2], -"d4/dbd/problem__23_2sol2_8c.html#a3ab61b5a1c4f2288625d160aa0ea8478":[15,0,12,12,1,3], -"d4/dbd/problem__23_2sol2_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,12,12,1,4], -"d4/dbd/problem__23_2sol2_8c.html#ac5d600bf3077f4188afc4c5cd2c40eaf":[15,0,12,12,1,0], -"d4/dbd/problem__23_2sol2_8c.html#af920a16d6ef69dd604b283f427892e06":[15,0,12,12,1,5], +"d4/dbd/problem__23_2sol2_8c.html#a3ab61b5a1c4f2288625d160aa0ea8478":[15,0,14,12,1,3], +"d4/dbd/problem__23_2sol2_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,14,12,1,4], +"d4/dbd/problem__23_2sol2_8c.html#ac5d600bf3077f4188afc4c5cd2c40eaf":[15,0,14,12,1,0], +"d4/dbd/problem__23_2sol2_8c.html#af920a16d6ef69dd604b283f427892e06":[15,0,14,12,1,5], "d4/dcb/md_hash__r_e_a_d_m_e.html":[9], -"d4/dcc/strong__number_8c.html":[15,0,10,9], -"d4/dcc/strong__number_8c.html#a03654cadb0cfe1195810dbe5da0265b5":[15,0,10,9,0], -"d4/dcc/strong__number_8c.html#ae1a3968e7947464bee7714f6d43b7002":[15,0,10,9,2], -"d4/dcc/strong__number_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,10,9,1], -"d4/dd4/struct_graph.html":[14,0,15], -"d4/dd4/struct_graph.html#a10ff9c6c323cf435f18e424dbb62235e":[14,0,15,3], -"d4/dd4/struct_graph.html#a14b3734eb135c40cf4401f22bda5bb76":[14,0,15,2], -"d4/dd4/struct_graph.html#a268ba18d421817ad8713c2e92f19d82a":[14,0,15,5], -"d4/dd4/struct_graph.html#a2b722f7cfa7a21e4cb5fae488b3d4dcc":[14,0,15,7], -"d4/dd4/struct_graph.html#a3535be2ce0d62152e54395951330da81":[14,0,15,4], -"d4/dd4/struct_graph.html#a3ce250f958f7e96ffd9eb06780c21fbe":[14,0,15,1], -"d4/dd4/struct_graph.html#a6afcd41564ea00294a4c089414979ca1":[14,0,15,8], -"d4/dd4/struct_graph.html#a72bb0a04571b49a568e0eed371a35c33":[14,0,15,6], -"d4/dd4/struct_graph.html#aa3f9278e0b50fbec06b93cda9c733dfe":[14,0,15,9], -"d4/dd4/struct_graph.html#aaaffb7e0621115519a09be31a33c6cda":[14,0,15,0], -"d4/de3/hash__djb2_8c.html":[15,0,8,2], -"d4/de3/hash__djb2_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,8,2,1], -"d4/dea/problem__14_2sol1_8c.html":[15,0,12,4,0], -"d4/dea/problem__14_2sol1_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,12,4,0,1], -"d4/dea/problem__14_2sol1_8c.html#a81c1df5c17cb16bcc16e346fcff6fa80":[15,0,12,4,0,0], -"d4/dfe/struct_dict.html":[14,0,9], -"d4/dfe/struct_dict.html#a2e14d738e06c60eebcc2eac274e6676e":[14,0,9,0], -"d4/dfe/struct_dict.html#add3f42ea66e92ce457a243d7534f5654":[14,0,9,1], -"d5/d23/qr__decomposition_8c.html":[15,0,11,7], -"d5/d23/qr__decomposition_8c.html#a840291bc02cba5474a4cb46a9b9566fe":[15,0,11,7,0], -"d5/d38/bubble__sort__recursion_8c.html":[15,0,14,3], -"d5/d38/bubble__sort__recursion_8c.html#aa8989f6c9bfd1f040854fa18b180114f":[15,0,14,3,0], -"d5/d38/bubble__sort__recursion_8c.html#ad126fa7239be97373c96861adc70b1d3":[15,0,14,3,2], -"d5/d38/bubble__sort__recursion_8c.html#ae1a3968e7947464bee7714f6d43b7002":[15,0,14,3,3], -"d5/d38/bubble__sort__recursion_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,14,3,1], -"d5/d3d/problem__5_2sol2_8c.html":[15,0,12,18,1], -"d5/d3d/problem__5_2sol2_8c.html#a840291bc02cba5474a4cb46a9b9566fe":[15,0,12,18,1,1], -"d5/d3d/problem__5_2sol2_8c.html#aa7cfa5a28d00d93ec48fab9c3fd5812f":[15,0,12,18,1,0], -"d5/d3d/problem__5_2sol2_8c.html#adb59595677da81f071c34f3847fdbaa6":[15,0,12,18,1,2], +"d4/dcc/strong__number_8c.html":[15,0,12,10], +"d4/dcc/strong__number_8c.html#a03654cadb0cfe1195810dbe5da0265b5":[15,0,12,10,0], +"d4/dcc/strong__number_8c.html#ae1a3968e7947464bee7714f6d43b7002":[15,0,12,10,2], +"d4/dcc/strong__number_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,12,10,1], +"d4/dd4/struct_graph.html":[14,0,16], +"d4/de3/hash__djb2_8c.html":[15,0,10,2], +"d4/de3/hash__djb2_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,10,2,1], +"d4/dea/problem__14_2sol1_8c.html":[15,0,14,4,0], +"d4/dea/problem__14_2sol1_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,14,4,0,1], +"d4/dea/problem__14_2sol1_8c.html#a81c1df5c17cb16bcc16e346fcff6fa80":[15,0,14,4,0,0], +"d4/dfe/struct_dict.html":[14,0,10], +"d5/d23/qr__decomposition_8c.html":[15,0,13,7], +"d5/d23/qr__decomposition_8c.html#a840291bc02cba5474a4cb46a9b9566fe":[15,0,13,7,0], +"d5/d38/bubble__sort__recursion_8c.html":[15,0,16,3], +"d5/d38/bubble__sort__recursion_8c.html#aa8989f6c9bfd1f040854fa18b180114f":[15,0,16,3,0], +"d5/d38/bubble__sort__recursion_8c.html#ad126fa7239be97373c96861adc70b1d3":[15,0,16,3,2], +"d5/d38/bubble__sort__recursion_8c.html#ae1a3968e7947464bee7714f6d43b7002":[15,0,16,3,3], +"d5/d38/bubble__sort__recursion_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,16,3,1], +"d5/d3d/problem__5_2sol2_8c.html":[15,0,14,18,1], +"d5/d3d/problem__5_2sol2_8c.html#a840291bc02cba5474a4cb46a9b9566fe":[15,0,14,18,1,1], +"d5/d3d/problem__5_2sol2_8c.html#aa7cfa5a28d00d93ec48fab9c3fd5812f":[15,0,14,18,1,0], +"d5/d3d/problem__5_2sol2_8c.html#adb59595677da81f071c34f3847fdbaa6":[15,0,14,18,1,2], "d5/d4c/group__sorting.html":[13,5], "d5/d4c/group__sorting.html#ga2fb01e00dedb437a42010f6309e7eba8":[13,5,1], -"d5/d4c/group__sorting.html#ga2fb01e00dedb437a42010f6309e7eba8":[15,0,14,0,1], "d5/d4c/group__sorting.html#ga4b9708d87be7a409eff20e5e7e8b43c8":[13,5,8], -"d5/d4c/group__sorting.html#ga4b9708d87be7a409eff20e5e7e8b43c8":[15,0,14,6,3], -"d5/d4c/group__sorting.html#ga4b9708d87be7a409eff20e5e7e8b43c8":[15,0,14,9,3], "d5/d4c/group__sorting.html#ga4fdb8af29a07ac8f496e49a11bf9f1bd":[13,5,0], -"d5/d4c/group__sorting.html#ga4fdb8af29a07ac8f496e49a11bf9f1bd":[15,0,14,0,0], "d5/d4c/group__sorting.html#ga5bc16eaf3ffe6a6ab66780dd445904c0":[13,5,6], -"d5/d4c/group__sorting.html#ga5bc16eaf3ffe6a6ab66780dd445904c0":[15,0,14,9,1], "d5/d4c/group__sorting.html#ga8dc3ec66cb3350313fdb34bfd1674729":[13,5,3], -"d5/d4c/group__sorting.html#ga8dc3ec66cb3350313fdb34bfd1674729":[15,0,14,6,1], "d5/d4c/group__sorting.html#ga98666b73777e308fb06a3c489ce25359":[13,5,5], -"d5/d4c/group__sorting.html#ga98666b73777e308fb06a3c489ce25359":[15,0,14,5,1], "d5/d4c/group__sorting.html#gab99b8a397bdd0bf2903d66c22ba4ba43":[13,5,4], -"d5/d4c/group__sorting.html#gab99b8a397bdd0bf2903d66c22ba4ba43":[15,0,14,6,2], "d5/d4c/group__sorting.html#gad7ed8cc4603f500d610054680d28b971":[13,5,2], -"d5/d4c/group__sorting.html#gad7ed8cc4603f500d610054680d28b971":[15,0,14,0,2], "d5/d4c/group__sorting.html#gaeccaf61ff47279384d1dba8d869d5c2f":[13,5,7], -"d5/d4c/group__sorting.html#gaeccaf61ff47279384d1dba8d869d5c2f":[15,0,14,9,2], -"d5/d7c/problem__5_2sol3_8c.html":[15,0,12,18,2], -"d5/d7c/problem__5_2sol3_8c.html#a59347107cbfdf48d51108e50280e760d":[15,0,12,18,2,0], -"d5/d7c/problem__5_2sol3_8c.html#a840291bc02cba5474a4cb46a9b9566fe":[15,0,12,18,2,2], -"d5/d7c/problem__5_2sol3_8c.html#ae9606f1867e9921867d6572f51377b4c":[15,0,12,18,2,1], -"d5/d7e/struct_t.html":[14,0,36], -"d5/d7e/struct_t.html#a2023d2bb6a6cdf472b567b3ec5cf35d4":[14,0,36,0], -"d5/d7e/struct_t.html#a5a06d4022d41bad87137ba3430abce8b":[14,0,36,1], +"d5/d5c/test__min__printf_8c.html":[15,0,4,4], +"d5/d5c/test__min__printf_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,4,4,0], +"d5/d7c/problem__5_2sol3_8c.html":[15,0,14,18,2], +"d5/d7c/problem__5_2sol3_8c.html#a59347107cbfdf48d51108e50280e760d":[15,0,14,18,2,0], +"d5/d7c/problem__5_2sol3_8c.html#a840291bc02cba5474a4cb46a9b9566fe":[15,0,14,18,2,2], +"d5/d7c/problem__5_2sol3_8c.html#ae9606f1867e9921867d6572f51377b4c":[15,0,14,18,2,1], +"d5/d7e/struct_t.html":[14,0,37], "d5/d88/md__d_i_r_e_c_t_o_r_y.html":[7], "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md40":[7,0], "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md41":[7,1], @@ -108,85 +62,66 @@ var NAVTREEINDEX1 = "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md54":[7,14], "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md55":[7,15], "d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md56":[7,16], -"d5/da1/structnode.html":[14,0,25], -"d5/da1/structnode.html#a111a569ab2765add9b91c9f94cf9f063":[14,0,25,7], -"d5/da1/structnode.html#a1aa632fdf50713d86192a96f8191851b":[14,0,25,6], -"d5/da1/structnode.html#a2783f1aec750191646305988f7e28756":[14,0,25,5], -"d5/da1/structnode.html#a2d890bb9f6af0ffd73fe79b21124c2a2":[14,0,25,1], -"d5/da1/structnode.html#a310a09cb5a882788781a5287096ad425":[14,0,25,0], -"d5/da1/structnode.html#a51e160f22dc6064bac4a4f9f1d931c2c":[14,0,25,10], -"d5/da1/structnode.html#a6f9100a3fe81d82776ce47ecdba94691":[14,0,25,2], -"d5/da1/structnode.html#a707bf3f1eeeaf8974e7e8e90f7bfd6a1":[14,0,25,12], -"d5/da1/structnode.html#a7f5750a90eac14a9a21d5b976cd8b8a7":[14,0,25,9], -"d5/da1/structnode.html#a8139af7faac30d394e198365a999b54d":[14,0,25,8], -"d5/da1/structnode.html#aaf2ec5ed1bb563465cbe2e9d16d74d1e":[14,0,25,11], -"d5/da1/structnode.html#ab4b1f345158daee0725acecd5ba817b1":[14,0,25,13], -"d5/da1/structnode.html#ac8973feda870a119ccdc25910254db0c":[14,0,25,3], -"d5/da1/structnode.html#af7109e6ffd82cbbb705e486fd0ce92f0":[14,0,25,4], -"d5/db4/struct_edge.html":[14,0,12], -"d5/db4/struct_edge.html#a0c7bb90b11b1b795c665786317ca744d":[14,0,12,4], -"d5/db4/struct_edge.html#a2449478938136b5ab7ef0e7d92e6990b":[14,0,12,1], -"d5/db4/struct_edge.html#a4d58e1f4de38fa55549497175981ebab":[14,0,12,5], -"d5/db4/struct_edge.html#a9a415f211c059647d1b3af8fcf7a0e30":[14,0,12,2], -"d5/db4/struct_edge.html#ad7df434ff7710e69f28bb31e91a35f82":[14,0,12,0], -"d5/db4/struct_edge.html#ae746ca841799f776a8add4d6fdfc19e9":[14,0,12,3], -"d5/db4/structvec__3d__.html":[13,0,5,0], -"d5/db4/structvec__3d__.html#a3339a40de7385fa55bee30be81c098c6":[13,0,5,0,2], -"d5/db4/structvec__3d__.html#a53462a5a195c9e16fb584f73fd66c3d0":[13,0,5,0,0], -"d5/db4/structvec__3d__.html#a76098d39a382838df3b4b48c3443413b":[13,0,5,0,1], -"d5/db8/vectors__3d_8c.html":[15,0,6,2], -"d5/db8/vectors__3d_8c.html#a840291bc02cba5474a4cb46a9b9566fe":[15,0,6,2,2], -"d5/db8/vectors__3d_8c.html#aa8dca7b867074164d5f45b0f3851269d":[15,0,6,2,4], +"d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md57":[7,17], +"d5/da1/structnode.html":[14,0,26], +"d5/da1/structnode.html#a2d890bb9f6af0ffd73fe79b21124c2a2":[14,0,26,0], +"d5/da1/structnode.html#a51e160f22dc6064bac4a4f9f1d931c2c":[14,0,26,2], +"d5/da1/structnode.html#af7109e6ffd82cbbb705e486fd0ce92f0":[14,0,26,1], +"d5/db4/struct_edge.html":[14,0,13], +"d5/db4/structvec__3d__.html":[13,0,0,0], +"d5/db4/structvec__3d__.html#a3339a40de7385fa55bee30be81c098c6":[13,0,0,0,2], +"d5/db4/structvec__3d__.html#a53462a5a195c9e16fb584f73fd66c3d0":[13,0,0,0,0], +"d5/db4/structvec__3d__.html#a76098d39a382838df3b4b48c3443413b":[13,0,0,0,1], +"d5/db8/vectors__3d_8c.html":[15,0,7,2], +"d5/db8/vectors__3d_8c.html#a840291bc02cba5474a4cb46a9b9566fe":[15,0,7,2,3], +"d5/db8/vectors__3d_8c.html#aa8dca7b867074164d5f45b0f3851269d":[15,0,7,2,5], +"d5/de2/sentinel__linear__search_8c.html":[15,0,15,5], +"d5/de2/sentinel__linear__search_8c.html#a16a7a1ef83db52643fe23d48280065ce":[15,0,15,5,1], +"d5/de2/sentinel__linear__search_8c.html#aa8dca7b867074164d5f45b0f3851269d":[15,0,15,5,2], +"d5/de2/sentinel__linear__search_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,15,5,0], "d5/df4/group__sudoku.html":[13,4], -"d5/df4/group__sudoku.html#ga1cd43df3f4187845ce186042fe53e6f1":[15,0,10,10,3], "d5/df4/group__sudoku.html#ga1cd43df3f4187845ce186042fe53e6f1":[13,4,3], -"d5/df4/group__sudoku.html#ga3a0ec150ac9d0cb6b28279d36d95d72f":[15,0,10,10,2], "d5/df4/group__sudoku.html#ga3a0ec150ac9d0cb6b28279d36d95d72f":[13,4,2], -"d5/df4/group__sudoku.html#ga62e94fc39f116e2c81daed8f5437431b":[15,0,10,10,0], "d5/df4/group__sudoku.html#ga62e94fc39f116e2c81daed8f5437431b":[13,4,1], -"d5/df4/group__sudoku.html#ga6503128d4f5ce0a0826f72f73f9e0b2a":[15,0,10,10,4], "d5/df4/group__sudoku.html#ga6503128d4f5ce0a0826f72f73f9e0b2a":[13,4,4], -"d5/df4/group__sudoku.html#ga702ff4f95dde780c7d04fcdd1021b6c1":[15,0,10,10,6], "d5/df4/group__sudoku.html#ga702ff4f95dde780c7d04fcdd1021b6c1":[13,4,6], "d5/df4/group__sudoku.html#ga85d25d3b40017436f264a103685e4c55":[13,4,5], -"d5/df4/group__sudoku.html#ga85d25d3b40017436f264a103685e4c55":[15,0,10,10,5], -"d5/df4/group__sudoku.html#gadfe0ed5085b4775d8fa00b434cc0fdfc":[15,0,10,10,7], "d5/df4/group__sudoku.html#gadfe0ed5085b4775d8fa00b434cc0fdfc":[13,4,7], -"d6/d1b/sol4_8c.html":[15,0,12,0,3], -"d6/d1b/sol4_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,12,0,3,0], -"d6/d2e/cartesian__to__polar_8c.html":[15,0,10,1], -"d6/d2e/cartesian__to__polar_8c.html#a525335710b53cb064ca56b936120431e":[15,0,10,1,0], -"d6/d2e/cartesian__to__polar_8c.html#a60e62b809ca9dcb1b20a140b30d30f60":[15,0,10,1,1], -"d6/d2e/cartesian__to__polar_8c.html#ae1a3968e7947464bee7714f6d43b7002":[15,0,10,1,3], -"d6/d2e/cartesian__to__polar_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,10,1,2], -"d6/d2e/cartesian__to__polar_8c.html#afb80d77f0c994240309ccddcc9525e70":[15,0,10,1,4], -"d6/d3d/factorial__large__number_8c.html":[15,0,10,3], -"d6/d3d/factorial__large__number_8c.html#a0ddf1224851353fc92bfbff6f499fa97":[15,0,10,3,4], -"d6/d3d/factorial__large__number_8c.html#ab54882961780c41a4929a6d390f6522d":[15,0,10,3,1], -"d6/d3d/factorial__large__number_8c.html#ab5c854e0df76165c31899e69eceeeaae":[15,0,10,3,3], -"d6/d3d/factorial__large__number_8c.html#ad398ddbd594ca69a5e6dfc894925341e":[15,0,10,3,5], -"d6/d3d/factorial__large__number_8c.html#ad8101f58545bd891ae8b6e11caadd7eb":[15,0,10,3,6], -"d6/d3d/factorial__large__number_8c.html#af2869d36c22a2b8f93d3166a84e124b3":[15,0,10,3,2], -"d6/d42/structdynamic__array.html":[14,0,11], -"d6/d42/structdynamic__array.html#a79c587474e35f99510ca3018bf700007":[14,0,11,2], -"d6/d42/structdynamic__array.html#a7e3fbd203b3b86401c17dede7a33f781":[14,0,11,1], -"d6/d42/structdynamic__array.html#a9ddb0f64ade5d5e74b7fd091158958e4":[14,0,11,0], -"d6/d48/isogram_8h_source.html":[15,0,4,2,0], -"d6/d64/problem__7_2sol2_8c.html":[15,0,12,20,1], -"d6/d64/problem__7_2sol2_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,12,20,1,0], -"d6/d76/k__means__clustering_8c.html":[15,0,9,1], -"d6/d76/k__means__clustering_8c.html#a0283886819c7c140a023582b7269e2d0":[15,0,9,1,9], -"d6/d76/k__means__clustering_8c.html#a525335710b53cb064ca56b936120431e":[15,0,9,1,0], -"d6/d76/k__means__clustering_8c.html#a5b4ba704e02672e59cfa35f82e3db28a":[15,0,9,1,7], -"d6/d76/k__means__clustering_8c.html#aa8dca7b867074164d5f45b0f3851269d":[15,0,9,1,8], -"d6/d76/k__means__clustering_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,9,1,6], -"d6/d7b/jump__search_8c.html":[15,0,13,1], -"d6/d7b/jump__search_8c.html#a8195a86b6d75b9a3939505e8bb50021e":[15,0,13,1,0], -"d6/d7b/jump__search_8c.html#ae1a3968e7947464bee7714f6d43b7002":[15,0,13,1,3], -"d6/d7b/jump__search_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,13,1,2], -"d6/d7b/jump__search_8c.html#aff36d719e6fca6aea4377a089580c603":[15,0,13,1,1], -"d6/d88/problem__16_2sol1_8c.html":[15,0,12,6,0], -"d6/d88/problem__16_2sol1_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,12,6,0,0], +"d6/d1b/sol4_8c.html":[15,0,14,0,3], +"d6/d1b/sol4_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,14,0,3,0], +"d6/d2b/tcp__half__duplex__server_8c.html":[15,0,1,5], +"d6/d2b/tcp__half__duplex__server_8c.html#a614217d263be1fb1a5f76e2ff7be19a2":[15,0,1,5,0], +"d6/d2b/tcp__half__duplex__server_8c.html#a7e15c8e2885871839fc2b820dfbdb4ce":[15,0,1,5,1], +"d6/d2b/tcp__half__duplex__server_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,1,5,2], +"d6/d2e/cartesian__to__polar_8c.html":[15,0,12,1], +"d6/d2e/cartesian__to__polar_8c.html#a525335710b53cb064ca56b936120431e":[15,0,12,1,0], +"d6/d2e/cartesian__to__polar_8c.html#a60e62b809ca9dcb1b20a140b30d30f60":[15,0,12,1,1], +"d6/d2e/cartesian__to__polar_8c.html#ae1a3968e7947464bee7714f6d43b7002":[15,0,12,1,3], +"d6/d2e/cartesian__to__polar_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,12,1,2], +"d6/d2e/cartesian__to__polar_8c.html#afb80d77f0c994240309ccddcc9525e70":[15,0,12,1,4], +"d6/d3d/factorial__large__number_8c.html":[15,0,12,3], +"d6/d3d/factorial__large__number_8c.html#a0ddf1224851353fc92bfbff6f499fa97":[15,0,12,3,4], +"d6/d3d/factorial__large__number_8c.html#ab54882961780c41a4929a6d390f6522d":[15,0,12,3,1], +"d6/d3d/factorial__large__number_8c.html#ab5c854e0df76165c31899e69eceeeaae":[15,0,12,3,3], +"d6/d3d/factorial__large__number_8c.html#ace5f6aa21955d4e4bdc89228c2f91234":[15,0,12,3,6], +"d6/d3d/factorial__large__number_8c.html#ad398ddbd594ca69a5e6dfc894925341e":[15,0,12,3,5], +"d6/d3d/factorial__large__number_8c.html#af2869d36c22a2b8f93d3166a84e124b3":[15,0,12,3,2], +"d6/d42/structdynamic__array.html":[14,0,12], +"d6/d48/isogram_8h_source.html":[15,0,5,2,0], +"d6/d64/problem__7_2sol2_8c.html":[15,0,14,20,1], +"d6/d64/problem__7_2sol2_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,14,20,1,0], +"d6/d76/k__means__clustering_8c.html":[15,0,11,1], +"d6/d76/k__means__clustering_8c.html#a0283886819c7c140a023582b7269e2d0":[15,0,11,1,6], +"d6/d76/k__means__clustering_8c.html#a5b4ba704e02672e59cfa35f82e3db28a":[15,0,11,1,4], +"d6/d76/k__means__clustering_8c.html#aa8dca7b867074164d5f45b0f3851269d":[15,0,11,1,5], +"d6/d76/k__means__clustering_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,11,1,3], +"d6/d7b/jump__search_8c.html":[15,0,15,3], +"d6/d7b/jump__search_8c.html#a8195a86b6d75b9a3939505e8bb50021e":[15,0,15,3,0], +"d6/d7b/jump__search_8c.html#ae1a3968e7947464bee7714f6d43b7002":[15,0,15,3,3], +"d6/d7b/jump__search_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,15,3,2], +"d6/d7b/jump__search_8c.html#aff36d719e6fca6aea4377a089580c603":[15,0,15,3,1], +"d6/d88/problem__16_2sol1_8c.html":[15,0,14,6,0], +"d6/d88/problem__16_2sol1_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,14,6,0,0], "d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html":[3], "d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html#autotoc_md13":[3,0], "d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html#autotoc_md14":[3,1], @@ -205,49 +140,114 @@ var NAVTREEINDEX1 = "d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html#autotoc_md27":[3,1,3,1], "d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html#autotoc_md28":[3,1,3,2], "d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html#autotoc_md29":[3,1,3,3], -"d6/ded/shell__sort2_8c.html":[15,0,14,9], -"d6/ded/shell__sort2_8c.html#a0ddf1224851353fc92bfbff6f499fa97":[15,0,14,9,0], -"d6/df3/graph_8h_source.html":[15,0,2,4,0], -"d7/d0c/hash__sdbm_8c.html":[15,0,8,3], -"d7/d0c/hash__sdbm_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,8,3,0], -"d7/d1f/problem__12_2sol1_8c.html":[15,0,12,2,0], -"d7/d1f/problem__12_2sol1_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,12,2,0,1], -"d7/d1f/problem__12_2sol1_8c.html#aa6ce6271f6156e219f9b290717f5a222":[15,0,12,2,0,0], +"d6/ded/shell__sort2_8c.html":[15,0,16,11], +"d6/ded/shell__sort2_8c.html#a0ddf1224851353fc92bfbff6f499fa97":[15,0,16,11,0], +"d6/df3/graph_8h_source.html":[15,0,3,4,0], +"d7/d0c/hash__sdbm_8c.html":[15,0,10,3], +"d7/d0c/hash__sdbm_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,10,3,0], +"d7/d1f/problem__12_2sol1_8c.html":[15,0,14,2,0], +"d7/d1f/problem__12_2sol1_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,14,2,0,1], +"d7/d1f/problem__12_2sol1_8c.html#aa6ce6271f6156e219f9b290717f5a222":[15,0,14,2,0,0], "d7/d3b/group__hash.html":[13,1], -"d7/d3b/group__hash.html#ga1ac362fa25f7c35d104205985f8e754b":[15,0,8,2,0], "d7/d3b/group__hash.html#ga1ac362fa25f7c35d104205985f8e754b":[13,1,7], "d7/d3b/group__hash.html#ga39d4c16427acbf8bbe744f6d8ed61dc0":[13,1,13], -"d7/d3b/group__hash.html#ga39d4c16427acbf8bbe744f6d8ed61dc0":[15,0,8,4,1], -"d7/d3b/group__hash.html#ga483e7ee6db1dc09a0f3e683e028ec567":[15,0,8,1,0], "d7/d3b/group__hash.html#ga483e7ee6db1dc09a0f3e683e028ec567":[13,1,6], -"d7/d3b/group__hash.html#ga506f0227a3b5f9434a503e09a3cb672b":[15,0,8,0,0], "d7/d3b/group__hash.html#ga506f0227a3b5f9434a503e09a3cb672b":[13,1,5], -"d7/d3b/group__hash.html#ga8ab8eeb35f8ccfcad89091b5fdd4f605":[15,0,8,3,1], "d7/d3b/group__hash.html#ga8ab8eeb35f8ccfcad89091b5fdd4f605":[13,1,8], -"d7/d3b/group__hash.html#ga994ea8b243b6c0fbef734551ec5765dd":[15,0,8,0,2], "d7/d3b/group__hash.html#ga994ea8b243b6c0fbef734551ec5765dd":[13,1,9], "d7/d3b/group__hash.html#ga9f76001544014905468dc812336110d5":[13,1,11], -"d7/d3b/group__hash.html#ga9f76001544014905468dc812336110d5":[15,0,8,2,2], "d7/d3b/group__hash.html#gab87679863646255178427a56dc33e453":[13,1,12], -"d7/d3b/group__hash.html#gab87679863646255178427a56dc33e453":[15,0,8,3,2], -"d7/d3b/group__hash.html#gad451622bbdca271edfa8e0d98ca422f2":[15,0,8,1,2], "d7/d3b/group__hash.html#gad451622bbdca271edfa8e0d98ca422f2":[13,1,10], "d7/d3b/group__hash.html#gae4836b42b998b336298f3b19dcc9cdeb":[13,1,14], -"d7/d3b/group__hash.html#gae4836b42b998b336298f3b19dcc9cdeb":[15,0,8,4,2], -"d7/d50/qr__eigen__values_8c.html":[15,0,11,8], -"d7/d50/qr__eigen__values_8c.html#a002b2f4894492820fe708b1b7e7c5e70":[15,0,11,8,0], -"d7/d50/qr__eigen__values_8c.html#a0283886819c7c140a023582b7269e2d0":[15,0,11,8,7], -"d7/d50/qr__eigen__values_8c.html#a0d8ed79786d17df48396b333c09d05bb":[15,0,11,8,3], -"d7/d50/qr__eigen__values_8c.html#a1440a7779ac56f47a3f355ce4a8c7da0":[15,0,11,8,6], -"d7/d50/qr__eigen__values_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,11,8,4], -"d7/d50/qr__eigen__values_8c.html#a741477692f001a805b0fea942c9dc2b9":[15,0,11,8,5], -"d7/d50/qr__eigen__values_8c.html#a7d96c5e4ae1bd6d29791bcc23a4cb2b0":[15,0,11,8,2], -"d7/d50/qr__eigen__values_8c.html#aee57a411f07599034f5ceb8cc7d65b40":[15,0,11,8,1], -"d7/d90/rna__transcription_8h_source.html":[15,0,4,3,0], -"d7/d91/problem__15_2sol1_8c.html":[15,0,12,5,0], -"d7/d91/problem__15_2sol1_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,12,5,0,0], -"d7/d91/problem__15_2sol1_8c.html#a4650d1d3897633d84253f93433f601d6":[15,0,12,5,0,1], -"d7/d98/spirograph_8c.html":[15,0,7,0], -"d7/d98/spirograph_8c.html#a0daa148091ec953809fc172289f773d3":[15,0,7,0,2], -"d7/d98/spirograph_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,7,0,1] +"d7/d50/qr__eigen__values_8c.html":[15,0,13,8], +"d7/d50/qr__eigen__values_8c.html#a002b2f4894492820fe708b1b7e7c5e70":[15,0,13,8,0], +"d7/d50/qr__eigen__values_8c.html#a0283886819c7c140a023582b7269e2d0":[15,0,13,8,7], +"d7/d50/qr__eigen__values_8c.html#a0d8ed79786d17df48396b333c09d05bb":[15,0,13,8,3], +"d7/d50/qr__eigen__values_8c.html#a1440a7779ac56f47a3f355ce4a8c7da0":[15,0,13,8,6], +"d7/d50/qr__eigen__values_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,13,8,4], +"d7/d50/qr__eigen__values_8c.html#a5835240036dc02ee9a13e65c559fb907":[15,0,13,8,5], +"d7/d50/qr__eigen__values_8c.html#a7d96c5e4ae1bd6d29791bcc23a4cb2b0":[15,0,13,8,2], +"d7/d50/qr__eigen__values_8c.html#aee57a411f07599034f5ceb8cc7d65b40":[15,0,13,8,1], +"d7/d90/rna__transcription_8h_source.html":[15,0,5,3,0], +"d7/d91/problem__15_2sol1_8c.html":[15,0,14,5,0], +"d7/d91/problem__15_2sol1_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,14,5,0,0], +"d7/d91/problem__15_2sol1_8c.html#a4650d1d3897633d84253f93433f601d6":[15,0,14,5,0,1], +"d7/d98/spirograph_8c.html":[15,0,8,0], +"d7/d98/spirograph_8c.html#a0daa148091ec953809fc172289f773d3":[15,0,8,0,2], +"d7/d98/spirograph_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,8,0,1], +"d7/d98/spirograph_8c.html#a525335710b53cb064ca56b936120431e":[15,0,8,0,0], +"d7/d98/spirograph_8c.html#a708a4c1a4d0c4acc4c447310dd4db27f":[15,0,8,0,3], +"d7/db5/md_exercism__r_e_a_d_m_e.html":[8], +"d7/dd3/problem__3_2sol1_8c.html":[15,0,14,15,0], +"d7/dd3/problem__3_2sol1_8c.html#aa0f4796aa2e89c327f827bd55f5cb305":[15,0,14,15,0,0], +"d7/dd3/problem__3_2sol1_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,14,15,0,1], +"d7/dd8/c__atoi__str__to__integer_8c.html":[15,0,2,0], +"d7/dd8/c__atoi__str__to__integer_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,2,0,1], +"d7/dd8/c__atoi__str__to__integer_8c.html#a8c66c03637e48e375b80b5d7791e57be":[15,0,2,0,2], +"d7/dd8/c__atoi__str__to__integer_8c.html#ad19049ebfc2088bc1e75e7e958f7b60f":[15,0,2,0,0], +"d7/ddb/problem__23_2sol1_8c.html":[15,0,14,12,0], +"d7/ddb/problem__23_2sol1_8c.html#a1aca7f530f82b27100262adba9e7556b":[15,0,14,12,0,1], +"d7/ddb/problem__23_2sol1_8c.html#a3ab61b5a1c4f2288625d160aa0ea8478":[15,0,14,12,0,3], +"d7/ddb/problem__23_2sol1_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,14,12,0,4], +"d7/ddb/problem__23_2sol1_8c.html#a4f128410e6582fe26488e2316cc96e17":[15,0,14,12,0,2], +"d7/ddb/problem__23_2sol1_8c.html#ac5d600bf3077f4188afc4c5cd2c40eaf":[15,0,14,12,0,0], +"d7/de0/stack_8h_source.html":[15,0,3,9,1], +"d7/dfd/structdual__quat__.html":[13,0,3,0], +"d7/dfd/structdual__quat__.html#a1b05fbc4135e4f9b731423f26527543d":[13,0,3,0,0], +"d7/dfd/structdual__quat__.html#ad663036ace6a586f90a2f89386f7731a":[13,0,3,0,1], +"d8/d10/structlist.html":[14,0,21], +"d8/d10/structlist.html#a2054c799f7580787a500df82d14ace25":[14,0,21,0], +"d8/d10/structlist.html#a5363bdc0495ab9ef0ed587c99b9a2b41":[14,0,21,1], +"d8/d30/decimal__to__binary__recursion_8c.html":[15,0,2,2], +"d8/d30/decimal__to__binary__recursion_8c.html#aa8dca7b867074164d5f45b0f3851269d":[15,0,2,2,2], +"d8/d30/decimal__to__binary__recursion_8c.html#acbbe6358ec95b3201865a72b2ac522c8":[15,0,2,2,0], +"d8/d30/decimal__to__binary__recursion_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,2,2,1], +"d8/d32/problem__25_2sol1_8c.html":[15,0,14,13,0], +"d8/d32/problem__25_2sol1_8c.html#a001791a21d538b8b9176287ae60d9b61":[15,0,14,13,0,0], +"d8/d32/problem__25_2sol1_8c.html#a0ddf1224851353fc92bfbff6f499fa97":[15,0,14,13,0,3], +"d8/d32/problem__25_2sol1_8c.html#a2b90df6bfbf0d18cd9a19c1a71453783":[15,0,14,13,0,2], +"d8/d32/problem__25_2sol1_8c.html#abe5bc1f170b2108a19d0a16d30bd3235":[15,0,14,13,0,4], +"d8/d32/problem__25_2sol1_8c.html#af9729befaffc1aab9ac9fedc4706e66c":[15,0,14,13,0,1], +"d8/d38/queue_8h_source.html":[15,0,3,4,1], +"d8/d71/group__k__means.html":[13,2,1], +"d8/d71/group__k__means.html#gad339c41d3ee9e6729aca9e9ab3f7d2d9":[13,2,1,3], +"d8/d71/group__k__means.html#gadee39a3f17bf5144df5592e48dbfc9f7":[13,2,1,2], +"d8/d71/group__k__means.html#gaf6259432561e794dea0e060f482d15e2":[13,2,1,4], +"d8/d7a/structtnode.html":[14,0,39], +"d8/d7c/dict_8h_source.html":[15,0,3,2,0], +"d8/d81/md_project_euler__r_e_a_d_m_e.html":[11], +"d8/da2/dynamic__array_8h_source.html":[15,0,3,3,0], +"d8/db8/structkohonen__array__3d.html":[13,2,2,0], +"d8/db8/structkohonen__array__3d.html#a160f14830bdfbbf9f422f382ee754dbf":[13,2,2,0,3], +"d8/db8/structkohonen__array__3d.html#a16720581653fa9a34d1029e7229a7377":[13,2,2,0,1], +"d8/db8/structkohonen__array__3d.html#a888d7e007b38c91c7933e12a9566af1d":[13,2,2,0,2], +"d8/db8/structkohonen__array__3d.html#ad546baa2e81c6196d5f1dc0fe2e5bd59":[13,2,2,0,0], +"d8/dca/udp__server_8c.html":[15,0,1,7], +"d8/dca/udp__server_8c.html#a3e937c42922f7601edb17b747602c471":[15,0,1,7,0], +"d8/dca/udp__server_8c.html#a614217d263be1fb1a5f76e2ff7be19a2":[15,0,1,7,1], +"d8/dca/udp__server_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,1,7,2], +"d8/de0/problem__9_2sol2_8c.html":[15,0,14,22,1], +"d8/de0/problem__9_2sol2_8c.html#a840291bc02cba5474a4cb46a9b9566fe":[15,0,14,22,1,0], +"d9/d41/md_data_structures_array__r_e_a_d_m_e.html":[4], +"d9/d41/md_data_structures_array__r_e_a_d_m_e.html#autotoc_md31":[4,0], +"d9/d41/md_data_structures_array__r_e_a_d_m_e.html#autotoc_md32":[4,1], +"d9/d41/md_data_structures_array__r_e_a_d_m_e.html#autotoc_md33":[4,2], +"d9/d66/group__machine__learning.html":[13,2], +"d9/d8b/structmat__3x3__.html":[13,0,1,0], +"d9/d8b/structmat__3x3__.html#a490bb6be52ea95b333b55b236af41563":[13,0,1,0,2], +"d9/d8b/structmat__3x3__.html#a8d7ae8fbcc408e3c30e9d64bbd28feaf":[13,0,1,0,1], +"d9/d8b/structmat__3x3__.html#ac74f33a2e1ad1f6db74d94807cf1f64e":[13,0,1,0,0], +"d9/da7/problem__10_2sol2_8c.html":[15,0,14,1,1], +"d9/da7/problem__10_2sol2_8c.html#a0ddf1224851353fc92bfbff6f499fa97":[15,0,14,1,1,0], +"d9/dc9/hash__crc32_8c.html":[15,0,10,1], +"d9/dc9/hash__crc32_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,10,1,1], +"d9/dcc/prim_8c.html":[15,0,9,0], +"d9/dcc/prim_8c.html#a0bea087eb586c437cf0a667f794c8853":[15,0,9,0,3], +"d9/dcc/prim_8c.html#a392fb874e547e582e9c66a08a1f23326":[15,0,9,0,0], +"d9/dcc/prim_8c.html#a72ec66b10f86d67064d34f2b2717fdfc":[15,0,9,0,2], +"d9/dcc/prim_8c.html#abf9e6b7e6f15df4b525a2e7705ba3089":[15,0,9,0,1], +"d9/dcc/prim_8c.html#addac7a8c7bfd3e5573dad1f6aeff7768":[15,0,9,0,5], +"d9/dcc/prim_8c.html#aff3f4c22009b2aa4e385a76a8a1cdc1c":[15,0,9,0,4], +"d9/dd7/struct__cantor__set.html":[14,0,1], +"d9/dd7/struct__cantor__set.html#a2f7f9f19125725d3e5673fdb4ac8cfb1":[14,0,1,1] }; diff --git a/navtreeindex2.js b/navtreeindex2.js index e35feb4fd..872d1c4e0 100644 --- a/navtreeindex2.js +++ b/navtreeindex2.js @@ -1,234 +1,178 @@ var NAVTREEINDEX2 = { -"d7/d98/spirograph_8c.html#a525335710b53cb064ca56b936120431e":[15,0,7,0,0], -"d7/d98/spirograph_8c.html#a708a4c1a4d0c4acc4c447310dd4db27f":[15,0,7,0,3], -"d7/db5/md_exercism__r_e_a_d_m_e.html":[8], -"d7/db5/md_exercism__r_e_a_d_m_e.html#autotoc_md58":[3], -"d7/dd3/problem__3_2sol1_8c.html":[15,0,12,15,0], -"d7/dd3/problem__3_2sol1_8c.html#aa0f4796aa2e89c327f827bd55f5cb305":[15,0,12,15,0,0], -"d7/dd3/problem__3_2sol1_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,12,15,0,1], -"d7/dd8/c__atoi__str__to__integer_8c.html":[15,0,1,0], -"d7/dd8/c__atoi__str__to__integer_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,1,0,1], -"d7/dd8/c__atoi__str__to__integer_8c.html#a8c66c03637e48e375b80b5d7791e57be":[15,0,1,0,2], -"d7/dd8/c__atoi__str__to__integer_8c.html#ad19049ebfc2088bc1e75e7e958f7b60f":[15,0,1,0,0], -"d7/ddb/problem__23_2sol1_8c.html":[15,0,12,12,0], -"d7/ddb/problem__23_2sol1_8c.html#a1aca7f530f82b27100262adba9e7556b":[15,0,12,12,0,1], -"d7/ddb/problem__23_2sol1_8c.html#a3ab61b5a1c4f2288625d160aa0ea8478":[15,0,12,12,0,3], -"d7/ddb/problem__23_2sol1_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,12,12,0,4], -"d7/ddb/problem__23_2sol1_8c.html#a4f128410e6582fe26488e2316cc96e17":[15,0,12,12,0,2], -"d7/ddb/problem__23_2sol1_8c.html#ac5d600bf3077f4188afc4c5cd2c40eaf":[15,0,12,12,0,0], -"d7/de0/stack_8h_source.html":[15,0,2,8,1], -"d7/dfd/structdual__quat__.html":[13,0,8,0], -"d7/dfd/structdual__quat__.html#a1b05fbc4135e4f9b731423f26527543d":[13,0,8,0,0], -"d7/dfd/structdual__quat__.html#ad663036ace6a586f90a2f89386f7731a":[13,0,8,0,1], -"d8/d10/structlist.html":[14,0,20], -"d8/d10/structlist.html#a1900fe79e875e2838625b2eb60837f8f":[14,0,20,0], -"d8/d10/structlist.html#a2054c799f7580787a500df82d14ace25":[14,0,20,1], -"d8/d10/structlist.html#a5363bdc0495ab9ef0ed587c99b9a2b41":[14,0,20,2], -"d8/d30/decimal__to__binary__recursion_8c.html":[15,0,1,1], -"d8/d30/decimal__to__binary__recursion_8c.html#acbbe6358ec95b3201865a72b2ac522c8":[15,0,1,1,0], -"d8/d30/decimal__to__binary__recursion_8c.html#ae1a3968e7947464bee7714f6d43b7002":[15,0,1,1,2], -"d8/d30/decimal__to__binary__recursion_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,1,1,1], -"d8/d32/problem__25_2sol1_8c.html":[15,0,12,13,0], -"d8/d32/problem__25_2sol1_8c.html#a001791a21d538b8b9176287ae60d9b61":[15,0,12,13,0,0], -"d8/d32/problem__25_2sol1_8c.html#a0ddf1224851353fc92bfbff6f499fa97":[15,0,12,13,0,3], -"d8/d32/problem__25_2sol1_8c.html#a2b90df6bfbf0d18cd9a19c1a71453783":[15,0,12,13,0,2], -"d8/d32/problem__25_2sol1_8c.html#abe5bc1f170b2108a19d0a16d30bd3235":[15,0,12,13,0,4], -"d8/d32/problem__25_2sol1_8c.html#af9729befaffc1aab9ac9fedc4706e66c":[15,0,12,13,0,1], -"d8/d38/queue_8h_source.html":[15,0,2,4,1], -"d8/d71/group__k__means.html":[13,2,1], -"d8/d71/group__k__means.html#ga8cc0f5e9645e6faf40d1746acf777944":[15,0,9,1,2], -"d8/d71/group__k__means.html#gabe256d797c00b793041eac33f07804c1":[15,0,9,1,1], -"d8/d71/group__k__means.html#gad229b1dc406cb5ea510f26a373ed8bfd":[15,0,9,1,5], -"d8/d71/group__k__means.html#gad229b1dc406cb5ea510f26a373ed8bfd":[13,2,1,4], -"d8/d71/group__k__means.html#gad339c41d3ee9e6729aca9e9ab3f7d2d9":[15,0,9,1,4], -"d8/d71/group__k__means.html#gad339c41d3ee9e6729aca9e9ab3f7d2d9":[13,2,1,3], -"d8/d71/group__k__means.html#gadee39a3f17bf5144df5592e48dbfc9f7":[15,0,9,1,3], -"d8/d71/group__k__means.html#gadee39a3f17bf5144df5592e48dbfc9f7":[13,2,1,2], -"d8/d7a/structtnode.html":[14,0,38], -"d8/d7a/structtnode.html#a44127c1d017332403d91a96a1633a76a":[14,0,38,3], -"d8/d7a/structtnode.html#ad302cb43ee1cab8a29581e8aaf76bbd4":[14,0,38,0], -"d8/d7a/structtnode.html#ae1f202bf98d22f8316eeb71b68a59951":[14,0,38,1], -"d8/d7a/structtnode.html#af7ce6341b8536c58a5a9ebdb4862a32a":[14,0,38,2], -"d8/d7c/dict_8h_source.html":[15,0,2,2,0], -"d8/d81/md_project_euler__r_e_a_d_m_e.html":[11], -"d8/da2/dynamic__array_8h_source.html":[15,0,2,3,0], -"d8/db8/structkohonen__array__3d.html":[13,2,2,0], -"d8/db8/structkohonen__array__3d.html#a160f14830bdfbbf9f422f382ee754dbf":[13,2,2,0,3], -"d8/db8/structkohonen__array__3d.html#a16720581653fa9a34d1029e7229a7377":[13,2,2,0,1], -"d8/db8/structkohonen__array__3d.html#a888d7e007b38c91c7933e12a9566af1d":[13,2,2,0,2], -"d8/db8/structkohonen__array__3d.html#ad546baa2e81c6196d5f1dc0fe2e5bd59":[13,2,2,0,0], -"d8/dca/udp__server_8c.html":[15,0,0,3], -"d8/dca/udp__server_8c.html#a3e937c42922f7601edb17b747602c471":[15,0,0,3,0], -"d8/dca/udp__server_8c.html#a614217d263be1fb1a5f76e2ff7be19a2":[15,0,0,3,1], -"d8/dca/udp__server_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,0,3,2], -"d8/de0/problem__9_2sol2_8c.html":[15,0,12,22,1], -"d8/de0/problem__9_2sol2_8c.html#a840291bc02cba5474a4cb46a9b9566fe":[15,0,12,22,1,0], -"d9/d41/md_data_structures_array__r_e_a_d_m_e.html":[4], -"d9/d41/md_data_structures_array__r_e_a_d_m_e.html#autotoc_md31":[4,0], -"d9/d41/md_data_structures_array__r_e_a_d_m_e.html#autotoc_md32":[4,1], -"d9/d41/md_data_structures_array__r_e_a_d_m_e.html#autotoc_md33":[4,2], -"d9/d66/group__machine__learning.html":[13,2], -"d9/d8b/structmat__3x3__.html":[13,0,6,0], -"d9/d8b/structmat__3x3__.html#a083420b13a87ebece08b6c7d49081e8a":[13,0,6,0,3], -"d9/d8b/structmat__3x3__.html#a490bb6be52ea95b333b55b236af41563":[13,0,6,0,2], -"d9/d8b/structmat__3x3__.html#a79b11a5d4e23d7965cbb151fdc5bda32":[13,0,6,0,4], -"d9/d8b/structmat__3x3__.html#a8d7ae8fbcc408e3c30e9d64bbd28feaf":[13,0,6,0,1], -"d9/d8b/structmat__3x3__.html#ac74f33a2e1ad1f6db74d94807cf1f64e":[13,0,6,0,0], -"d9/d8b/structmat__3x3__.html#ad2f6310ba8af97d333888128ca7a6f7d":[13,0,6,0,5], -"d9/da7/problem__10_2sol2_8c.html":[15,0,12,1,1], -"d9/da7/problem__10_2sol2_8c.html#a0ddf1224851353fc92bfbff6f499fa97":[15,0,12,1,1,0], -"d9/dc9/hash__crc32_8c.html":[15,0,8,1], -"d9/dc9/hash__crc32_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,8,1,1], -"d9/dd7/struct__cantor__set.html":[14,0,1], -"d9/dd7/struct__cantor__set.html#a2f7f9f19125725d3e5673fdb4ac8cfb1":[14,0,1,1], "d9/dd7/struct__cantor__set.html#abd2176c3cc3a1d85d15bbeaace35fa03":[14,0,1,2], "d9/dd7/struct__cantor__set.html#acfc25ab716a3c79be8a5a4cab94e8def":[14,0,1,0], -"da/d02/binary__search__tree_8c.html":[15,0,2,1,0], -"da/d02/binary__search__tree_8c.html#a01151353aa2d9688934ed39208133241":[15,0,2,1,0,10], -"da/d02/binary__search__tree_8c.html#a0f18adaaca5ecc410cfa16dd2a3684dc":[15,0,2,1,0,6], -"da/d02/binary__search__tree_8c.html#a73152b9ccb4aa5cd4c1bacd4188bb2de":[15,0,2,1,0,7], -"da/d02/binary__search__tree_8c.html#a748f3966920e2fd197906be1e151b127":[15,0,2,1,0,2], -"da/d02/binary__search__tree_8c.html#ac73c73be92dbbeeaad942c0103b9540d":[15,0,2,1,0,9], -"da/d02/binary__search__tree_8c.html#ad297e528a7bb8604ca93af149d609150":[15,0,2,1,0,4], -"da/d02/binary__search__tree_8c.html#adff4c6248834a9944a1fb03a20230c9c":[15,0,2,1,0,3], -"da/d02/binary__search__tree_8c.html#ae4a66d8b0c2b0d626aea45977e358c83":[15,0,2,1,0,5], -"da/d02/binary__search__tree_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,2,1,0,8], -"da/d02/binary__search__tree_8c.html#af4aeda155dbe167f1c1cf38cb65bf324":[15,0,2,1,0,1], -"da/d23/list_8h_source.html":[15,0,2,7,0], +"d9/deb/min__printf_8h.html":[15,0,4,2], +"d9/deb/min__printf_8h.html#a0a848efdf2ee124bba62e056eb9ab824":[15,0,4,2,10], +"d9/deb/min__printf_8h.html#a33e08c05f8c656a0fee465c2e8d2ecf9":[15,0,4,2,7], +"d9/deb/min__printf_8h.html#a409d428c337bf5476567a228274f49f1":[15,0,4,2,3], +"d9/deb/min__printf_8h.html#a4d63203d920bebd6a96f5f4aeccb21e5":[15,0,4,2,9], +"d9/deb/min__printf_8h.html#a8421f89b76edcf21292c5100bfca586b":[15,0,4,2,8], +"d9/deb/min__printf_8h.html#a8d68ec60643cacdb402176549565754e":[15,0,4,2,13], +"d9/deb/min__printf_8h.html#aa61e2407aab2c75e9837c77cab937d03":[15,0,4,2,5], +"d9/deb/min__printf_8h.html#aa8a17b7d234a2fb2174da02074a14055":[15,0,4,2,14], +"d9/deb/min__printf_8h.html#ab47a4bec9213d96e1dba5171e5db0e25":[15,0,4,2,1], +"d9/deb/min__printf_8h.html#abf0876f583782407c9e15c60158eec52":[15,0,4,2,2], +"d9/deb/min__printf_8h.html#ad2f9a02e1d69f58e2fb1248f49d09f4b":[15,0,4,2,12], +"d9/deb/min__printf_8h.html#ad4908ab912d8dc481225e33ca3285c21":[15,0,4,2,6], +"d9/deb/min__printf_8h.html#aefb40d94d5d9fa2a28bc64755dde096f":[15,0,4,2,4], +"d9/deb/min__printf_8h.html#af569209570eca8bc6770fb7d9dc873e6":[15,0,4,2,11], +"d9/deb/min__printf_8h_source.html":[15,0,4,2], +"da/d02/binary__search__tree_8c.html":[15,0,3,1,0], +"da/d02/binary__search__tree_8c.html#a01151353aa2d9688934ed39208133241":[15,0,3,1,0,10], +"da/d02/binary__search__tree_8c.html#a031cc98830742bca57c0da81a0fb779f":[15,0,3,1,0,7], +"da/d02/binary__search__tree_8c.html#a0f18adaaca5ecc410cfa16dd2a3684dc":[15,0,3,1,0,6], +"da/d02/binary__search__tree_8c.html#a6983e8a91a3d25d7d000807f18ba2748":[15,0,3,1,0,2], +"da/d02/binary__search__tree_8c.html#ad50f3debc5323bb7b71933effb64f30f":[15,0,3,1,0,4], +"da/d02/binary__search__tree_8c.html#adf2169c1008551b20c4a59fcf0c9ab3b":[15,0,3,1,0,9], +"da/d02/binary__search__tree_8c.html#adff4c6248834a9944a1fb03a20230c9c":[15,0,3,1,0,3], +"da/d02/binary__search__tree_8c.html#ae4a66d8b0c2b0d626aea45977e358c83":[15,0,3,1,0,5], +"da/d02/binary__search__tree_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,3,1,0,8], +"da/d02/binary__search__tree_8c.html#af4aeda155dbe167f1c1cf38cb65bf324":[15,0,3,1,0,1], +"da/d07/tcp__half__duplex__client_8c.html":[15,0,1,4], +"da/d07/tcp__half__duplex__client_8c.html#a614217d263be1fb1a5f76e2ff7be19a2":[15,0,1,4,0], +"da/d07/tcp__half__duplex__client_8c.html#a7e15c8e2885871839fc2b820dfbdb4ce":[15,0,1,4,1], +"da/d07/tcp__half__duplex__client_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,1,4,2], +"da/d23/list_8h_source.html":[15,0,3,7,0], "da/d2a/group__adaline.html":[13,2,0], -"da/d2a/group__adaline.html#ga20d3642e0a87f36fdb7bf91b023cd166":[15,0,9,0,4], "da/d2a/group__adaline.html#ga20d3642e0a87f36fdb7bf91b023cd166":[13,2,0,5], -"da/d2a/group__adaline.html#ga251695a79baa885cafdcf6d8ed4ac120":[13,2,0,6], -"da/d2a/group__adaline.html#ga251695a79baa885cafdcf6d8ed4ac120":[15,0,9,0,5], -"da/d2a/group__adaline.html#ga43576566b020c4157d4fb28f0dd45cfa":[15,0,9,0,2], "da/d2a/group__adaline.html#ga43576566b020c4157d4fb28f0dd45cfa":[13,2,0,3], "da/d2a/group__adaline.html#ga555ba960994e9bccb2029764588f694f":[13,2,0,2], -"da/d2a/group__adaline.html#ga555ba960994e9bccb2029764588f694f":[15,0,9,0,1], -"da/d2a/group__adaline.html#ga6f35caa3084772cc126ac7b20f67f665":[15,0,9,0,7], "da/d2a/group__adaline.html#ga6f35caa3084772cc126ac7b20f67f665":[13,2,0,8], "da/d2a/group__adaline.html#gaa52120912e32d2893fe1c6d78da5befd":[13,2,0,4], -"da/d2a/group__adaline.html#gaa52120912e32d2893fe1c6d78da5befd":[15,0,9,0,3], "da/d2a/group__adaline.html#gab4d49d73dec94c092b7ffadba55fb020":[13,2,0,1], -"da/d2a/group__adaline.html#gab4d49d73dec94c092b7ffadba55fb020":[15,0,9,0,0], "da/d2a/group__adaline.html#gac70b578aee679005fd336073969c3d94":[13,2,0,7], -"da/d2a/group__adaline.html#gac70b578aee679005fd336073969c3d94":[15,0,9,0,6], -"da/d2a/group__adaline.html#gacd88962c5f6341e43cbc69b4a7d3485b":[15,0,9,0,9], "da/d2a/group__adaline.html#gacd88962c5f6341e43cbc69b4a7d3485b":[13,2,0,9], -"da/d35/problem__1_2sol1_8c.html":[15,0,12,0,0], -"da/d35/problem__1_2sol1_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,12,0,0,0], -"da/d38/durand__kerner__roots_8c.html":[15,0,11,0], -"da/d38/durand__kerner__roots_8c.html#a26d5695ebed0818a3e7cf4b10aacab52":[15,0,11,0,1], -"da/d38/durand__kerner__roots_8c.html#a321f9781a9744ccdaf0aba89f35ec29c":[15,0,11,0,4], -"da/d38/durand__kerner__roots_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,11,0,3], -"da/d38/durand__kerner__roots_8c.html#af270a96662132d0385cb6b4637c5a689":[15,0,11,0,0], -"da/d38/durand__kerner__roots_8c.html#afa5b04ce11475d67049cba8273741fb7":[15,0,11,0,2], -"da/d56/problem__1_2sol3_8c.html":[15,0,12,0,2], -"da/d56/problem__1_2sol3_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,12,0,2,0], -"da/d90/stack__linked__list_2stack_8h_source.html":[15,0,2,8,0,0], -"da/d93/prime_8c.html":[15,0,10,7], -"da/d93/prime_8c.html#a6384596f117decd77da25af95ab1704f":[15,0,10,7,0], -"da/d93/prime_8c.html#ae1a3968e7947464bee7714f6d43b7002":[15,0,10,7,2], -"da/d93/prime_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,10,7,1], -"da/d9b/struct_trie_node.html":[14,0,39], -"da/d9b/struct_trie_node.html#a8e9e3ac8a47ed2f730476945933722c1":[14,0,39,0], -"da/d9b/struct_trie_node.html#a9dc2a9bc247486fac3e4b350c73a3060":[14,0,39,1], -"da/d9b/struct_trie_node.html#ab2732ce1e141346865d997859836d663":[14,0,39,2], -"da/da0/segment__tree_8c.html":[15,0,2,1,1], -"da/da0/segment__tree_8c.html#a1e81a9bbf01716f1b4fb27ef36a9098c":[15,0,2,1,1,10], -"da/da0/segment__tree_8c.html#a776abfa81cde9016a2885dca7cfc05ab":[15,0,2,1,1,8], -"da/da0/segment__tree_8c.html#a93bfab032ce9dbc0c1feaeee32a885fb":[15,0,2,1,1,4], -"da/da0/segment__tree_8c.html#aa8dca7b867074164d5f45b0f3851269d":[15,0,2,1,1,11], -"da/da0/segment__tree_8c.html#aae59daf9a0dc33f8cbc7a525a616ee75":[15,0,2,1,1,5], -"da/da0/segment__tree_8c.html#ac206721972f739510cb11f7c0a6a8f63":[15,0,2,1,1,2], -"da/da0/segment__tree_8c.html#aca549b5311d32ab1a703b4a4605821d8":[15,0,2,1,1,1], -"da/da0/segment__tree_8c.html#acecc34fd89923ab41dcee3a779622816":[15,0,2,1,1,7], -"da/da0/segment__tree_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,2,1,1,3], -"da/da0/segment__tree_8c.html#af20a9f373083d3f701e1cd92560cef01":[15,0,2,1,1,6], -"da/da0/segment__tree_8c.html#af61bd96660cb53f49f28d60a5f1d0c91":[15,0,2,1,1,9], -"da/de6/udp__client_8c.html":[15,0,0,2], -"da/de6/udp__client_8c.html#a3e937c42922f7601edb17b747602c471":[15,0,0,2,0], -"da/de6/udp__client_8c.html#a614217d263be1fb1a5f76e2ff7be19a2":[15,0,0,2,1], -"da/de6/udp__client_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,0,2,2], -"db/d01/problem__13_2sol1_8c.html":[15,0,12,3,0], -"db/d01/problem__13_2sol1_8c.html#a248adc917818cc6666d8bc679a660319":[15,0,12,3,0,3], -"db/d01/problem__13_2sol1_8c.html#a840291bc02cba5474a4cb46a9b9566fe":[15,0,12,3,0,2], -"db/d01/problem__13_2sol1_8c.html#ac260f58785fb20eb09bb35385a7d47f8":[15,0,12,3,0,1], -"db/d01/problem__13_2sol1_8c.html#ad51742ca5a5c99e860bdf30299163bf2":[15,0,12,3,0,0], -"db/d0c/infix__to__postfix_8c.html":[15,0,1,3], -"db/d0c/infix__to__postfix_8c.html#a613462735d30cae1b85b606ecab30554":[15,0,1,3,7], -"db/d0c/infix__to__postfix_8c.html#a92af69ffc1e1f965ebce6a44672e96b1":[15,0,1,3,1], -"db/d0c/infix__to__postfix_8c.html#a940cdcd27c40699eebb4ef113b2d9451":[15,0,1,3,6], -"db/d0c/infix__to__postfix_8c.html#ac91f38ad7885fca93e39325361a5c787":[15,0,1,3,2], -"db/d0c/infix__to__postfix_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,1,3,5], -"db/d0c/infix__to__postfix_8c.html#afa8471c76bc57b12ad21de22beb39021":[15,0,1,3,3], -"db/d0c/infix__to__postfix_8c.html#afd8245c04b202240390de23170f72d6b":[15,0,1,3,4], -"db/d80/problem__20_2sol1_8c.html":[15,0,12,9,0], -"db/d80/problem__20_2sol1_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,12,9,0,3], -"db/d80/problem__20_2sol1_8c.html#a54a02c4b963fdb16f24959e0137763f1":[15,0,12,9,0,4], -"db/d80/problem__20_2sol1_8c.html#a62cbbd106aad52daadb9403a07d0da32":[15,0,12,9,0,1], -"db/d80/problem__20_2sol1_8c.html#afc373c28da6b17636528edcc97fb5f86":[15,0,12,9,0,2], -"db/d84/malloc__dbg_8c.html":[15,0,3,0], -"db/d84/malloc__dbg_8c.html#a10238aaeea60178d31fbb74347e941aa":[15,0,3,0,7], -"db/d84/malloc__dbg_8c.html#a2a47e4c38db8c00b80248e5535adf797":[15,0,3,0,8], -"db/d84/malloc__dbg_8c.html#a3f9195a04ac8e8a9868ee3e416db7e8c":[15,0,3,0,5], -"db/d84/malloc__dbg_8c.html#a8ac3a93239838ac88c18df64c58b9275":[15,0,3,0,4], -"db/d84/malloc__dbg_8c.html#ab6619fb17769f2e4e2e36c9ef2dda3c6":[15,0,3,0,1], -"db/d84/malloc__dbg_8c.html#acd08c54b257fb81e57f16c94690072f2":[15,0,3,0,6], -"db/d84/malloc__dbg_8c.html#ad04afbbcb9f0f10bc7628ec4f0d7c950":[15,0,3,0,9], -"db/d84/malloc__dbg_8c.html#aec6b5ee323e5338f23a1ce6fe9974f25":[15,0,3,0,3], -"db/d84/malloc__dbg_8c.html#afae235c0e32e4c8b7d67117da5f78946":[15,0,3,0,2], -"db/d84/malloc__dbg_8c.html#afebd751704cd878d2e4b88499519c6e3":[15,0,3,0,10], -"db/d8b/struct_node.html":[14,0,26], -"db/d8b/struct_node.html#a0ed3c7305b43527f0f237bbfd438b8f7":[14,0,26,3], -"db/d8b/struct_node.html#a60b73f452505cef98795d2c8de3e72ef":[14,0,26,1], -"db/d8b/struct_node.html#a772e2a82248c0d0dfc5cdf19d5b45df9":[14,0,26,2], -"db/d8b/struct_node.html#a87c003c9f600e3fc58e6e90835f0b605":[14,0,26,0], -"db/dd5/prime__seive_8c.html":[15,0,10,8], -"db/dd5/prime__seive_8c.html#ac1215a37edfa07d37edf6ec65f2235c7":[15,0,10,8,4], -"db/ddb/hello__world_8h_source.html":[15,0,4,1,0], -"db/ddf/insertion__sort_8c.html":[15,0,14,4], -"db/ddf/insertion__sort_8c.html#a0d6c227641a5e0dae580b3a18df241fb":[15,0,14,4,0], -"db/ddf/insertion__sort_8c.html#aa8dca7b867074164d5f45b0f3851269d":[15,0,14,4,2], -"db/ddf/insertion__sort_8c.html#ac0f2228420376f4db7e1274f2b41667c":[15,0,14,4,1], -"db/de2/naval__battle_8c.html":[15,0,5,0], -"db/de2/naval__battle_8c.html#a23e98ed36ca08c1b4bb86c86f48f6e70":[15,0,5,0,9], -"db/de2/naval__battle_8c.html#a2d65de2c86c7015d7ca400dfca0f25dc":[15,0,5,0,5], -"db/de2/naval__battle_8c.html#a3889e1ee574e03ffdde8804180d57543":[15,0,5,0,8], -"db/de2/naval__battle_8c.html#a3f7d3dc5931fba6164e73057859094d9":[15,0,5,0,3], -"db/de2/naval__battle_8c.html#a4a5686c91f144d07eff1c6576303962d":[15,0,5,0,10], -"db/de2/naval__battle_8c.html#a521043b369238e618dcc9364b40448ef":[15,0,5,0,4], -"db/de2/naval__battle_8c.html#a59224afd73372b4f52415203e315f6e1":[15,0,5,0,1], -"db/de2/naval__battle_8c.html#a5c84d83e31ca6a320b6ea8081402686a":[15,0,5,0,6], -"db/de2/naval__battle_8c.html#a7c5042bd35c4186b06ae28f06635b40e":[15,0,5,0,11], -"db/de2/naval__battle_8c.html#ab6e31f8df36de67ff967859069ccfc56":[15,0,5,0,0], -"db/de2/naval__battle_8c.html#ad527fa96e729742a231c4535e112526a":[15,0,5,0,7], -"db/de2/naval__battle_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,5,0,2], +"da/d2a/group__adaline.html#gadb1a7acb555ad62daaf3806bf2fed036":[13,2,0,6], +"da/d35/problem__1_2sol1_8c.html":[15,0,14,0,0], +"da/d35/problem__1_2sol1_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,14,0,0,0], +"da/d38/durand__kerner__roots_8c.html":[15,0,13,0], +"da/d38/durand__kerner__roots_8c.html#a26d5695ebed0818a3e7cf4b10aacab52":[15,0,13,0,1], +"da/d38/durand__kerner__roots_8c.html#a321f9781a9744ccdaf0aba89f35ec29c":[15,0,13,0,4], +"da/d38/durand__kerner__roots_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,13,0,3], +"da/d38/durand__kerner__roots_8c.html#a46197e91f478e99a2229562aaaac311e":[15,0,13,0,2], +"da/d38/durand__kerner__roots_8c.html#af270a96662132d0385cb6b4637c5a689":[15,0,13,0,0], +"da/d56/problem__1_2sol3_8c.html":[15,0,14,0,2], +"da/d56/problem__1_2sol3_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,14,0,2,0], +"da/d6c/exponential__search_8c.html":[15,0,15,1], +"da/d6c/exponential__search_8c.html#a82d4de0907b9601a376febf50955bacd":[15,0,15,1,2], +"da/d6c/exponential__search_8c.html#aa5e9be47d76a4e1865914bcb7a2a7479":[15,0,15,1,0], +"da/d6c/exponential__search_8c.html#aa8dca7b867074164d5f45b0f3851269d":[15,0,15,1,4], +"da/d6c/exponential__search_8c.html#aae97ef76c065e91c188f1f8c8076869a":[15,0,15,1,1], +"da/d6c/exponential__search_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,15,1,3], +"da/d90/stack__linked__list_2stack_8h_source.html":[15,0,3,9,0,0], +"da/d93/prime_8c.html":[15,0,12,8], +"da/d93/prime_8c.html#a6384596f117decd77da25af95ab1704f":[15,0,12,8,0], +"da/d93/prime_8c.html#ae1a3968e7947464bee7714f6d43b7002":[15,0,12,8,2], +"da/d93/prime_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,12,8,1], +"da/d96/infix__to__postfix2_8c.html":[15,0,2,5], +"da/d96/infix__to__postfix2_8c.html#a02d1bf0ff997efc46ba6fd0ec7952952":[15,0,2,5,5], +"da/d96/infix__to__postfix2_8c.html#a2d1c13296ce9c42bb5dd7d834e2802bf":[15,0,2,5,8], +"da/d96/infix__to__postfix2_8c.html#a312e7f6c761a199c1369fbe651e084f0":[15,0,2,5,4], +"da/d96/infix__to__postfix2_8c.html#a653c98c68c558505b75b04c44b7c838e":[15,0,2,5,2], +"da/d96/infix__to__postfix2_8c.html#a791cc5e78425bce611db4e3bdc4b19d5":[15,0,2,5,9], +"da/d96/infix__to__postfix2_8c.html#a90e051f23f741be4f8ca86c270d66489":[15,0,2,5,6], +"da/d96/infix__to__postfix2_8c.html#aa8dca7b867074164d5f45b0f3851269d":[15,0,2,5,7], +"da/d96/infix__to__postfix2_8c.html#ae363a3863a8bfbf40e7a95c2b9dbe71b":[15,0,2,5,1], +"da/d96/infix__to__postfix2_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,2,5,3], +"da/d9b/struct_trie_node.html":[14,0,40], +"da/da0/segment__tree_8c.html":[15,0,3,1,1], +"da/da0/segment__tree_8c.html#a1e81a9bbf01716f1b4fb27ef36a9098c":[15,0,3,1,1,10], +"da/da0/segment__tree_8c.html#a3513a2b7c3f1d15aa3d019af1f834cde":[15,0,3,1,1,7], +"da/da0/segment__tree_8c.html#a776abfa81cde9016a2885dca7cfc05ab":[15,0,3,1,1,8], +"da/da0/segment__tree_8c.html#a93bfab032ce9dbc0c1feaeee32a885fb":[15,0,3,1,1,4], +"da/da0/segment__tree_8c.html#aa8dca7b867074164d5f45b0f3851269d":[15,0,3,1,1,11], +"da/da0/segment__tree_8c.html#aae59daf9a0dc33f8cbc7a525a616ee75":[15,0,3,1,1,5], +"da/da0/segment__tree_8c.html#ac206721972f739510cb11f7c0a6a8f63":[15,0,3,1,1,2], +"da/da0/segment__tree_8c.html#aca549b5311d32ab1a703b4a4605821d8":[15,0,3,1,1,1], +"da/da0/segment__tree_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,3,1,1,3], +"da/da0/segment__tree_8c.html#af20a9f373083d3f701e1cd92560cef01":[15,0,3,1,1,6], +"da/da0/segment__tree_8c.html#af61bd96660cb53f49f28d60a5f1d0c91":[15,0,3,1,1,9], +"da/de6/udp__client_8c.html":[15,0,1,6], +"da/de6/udp__client_8c.html#a3e937c42922f7601edb17b747602c471":[15,0,1,6,0], +"da/de6/udp__client_8c.html#a614217d263be1fb1a5f76e2ff7be19a2":[15,0,1,6,1], +"da/de6/udp__client_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,1,6,2], +"db/d01/problem__13_2sol1_8c.html":[15,0,14,3,0], +"db/d01/problem__13_2sol1_8c.html#a248adc917818cc6666d8bc679a660319":[15,0,14,3,0,3], +"db/d01/problem__13_2sol1_8c.html#a840291bc02cba5474a4cb46a9b9566fe":[15,0,14,3,0,2], +"db/d01/problem__13_2sol1_8c.html#ac260f58785fb20eb09bb35385a7d47f8":[15,0,14,3,0,1], +"db/d01/problem__13_2sol1_8c.html#ad51742ca5a5c99e860bdf30299163bf2":[15,0,14,3,0,0], +"db/d0c/infix__to__postfix_8c.html":[15,0,2,4], +"db/d0c/infix__to__postfix_8c.html#a613462735d30cae1b85b606ecab30554":[15,0,2,4,7], +"db/d0c/infix__to__postfix_8c.html#a92af69ffc1e1f965ebce6a44672e96b1":[15,0,2,4,1], +"db/d0c/infix__to__postfix_8c.html#a940cdcd27c40699eebb4ef113b2d9451":[15,0,2,4,6], +"db/d0c/infix__to__postfix_8c.html#ac91f38ad7885fca93e39325361a5c787":[15,0,2,4,2], +"db/d0c/infix__to__postfix_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,2,4,5], +"db/d0c/infix__to__postfix_8c.html#afa8471c76bc57b12ad21de22beb39021":[15,0,2,4,3], +"db/d0c/infix__to__postfix_8c.html#afd8245c04b202240390de23170f72d6b":[15,0,2,4,4], +"db/d80/problem__20_2sol1_8c.html":[15,0,14,9,0], +"db/d80/problem__20_2sol1_8c.html#a0dd8af03e6cc8187e996db564ff90960":[15,0,14,9,0,2], +"db/d80/problem__20_2sol1_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,14,9,0,3], +"db/d80/problem__20_2sol1_8c.html#a54a02c4b963fdb16f24959e0137763f1":[15,0,14,9,0,4], +"db/d80/problem__20_2sol1_8c.html#a62cbbd106aad52daadb9403a07d0da32":[15,0,14,9,0,1], +"db/d84/malloc__dbg_8c.html":[15,0,4,0], +"db/d84/malloc__dbg_8c.html#a062aa89cafd39a97971a2eb22653ff2a":[15,0,4,0,2], +"db/d84/malloc__dbg_8c.html#a2a47e4c38db8c00b80248e5535adf797":[15,0,4,0,8], +"db/d84/malloc__dbg_8c.html#a37914d05ba1fe8848aa1b48cda719422":[15,0,4,0,7], +"db/d84/malloc__dbg_8c.html#a3f9195a04ac8e8a9868ee3e416db7e8c":[15,0,4,0,5], +"db/d84/malloc__dbg_8c.html#a8ac3a93239838ac88c18df64c58b9275":[15,0,4,0,4], +"db/d84/malloc__dbg_8c.html#ab07f946b77155ca78d0e14e231a99f5d":[15,0,4,0,3], +"db/d84/malloc__dbg_8c.html#ab6619fb17769f2e4e2e36c9ef2dda3c6":[15,0,4,0,1], +"db/d84/malloc__dbg_8c.html#acd08c54b257fb81e57f16c94690072f2":[15,0,4,0,6], +"db/d84/malloc__dbg_8c.html#ad04afbbcb9f0f10bc7628ec4f0d7c950":[15,0,4,0,9], +"db/d84/malloc__dbg_8c.html#afebd751704cd878d2e4b88499519c6e3":[15,0,4,0,10], +"db/d8b/struct_node.html":[14,0,27], +"db/d8b/struct_node.html#a0ed3c7305b43527f0f237bbfd438b8f7":[14,0,27,5], +"db/d8b/struct_node.html#a60b73f452505cef98795d2c8de3e72ef":[14,0,27,3], +"db/d8b/struct_node.html#a87c003c9f600e3fc58e6e90835f0b605":[14,0,27,0], +"db/d8b/struct_node.html#abe1c200da58f5276c6fd74f640a29a02":[14,0,27,1], +"db/d8b/struct_node.html#ad0976834843c7618677d22a10c495b36":[14,0,27,2], +"db/d8b/struct_node.html#af99e7102380da88d7c079fa264230cf4":[14,0,27,4], +"db/d8b/struct_node.html#afa6ccc6414d3e0bcacb715dcdf764bca":[14,0,27,6], +"db/dd5/prime__seive_8c.html":[15,0,12,9], +"db/dd5/prime__seive_8c.html#ac1215a37edfa07d37edf6ec65f2235c7":[15,0,12,9,4], +"db/ddb/hello__world_8h_source.html":[15,0,5,1,0], +"db/ddf/insertion__sort_8c.html":[15,0,16,5], +"db/ddf/insertion__sort_8c.html#a0d6c227641a5e0dae580b3a18df241fb":[15,0,16,5,0], +"db/ddf/insertion__sort_8c.html#aa8dca7b867074164d5f45b0f3851269d":[15,0,16,5,1], +"db/de2/naval__battle_8c.html":[15,0,6,0], +"db/de2/naval__battle_8c.html#a23e98ed36ca08c1b4bb86c86f48f6e70":[15,0,6,0,9], +"db/de2/naval__battle_8c.html#a2d65de2c86c7015d7ca400dfca0f25dc":[15,0,6,0,5], +"db/de2/naval__battle_8c.html#a3889e1ee574e03ffdde8804180d57543":[15,0,6,0,8], +"db/de2/naval__battle_8c.html#a3f7d3dc5931fba6164e73057859094d9":[15,0,6,0,3], +"db/de2/naval__battle_8c.html#a4a5686c91f144d07eff1c6576303962d":[15,0,6,0,10], +"db/de2/naval__battle_8c.html#a521043b369238e618dcc9364b40448ef":[15,0,6,0,4], +"db/de2/naval__battle_8c.html#a59224afd73372b4f52415203e315f6e1":[15,0,6,0,1], +"db/de2/naval__battle_8c.html#a5c84d83e31ca6a320b6ea8081402686a":[15,0,6,0,6], +"db/de2/naval__battle_8c.html#a7c5042bd35c4186b06ae28f06635b40e":[15,0,6,0,11], +"db/de2/naval__battle_8c.html#ab6e31f8df36de67ff967859069ccfc56":[15,0,6,0,0], +"db/de2/naval__battle_8c.html#ad527fa96e729742a231c4535e112526a":[15,0,6,0,7], +"db/de2/naval__battle_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,6,0,2], "dc/d18/structsudoku.html":[13,4,0], "dc/d18/structsudoku.html#a0f01e2782e82306e6fab9a8578006f56":[13,4,0,2], "dc/d18/structsudoku.html#a160365012280c3e10f1b31e914e8f129":[13,4,0,1], "dc/d18/structsudoku.html#a507f788b793d4d3d6f6a70415be84ded":[13,4,0,0], -"dc/d2e/lu__decompose_8c.html":[15,0,11,1], -"dc/d2e/lu__decompose_8c.html#a0789beb8d3396582d77b7aedf5e5554a":[15,0,11,1,0], -"dc/d2e/lu__decompose_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,11,1,2], -"dc/d2e/lu__decompose_8c.html#aae40b90a8efd645c749128cf8072bbb4":[15,0,11,1,1], -"dc/d32/problem__5_2sol1_8c.html":[15,0,12,18,0], -"dc/d32/problem__5_2sol1_8c.html#a24b470eef1ce1da4401c03ae250f93e3":[15,0,12,18,0,0], -"dc/d32/problem__5_2sol1_8c.html#a840291bc02cba5474a4cb46a9b9566fe":[15,0,12,18,0,1], -"dc/d39/selection__sort__recursive_8c.html":[15,0,14,8], -"dc/d39/selection__sort__recursive_8c.html#a3f04d850b94a34dcaaed0e7bc7475241":[15,0,14,8,2], -"dc/d39/selection__sort__recursive_8c.html#aa2bc8bdd2e8ce289a6b8ef528fd1a534":[15,0,14,8,0], -"dc/d39/selection__sort__recursive_8c.html#aa8dca7b867074164d5f45b0f3851269d":[15,0,14,8,4], -"dc/d39/selection__sort__recursive_8c.html#aaf68497ab808b560dbf109da6435905a":[15,0,14,8,3], -"dc/d39/selection__sort__recursive_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,14,8,1], -"dc/d47/realtime__stats_8c.html":[15,0,11,9], -"dc/d47/realtime__stats_8c.html#a34be233a9200ee2065f6b7b27e2d9a96":[15,0,11,9,2], -"dc/d47/realtime__stats_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,11,9,0], -"dc/d47/realtime__stats_8c.html#a63ddcdaab24f722f0963fa2fbe0ae628":[15,0,11,9,1], -"dc/d47/realtime__stats_8c.html#aa54c915581fcc495489175a4386d59fd":[15,0,11,9,3], -"dc/d63/problem__8_2sol1_8c.html":[15,0,12,21,0], -"dc/d63/problem__8_2sol1_8c.html#a0ddf1224851353fc92bfbff6f499fa97":[15,0,12,21,0,1], -"dc/d63/problem__8_2sol1_8c.html#a9ffc8845f17b01a353767a40a3adf7bd":[15,0,12,21,0,0], +"dc/d2e/lu__decompose_8c.html":[15,0,13,1], +"dc/d2e/lu__decompose_8c.html#a0789beb8d3396582d77b7aedf5e5554a":[15,0,13,1,0], +"dc/d2e/lu__decompose_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,13,1,2], +"dc/d2e/lu__decompose_8c.html#aae40b90a8efd645c749128cf8072bbb4":[15,0,13,1,1], +"dc/d32/problem__5_2sol1_8c.html":[15,0,14,18,0], +"dc/d32/problem__5_2sol1_8c.html#a24b470eef1ce1da4401c03ae250f93e3":[15,0,14,18,0,0], +"dc/d32/problem__5_2sol1_8c.html#a840291bc02cba5474a4cb46a9b9566fe":[15,0,14,18,0,1], +"dc/d39/selection__sort__recursive_8c.html":[15,0,16,10], +"dc/d39/selection__sort__recursive_8c.html#a3f04d850b94a34dcaaed0e7bc7475241":[15,0,16,10,2], +"dc/d39/selection__sort__recursive_8c.html#aa2bc8bdd2e8ce289a6b8ef528fd1a534":[15,0,16,10,0], +"dc/d39/selection__sort__recursive_8c.html#aa8dca7b867074164d5f45b0f3851269d":[15,0,16,10,4], +"dc/d39/selection__sort__recursive_8c.html#aaf68497ab808b560dbf109da6435905a":[15,0,16,10,3], +"dc/d39/selection__sort__recursive_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,16,10,1], +"dc/d47/realtime__stats_8c.html":[15,0,13,9], +"dc/d47/realtime__stats_8c.html#a34be233a9200ee2065f6b7b27e2d9a96":[15,0,13,9,2], +"dc/d47/realtime__stats_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,13,9,0], +"dc/d47/realtime__stats_8c.html#a63ddcdaab24f722f0963fa2fbe0ae628":[15,0,13,9,1], +"dc/d47/realtime__stats_8c.html#aa54c915581fcc495489175a4386d59fd":[15,0,13,9,3], +"dc/d63/problem__8_2sol1_8c.html":[15,0,14,21,0], +"dc/d63/problem__8_2sol1_8c.html#a0ddf1224851353fc92bfbff6f499fa97":[15,0,14,21,0,1], +"dc/d63/problem__8_2sol1_8c.html#a9ffc8845f17b01a353767a40a3adf7bd":[15,0,14,21,0,0], "dc/d64/md__coding_guidelines.html":[2], "dc/d64/md__coding_guidelines.html#autotoc_md11":[2,1], "dc/d64/md__coding_guidelines.html#autotoc_md9":[2,0], @@ -236,18 +180,74 @@ var NAVTREEINDEX2 = "dc/d77/struct__big__int.html#a187538b984c86d7cfdb13e297e7f3564":[14,0,0,0], "dc/d77/struct__big__int.html#a273ee73fd755f2a99512cca5f0e09008":[14,0,0,2], "dc/d77/struct__big__int.html#ad8405989a924410942b39ec0e9fef30b":[14,0,0,1], -"dc/d80/cantor__set_8c.html":[15,0,10,0], -"dc/d80/cantor__set_8c.html#a1f156d2b53b80305bd2fa3ff5fdf3c97":[15,0,10,0,5], -"dc/d80/cantor__set_8c.html#a2b95c356aff8a282eaad255008fa5a94":[15,0,10,0,1], -"dc/d80/cantor__set_8c.html#a75ee530cd7148a63249784ad3dda8fab":[15,0,10,0,4], -"dc/d80/cantor__set_8c.html#a85df3c64a683100ac6246e1e034df43d":[15,0,10,0,2], -"dc/d80/cantor__set_8c.html#abf9e6b7e6f15df4b525a2e7705ba3089":[15,0,10,0,3], -"dc/d80/collatz_8c.html":[15,0,10,2], -"dc/d80/collatz_8c.html#a0ddf1224851353fc92bfbff6f499fa97":[15,0,10,2,0], -"dc/d9a/group__quats.html":[13,0,7], -"dc/d9a/group__quats.html#ga1afd165100e9b02b86e3bd11b50f3b06":[15,0,6,1,0], -"dc/d9a/group__quats.html#ga1afd165100e9b02b86e3bd11b50f3b06":[13,0,7,4], -"dc/d9a/group__quats.html#ga4779f448daaf806ce5e750c13b3e0965":[13,0,7,5], -"dc/d9a/group__quats.html#ga4779f448daaf806ce5e750c13b3e0965":[15,0,6,1,2], -"dc/d9a/group__quats.html#ga8cc5e5b7a5fa492423ecf034c8bb52bd":[15,0,6,0,2] +"dc/d80/cantor__set_8c.html":[15,0,12,0], +"dc/d80/cantor__set_8c.html#a1f156d2b53b80305bd2fa3ff5fdf3c97":[15,0,12,0,5], +"dc/d80/cantor__set_8c.html#a2b95c356aff8a282eaad255008fa5a94":[15,0,12,0,1], +"dc/d80/cantor__set_8c.html#a75ee530cd7148a63249784ad3dda8fab":[15,0,12,0,4], +"dc/d80/cantor__set_8c.html#a85df3c64a683100ac6246e1e034df43d":[15,0,12,0,2], +"dc/d80/cantor__set_8c.html#abf9e6b7e6f15df4b525a2e7705ba3089":[15,0,12,0,3], +"dc/d80/collatz_8c.html":[15,0,12,2], +"dc/d80/collatz_8c.html#a0ddf1224851353fc92bfbff6f499fa97":[15,0,12,2,0], +"dc/d9a/group__quats.html":[13,0,2], +"dc/d9a/group__quats.html#ga1afd165100e9b02b86e3bd11b50f3b06":[13,0,2,4], +"dc/d9a/group__quats.html#ga4779f448daaf806ce5e750c13b3e0965":[13,0,2,5], +"dc/d9a/group__quats.html#ga8cc5e5b7a5fa492423ecf034c8bb52bd":[13,0,2,2], +"dc/d9a/group__quats.html#gaacd70a16b61dd47a19eb5fb729c2669b":[13,0,2,3], +"dc/d9a/group__quats.html#gaf5ad0f9c4f0facc5a9c3735a178156b1":[13,0,2,6], +"dc/db4/md__r_e_v_i_e_w_e_r__c_o_d_e.html":[12], +"dc/de3/hash__set_8h_source.html":[15,0,3,5,0], +"dc/de5/structsubset.html":[14,0,35], +"dd/d06/structsegment__tree.html":[14,0,33], +"dd/d06/structsegment__tree.html#a5373ee53a5ac1cd7a9dcb89a4c23a04a":[14,0,33,2], +"dd/d06/structsegment__tree.html#a5ad61abcbd2c25a4a71416281dba8f1e":[14,0,33,3], +"dd/d06/structsegment__tree.html#a973ab017a97678fdc6774543585897df":[14,0,33,0], +"dd/d06/structsegment__tree.html#aa18d7cb422873a807707b26448dce7cd":[14,0,33,4], +"dd/d06/structsegment__tree.html#aa9dc376b5b219c4cec6546483527b853":[14,0,33,1], +"dd/d08/newton__raphson__root_8c.html":[15,0,13,2], +"dd/d08/newton__raphson__root_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,13,2,3], +"dd/d08/newton__raphson__root_8c.html#a72f87d423a488946b319627a454d3925":[15,0,13,2,2], +"dd/d08/newton__raphson__root_8c.html#ae713a1fd0c275fbec7edf263ac2c0337":[15,0,13,2,1], +"dd/d08/newton__raphson__root_8c.html#af270a96662132d0385cb6b4637c5a689":[15,0,13,2,0], +"dd/d10/struct_stack.html":[14,0,34], +"dd/d10/struct_stack.html#a856ca6f4a9ffde43f0cb3b43cb4d044d":[14,0,34,0], +"dd/d10/struct_stack.html#aa16cf0b36f9735ed00bde97a5013adaa":[14,0,34,1], +"dd/d10/struct_stack.html#ac2dbef151bc913684a90b06836725ef9":[14,0,34,3], +"dd/d10/struct_stack.html#ad62fb36816185f3eef3a6f735a61f54a":[14,0,34,2], +"dd/d11/test__malloc__dbg_8c.html":[15,0,4,3], +"dd/d11/test__malloc__dbg_8c.html#a0ddf1224851353fc92bfbff6f499fa97":[15,0,4,3,0], +"dd/d29/doubly__linked__list_8c.html":[15,0,3,6,0], +"dd/d29/doubly__linked__list_8c.html#a04ac29c396dc8335a5827927183c9918":[15,0,3,6,0,5], +"dd/d29/doubly__linked__list_8c.html#a1fadec32fc369a8dcfbcd766e166efa0":[15,0,3,6,0,7], +"dd/d29/doubly__linked__list_8c.html#a37890fb794cb2c436ffcc643c30ec57f":[15,0,3,6,0,2], +"dd/d29/doubly__linked__list_8c.html#aa49167a68597f162e699b846fac0d446":[15,0,3,6,0,3], +"dd/d29/doubly__linked__list_8c.html#aa89b8bc105d9a09d4e7c06e8b34078a7":[15,0,3,6,0,1], +"dd/d29/doubly__linked__list_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,3,6,0,6], +"dd/d29/doubly__linked__list_8c.html#aedd04074dbc6af0de89051f97209311b":[15,0,3,6,0,8], +"dd/d29/doubly__linked__list_8c.html#afa2b50f4716fc3b42221a72e676e1422":[15,0,3,6,0,4], +"dd/d53/int__to__string_8c.html":[15,0,2,6], +"dd/d53/int__to__string_8c.html#aa8dca7b867074164d5f45b0f3851269d":[15,0,2,6,2], +"dd/d53/int__to__string_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,2,6,1], +"dd/d53/int__to__string_8c.html#aeb4be1a1db1c5fea06e9d8b87e6c3973":[15,0,2,6,0], +"dd/d7a/group__matrix.html":[13,0,1], +"dd/d7a/group__matrix.html#ga9f844010cb96591fa94c9d533a500ab7":[13,0,1,1], +"dd/d8b/problem__22_2sol1_8c.html":[15,0,14,11,0], +"dd/d8b/problem__22_2sol1_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,14,11,0,3], +"dd/d8b/problem__22_2sol1_8c.html#a5bc3659aa0949ea33118c95b1dee5f63":[15,0,14,11,0,4], +"dd/d8b/problem__22_2sol1_8c.html#a6cb9b08aacb61416795ee78bfceacd38":[15,0,14,11,0,1], +"dd/d8b/problem__22_2sol1_8c.html#ae359b8a4656b164c91ef91a084c15c9d":[15,0,14,11,0,2], +"dd/d8b/problem__22_2sol1_8c.html#afd709f201d7643c3909621f620ea648a":[15,0,14,11,0,0], +"dd/d8c/adaline__learning_8c.html":[15,0,11,0], +"dd/d8c/adaline__learning_8c.html#a05cc9a0acb524fde727a4d7b4a747ee6":[15,0,11,0,11], +"dd/d8c/adaline__learning_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,11,0,8], +"dd/d8c/adaline__learning_8c.html#a3f37b9f073f7e57fd0b39d70718af1b1":[15,0,11,0,12], +"dd/d8c/adaline__learning_8c.html#ab4ecb3accf5d9e0263087e7265bbe3a9":[15,0,11,0,10], +"dd/d93/client_8c.html":[15,0,1,0], +"dd/d93/client_8c.html#a1e43924adac4ae865aa0acf79710261c":[15,0,1,0,2], +"dd/d93/client_8c.html#a392fb874e547e582e9c66a08a1f23326":[15,0,1,0,0], +"dd/d93/client_8c.html#a614217d263be1fb1a5f76e2ff7be19a2":[15,0,1,0,1], +"dd/d93/client_8c.html#ac17020a38607ab29ce18939d5194a32a":[15,0,1,0,3], +"dd/d93/client_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,1,0,4], +"dd/d95/word__count_8h_source.html":[15,0,5,4,0], +"dd/da2/structbuffer.html":[14,0,6], +"dd/de4/bubble__sort_8c.html":[15,0,16,1] }; diff --git a/navtreeindex3.js b/navtreeindex3.js index c42693414..c507c6c9c 100644 --- a/navtreeindex3.js +++ b/navtreeindex3.js @@ -1,228 +1,162 @@ var NAVTREEINDEX3 = { -"dc/d9a/group__quats.html#ga8cc5e5b7a5fa492423ecf034c8bb52bd":[13,0,7,2], -"dc/d9a/group__quats.html#gaacd70a16b61dd47a19eb5fb729c2669b":[13,0,7,3], -"dc/d9a/group__quats.html#gaacd70a16b61dd47a19eb5fb729c2669b":[15,0,6,0,4], -"dc/d9a/group__quats.html#gaf5ad0f9c4f0facc5a9c3735a178156b1":[15,0,6,1,3], -"dc/d9a/group__quats.html#gaf5ad0f9c4f0facc5a9c3735a178156b1":[13,0,7,6], -"dc/db4/md__r_e_v_i_e_w_e_r__c_o_d_e.html":[12], -"dc/de3/hash__set_8h_source.html":[15,0,2,5,0], -"dc/de5/structsubset.html":[14,0,34], -"dc/de5/structsubset.html#a2cc3bbda6f758afb7bf8067eb8f07a10":[14,0,34,1], -"dc/de5/structsubset.html#ad8f7d99dc56f8ce3f0c3aaf4a633373a":[14,0,34,0], -"dd/d06/structsegment__tree.html":[14,0,32], -"dd/d06/structsegment__tree.html#a5373ee53a5ac1cd7a9dcb89a4c23a04a":[14,0,32,2], -"dd/d06/structsegment__tree.html#a5ad61abcbd2c25a4a71416281dba8f1e":[14,0,32,3], -"dd/d06/structsegment__tree.html#a973ab017a97678fdc6774543585897df":[14,0,32,0], -"dd/d06/structsegment__tree.html#aa18d7cb422873a807707b26448dce7cd":[14,0,32,4], -"dd/d06/structsegment__tree.html#aa9dc376b5b219c4cec6546483527b853":[14,0,32,1], -"dd/d08/newton__raphson__root_8c.html":[15,0,11,2], -"dd/d08/newton__raphson__root_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,11,2,3], -"dd/d08/newton__raphson__root_8c.html#a72f87d423a488946b319627a454d3925":[15,0,11,2,2], -"dd/d08/newton__raphson__root_8c.html#ae713a1fd0c275fbec7edf263ac2c0337":[15,0,11,2,1], -"dd/d08/newton__raphson__root_8c.html#af270a96662132d0385cb6b4637c5a689":[15,0,11,2,0], -"dd/d10/struct_stack.html":[14,0,33], -"dd/d10/struct_stack.html#a2a9b92a4668113debfb801b39a41fea2":[14,0,33,0], -"dd/d10/struct_stack.html#a6cd56fb14cbfe1d0e76e3b1a1bbbde28":[14,0,33,1], -"dd/d10/struct_stack.html#ac2dbef151bc913684a90b06836725ef9":[14,0,33,3], -"dd/d10/struct_stack.html#ad62fb36816185f3eef3a6f735a61f54a":[14,0,33,2], -"dd/d11/test__malloc__dbg_8c.html":[15,0,3,2], -"dd/d11/test__malloc__dbg_8c.html#a0ddf1224851353fc92bfbff6f499fa97":[15,0,3,2,0], -"dd/d29/doubly__linked__list_8c.html":[15,0,2,6,0], -"dd/d29/doubly__linked__list_8c.html#a04ac29c396dc8335a5827927183c9918":[15,0,2,6,0,5], -"dd/d29/doubly__linked__list_8c.html#a1fadec32fc369a8dcfbcd766e166efa0":[15,0,2,6,0,7], -"dd/d29/doubly__linked__list_8c.html#a37890fb794cb2c436ffcc643c30ec57f":[15,0,2,6,0,2], -"dd/d29/doubly__linked__list_8c.html#aa49167a68597f162e699b846fac0d446":[15,0,2,6,0,3], -"dd/d29/doubly__linked__list_8c.html#aa89b8bc105d9a09d4e7c06e8b34078a7":[15,0,2,6,0,1], -"dd/d29/doubly__linked__list_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,2,6,0,6], -"dd/d29/doubly__linked__list_8c.html#aedd04074dbc6af0de89051f97209311b":[15,0,2,6,0,8], -"dd/d29/doubly__linked__list_8c.html#afa2b50f4716fc3b42221a72e676e1422":[15,0,2,6,0,4], -"dd/d53/int__to__string_8c.html":[15,0,1,4], -"dd/d53/int__to__string_8c.html#a969911f32f1c435bb2bf166574ef9ae5":[15,0,1,4,0], -"dd/d53/int__to__string_8c.html#aa8dca7b867074164d5f45b0f3851269d":[15,0,1,4,2], -"dd/d53/int__to__string_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,1,4,1], -"dd/d7a/group__matrix.html":[13,0,6], -"dd/d7a/group__matrix.html#ga9f844010cb96591fa94c9d533a500ab7":[15,0,6,0,3], -"dd/d7a/group__matrix.html#ga9f844010cb96591fa94c9d533a500ab7":[13,0,6,1], -"dd/d8b/problem__22_2sol1_8c.html":[15,0,12,11,0], -"dd/d8b/problem__22_2sol1_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,12,11,0,3], -"dd/d8b/problem__22_2sol1_8c.html#a5bc3659aa0949ea33118c95b1dee5f63":[15,0,12,11,0,4], -"dd/d8b/problem__22_2sol1_8c.html#a6cb9b08aacb61416795ee78bfceacd38":[15,0,12,11,0,1], -"dd/d8b/problem__22_2sol1_8c.html#ae359b8a4656b164c91ef91a084c15c9d":[15,0,12,11,0,2], -"dd/d8b/problem__22_2sol1_8c.html#afd709f201d7643c3909621f620ea648a":[15,0,12,11,0,0], -"dd/d8c/adaline__learning_8c.html":[15,0,9,0], -"dd/d8c/adaline__learning_8c.html#a05cc9a0acb524fde727a4d7b4a747ee6":[15,0,9,0,11], -"dd/d8c/adaline__learning_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,9,0,8], -"dd/d8c/adaline__learning_8c.html#a3f37b9f073f7e57fd0b39d70718af1b1":[15,0,9,0,12], -"dd/d8c/adaline__learning_8c.html#ab4ecb3accf5d9e0263087e7265bbe3a9":[15,0,9,0,10], -"dd/d93/client_8c.html":[15,0,0,0], -"dd/d93/client_8c.html#a1e43924adac4ae865aa0acf79710261c":[15,0,0,0,2], -"dd/d93/client_8c.html#a392fb874e547e582e9c66a08a1f23326":[15,0,0,0,0], -"dd/d93/client_8c.html#a614217d263be1fb1a5f76e2ff7be19a2":[15,0,0,0,1], -"dd/d93/client_8c.html#ac17020a38607ab29ce18939d5194a32a":[15,0,0,0,3], -"dd/d93/client_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,0,0,4], -"dd/d95/word__count_8h_source.html":[15,0,4,4,0], -"dd/de4/bubble__sort_8c.html":[15,0,14,1], -"dd/de4/bubble__sort_8c.html#aa8989f6c9bfd1f040854fa18b180114f":[15,0,14,1,0], -"dd/de4/bubble__sort_8c.html#ac0f2228420376f4db7e1274f2b41667c":[15,0,14,1,2], -"dd/de4/bubble__sort_8c.html#ad126fa7239be97373c96861adc70b1d3":[15,0,14,1,3], -"dd/de4/bubble__sort_8c.html#ad7ed8cc4603f500d610054680d28b971":[15,0,14,1,1], -"dd/de4/bubble__sort_8c.html#ae1a3968e7947464bee7714f6d43b7002":[15,0,14,1,4], -"dd/df0/problem__19_2sol1_8c.html":[15,0,12,7,0], -"dd/df0/problem__19_2sol1_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,12,7,0,2], -"dd/df0/problem__19_2sol1_8c.html#a6561b1adc8a19c092679b9874da24e2e":[15,0,12,7,0,1], -"dd/df0/problem__19_2sol1_8c.html#ab7f9ad087f124b8e0615aa535b4c8a75":[15,0,12,7,0,0], -"de/d0c/insertion__sort__recursive_8c.html":[15,0,14,5], -"de/d0c/insertion__sort__recursive_8c.html#aa8dca7b867074164d5f45b0f3851269d":[15,0,14,5,2], -"de/d0c/insertion__sort__recursive_8c.html#ac0f2228420376f4db7e1274f2b41667c":[15,0,14,5,0], +"dd/de4/bubble__sort_8c.html#aa8989f6c9bfd1f040854fa18b180114f":[15,0,16,1,0], +"dd/de4/bubble__sort_8c.html#ac0f2228420376f4db7e1274f2b41667c":[15,0,16,1,2], +"dd/de4/bubble__sort_8c.html#ad126fa7239be97373c96861adc70b1d3":[15,0,16,1,3], +"dd/de4/bubble__sort_8c.html#ad7ed8cc4603f500d610054680d28b971":[15,0,16,1,1], +"dd/de4/bubble__sort_8c.html#ae1a3968e7947464bee7714f6d43b7002":[15,0,16,1,4], +"dd/df0/problem__19_2sol1_8c.html":[15,0,14,7,0], +"dd/df0/problem__19_2sol1_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,14,7,0,2], +"dd/df0/problem__19_2sol1_8c.html#a6561b1adc8a19c092679b9874da24e2e":[15,0,14,7,0,1], +"dd/df0/problem__19_2sol1_8c.html#ab7f9ad087f124b8e0615aa535b4c8a75":[15,0,14,7,0,0], +"de/d0c/insertion__sort__recursive_8c.html":[15,0,16,6], +"de/d0c/insertion__sort__recursive_8c.html#aa8dca7b867074164d5f45b0f3851269d":[15,0,16,6,2], +"de/d0c/insertion__sort__recursive_8c.html#ac0f2228420376f4db7e1274f2b41667c":[15,0,16,6,0], "de/d20/md_data_structures_dictionary__r_e_a_d_m_e.html":[5], -"de/d20/md_data_structures_dictionary__r_e_a_d_m_e.html#autotoc_md35":[0], -"de/d58/structquaternion__.html":[13,0,7,0], -"de/d58/structquaternion__.html#a2ce1409f1d683aa40eade31d60ded530":[13,0,7,0,4], -"de/d58/structquaternion__.html#a37819eb7d76c65c37a9c2a63f01f65b2":[13,0,7,0,1], -"de/d58/structquaternion__.html#a3b00276b56da72911199baf48814b3f6":[13,0,7,0,2], -"de/d58/structquaternion__.html#a596abbab688731119c1f23b26a7ac17a":[13,0,7,0,0], -"de/d58/structquaternion__.html#a627574208aad1215fde8fcf9cb3f36e4":[13,0,7,0,3], -"de/d58/structquaternion__.html#a835e2ba72517fbb29d0d4e3cb4c2914f":[13,0,7,0,5], +"de/d58/structquaternion__.html":[13,0,2,0], +"de/d58/structquaternion__.html#a37819eb7d76c65c37a9c2a63f01f65b2":[13,0,2,0,1], +"de/d58/structquaternion__.html#a596abbab688731119c1f23b26a7ac17a":[13,0,2,0,0], +"de/d58/structquaternion__.html#a835e2ba72517fbb29d0d4e3cb4c2914f":[13,0,2,0,2], "de/d5a/group__quaternions.html":[13,0], -"de/d5a/group__quaternions.html#ga002b2f4894492820fe708b1b7e7c5e70":[15,0,6,0,0], -"de/d5a/group__quaternions.html#ga002b2f4894492820fe708b1b7e7c5e70":[13,0,10], -"de/d7b/group__vec__3d.html":[13,0,5], -"de/d7b/group__vec__3d.html#ga243e74d542d0d4d14fa3ae0bc2170d84":[15,0,6,2,0], -"de/d7b/group__vec__3d.html#ga243e74d542d0d4d14fa3ae0bc2170d84":[13,0,5,2], -"de/d7b/group__vec__3d.html#ga3cdfd8378a0b115563ea6c561bb46b7e":[13,0,5,5], -"de/d7b/group__vec__3d.html#ga3cdfd8378a0b115563ea6c561bb46b7e":[15,0,6,2,5], -"de/d7b/group__vec__3d.html#ga4fd194972bea4884e0b33cf4a166d14e":[15,0,6,2,3], -"de/d7b/group__vec__3d.html#ga4fd194972bea4884e0b33cf4a166d14e":[13,0,5,4], -"de/d7b/group__vec__3d.html#ga5082b0720c2cc51ae84bf19bd76dc849":[15,0,6,2,1], -"de/d7b/group__vec__3d.html#ga5082b0720c2cc51ae84bf19bd76dc849":[13,0,5,3], -"de/d7b/group__vec__3d.html#ga94805165d037d111d7d7c0df99e3a5de":[15,0,6,2,7], -"de/d7b/group__vec__3d.html#ga94805165d037d111d7d7c0df99e3a5de":[13,0,5,7], -"de/d7b/group__vec__3d.html#ga97da356cb7d5da73a0ac9bad09a435cc":[15,0,6,2,9], -"de/d7b/group__vec__3d.html#ga97da356cb7d5da73a0ac9bad09a435cc":[13,0,5,9], -"de/d7b/group__vec__3d.html#gaa6b5ac18429ffb0131dc8593d31c25a4":[15,0,6,2,6], -"de/d7b/group__vec__3d.html#gaa6b5ac18429ffb0131dc8593d31c25a4":[13,0,5,6], -"de/d7b/group__vec__3d.html#gae4a49e6bdf13df949e8b23c7925bb5f5":[13,0,5,8], -"de/d7b/group__vec__3d.html#gae4a49e6bdf13df949e8b23c7925bb5f5":[15,0,6,2,8], -"de/d7b/group__vec__3d.html#gaf9ee870d4922e488bdd3e7262485c270":[15,0,6,0,5], -"de/d7b/group__vec__3d.html#gaf9ee870d4922e488bdd3e7262485c270":[13,0,5,1], -"de/dac/sudoku__solver_8c.html":[15,0,10,10], -"de/dac/sudoku__solver_8c.html#ae1a3968e7947464bee7714f6d43b7002":[15,0,10,10,8], -"de/dac/sudoku__solver_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,10,10,1], -"de/dce/structmin__heap.html":[14,0,24], -"de/dce/structmin__heap.html#a456c6372c103c6d1bb430f581f5d3c71":[14,0,24,2], -"de/dce/structmin__heap.html#a9fd34546dad4dfd9e6a456936b766123":[14,0,24,0], -"de/dce/structmin__heap.html#ad960bfacd24fb843208db83f113ebc8f":[14,0,24,1], -"df/d16/palindrome_8c.html":[15,0,10,5], -"df/d16/palindrome_8c.html#a6320493ddee0ca4614423721c5d6f4ba":[15,0,10,5,0], -"df/d16/palindrome_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,10,5,1], -"df/d1a/problem__21_2sol1_8c.html":[15,0,12,10,0], -"df/d1a/problem__21_2sol1_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,12,10,0,0], -"df/d1a/problem__21_2sol1_8c.html#aacf4b7e708651d2164e86958f2c29c93":[15,0,12,10,0,1], -"df/d3b/binary__search_8c.html":[15,0,13,0], -"df/d3b/binary__search_8c.html#a40855c608ca64048d04cff6526f0a582":[15,0,13,0,0], -"df/d3b/binary__search_8c.html#a840291bc02cba5474a4cb46a9b9566fe":[15,0,13,0,2], -"df/d3b/binary__search_8c.html#a908fd6d2ad0bba33f63f8454888a0032":[15,0,13,0,1], -"df/d3b/binary__search_8c.html#ae1a3968e7947464bee7714f6d43b7002":[15,0,13,0,3], -"df/d3c/threaded__binary__trees_8c.html":[15,0,2,1,2], -"df/d3c/threaded__binary__trees_8c.html#a284d683f74b6c884e79ba00d3d1c3317":[15,0,2,1,2,3], -"df/d3c/threaded__binary__trees_8c.html#a306d567466f22e1e927aaed97d8bb58c":[15,0,2,1,2,9], -"df/d3c/threaded__binary__trees_8c.html#a4c1e06b5f0876ec9c1bd6817f3b7eda7":[15,0,2,1,2,4], -"df/d3c/threaded__binary__trees_8c.html#a5a82ae0ee13788be51ca4ba6cddb0719":[15,0,2,1,2,7], -"df/d3c/threaded__binary__trees_8c.html#a8169ba0dfd5b8183672e444d1434bf9c":[15,0,2,1,2,8], -"df/d3c/threaded__binary__trees_8c.html#a823432888332fc9f0aa6072cff28c3bb":[15,0,2,1,2,5], -"df/d3c/threaded__binary__trees_8c.html#ab21d1d36d95001defbca2f6abd4d410c":[15,0,2,1,2,2], -"df/d3c/threaded__binary__trees_8c.html#ad8ecdcce462dd8e170ae1f164935aaa6":[15,0,2,1,2,1], -"df/d3c/threaded__binary__trees_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,2,1,2,6], +"de/d5a/group__quaternions.html#ga002b2f4894492820fe708b1b7e7c5e70":[13,0,5], +"de/d7b/group__vec__3d.html":[13,0,0], +"de/d7b/group__vec__3d.html#ga243e74d542d0d4d14fa3ae0bc2170d84":[13,0,0,2], +"de/d7b/group__vec__3d.html#ga3cdfd8378a0b115563ea6c561bb46b7e":[13,0,0,6], +"de/d7b/group__vec__3d.html#ga5082b0720c2cc51ae84bf19bd76dc849":[13,0,0,4], +"de/d7b/group__vec__3d.html#ga55be1d766c8a824b35d97e79744834d8":[13,0,0,3], +"de/d7b/group__vec__3d.html#ga94805165d037d111d7d7c0df99e3a5de":[13,0,0,8], +"de/d7b/group__vec__3d.html#ga97da356cb7d5da73a0ac9bad09a435cc":[13,0,0,10], +"de/d7b/group__vec__3d.html#gaa6b5ac18429ffb0131dc8593d31c25a4":[13,0,0,7], +"de/d7b/group__vec__3d.html#gae25e1f2e973933bef65838601e2de0af":[13,0,0,5], +"de/d7b/group__vec__3d.html#gae4a49e6bdf13df949e8b23c7925bb5f5":[13,0,0,9], +"de/d7b/group__vec__3d.html#gaf9ee870d4922e488bdd3e7262485c270":[13,0,0,1], +"de/dac/sudoku__solver_8c.html":[15,0,12,11], +"de/dac/sudoku__solver_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,12,11,1], +"de/dce/structmin__heap.html":[14,0,25], +"de/dff/heap__sort__2_8c.html":[15,0,16,4], +"de/dff/heap__sort__2_8c.html#a00cd944b33a5fe5972111ded9b49793c":[15,0,16,4,0], +"de/dff/heap__sort__2_8c.html#a619753b978f962aa2337e1fdb4e59e33":[15,0,16,4,1], +"de/dff/heap__sort__2_8c.html#a672a47d865e7fa18f1ff23001ef4a485":[15,0,16,4,2], +"de/dff/heap__sort__2_8c.html#aa8dca7b867074164d5f45b0f3851269d":[15,0,16,4,5], +"de/dff/heap__sort__2_8c.html#aaf68497ab808b560dbf109da6435905a":[15,0,16,4,4], +"de/dff/heap__sort__2_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,16,4,3], +"df/d16/palindrome_8c.html":[15,0,12,5], +"df/d16/palindrome_8c.html#a6320493ddee0ca4614423721c5d6f4ba":[15,0,12,5,0], +"df/d16/palindrome_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,12,5,1], +"df/d1a/problem__21_2sol1_8c.html":[15,0,14,10,0], +"df/d1a/problem__21_2sol1_8c.html#a3c04138a5bfe5d72780bb7e82a18e627":[15,0,14,10,0,0], +"df/d1a/problem__21_2sol1_8c.html#aacf4b7e708651d2164e86958f2c29c93":[15,0,14,10,0,1], +"df/d27/alaw_8c.html":[15,0,0,0], +"df/d27/alaw_8c.html#a05b49c662c073f89e86804f7856622a0":[15,0,0,0,0], +"df/d27/alaw_8c.html#a093ac72124e3c2268d1150676e63175d":[15,0,0,0,1], +"df/d27/alaw_8c.html#a0ddf1224851353fc92bfbff6f499fa97":[15,0,0,0,3], +"df/d27/alaw_8c.html#a751d8e2c1975706e4d876316518c54c4":[15,0,0,0,2], +"df/d27/alaw_8c.html#a840bf13d2e4d75d38fb7bf3a655152f5":[15,0,0,0,4], +"df/d3b/binary__search_8c.html":[15,0,15,0], +"df/d3b/binary__search_8c.html#a40855c608ca64048d04cff6526f0a582":[15,0,15,0,0], +"df/d3b/binary__search_8c.html#a840291bc02cba5474a4cb46a9b9566fe":[15,0,15,0,2], +"df/d3b/binary__search_8c.html#a908fd6d2ad0bba33f63f8454888a0032":[15,0,15,0,1], +"df/d3b/binary__search_8c.html#ae1a3968e7947464bee7714f6d43b7002":[15,0,15,0,3], +"df/d3c/threaded__binary__trees_8c.html":[15,0,3,1,2], +"df/d3c/threaded__binary__trees_8c.html#a284d683f74b6c884e79ba00d3d1c3317":[15,0,3,1,2,3], +"df/d3c/threaded__binary__trees_8c.html#a306d567466f22e1e927aaed97d8bb58c":[15,0,3,1,2,9], +"df/d3c/threaded__binary__trees_8c.html#a4802bca3f38251543b4aba6765e0390d":[15,0,3,1,2,2], +"df/d3c/threaded__binary__trees_8c.html#a4c1e06b5f0876ec9c1bd6817f3b7eda7":[15,0,3,1,2,4], +"df/d3c/threaded__binary__trees_8c.html#a5a82ae0ee13788be51ca4ba6cddb0719":[15,0,3,1,2,7], +"df/d3c/threaded__binary__trees_8c.html#a8169ba0dfd5b8183672e444d1434bf9c":[15,0,3,1,2,8], +"df/d3c/threaded__binary__trees_8c.html#a823432888332fc9f0aa6072cff28c3bb":[15,0,3,1,2,5], +"df/d3c/threaded__binary__trees_8c.html#ad8ecdcce462dd8e170ae1f164935aaa6":[15,0,3,1,2,1], +"df/d3c/threaded__binary__trees_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,3,1,2,6], +"df/d43/postfix__evaluation_8c.html":[15,0,12,7], +"df/d43/postfix__evaluation_8c.html#a4494492c8fc2509f602acc8228a3b623":[15,0,12,7,1], +"df/d43/postfix__evaluation_8c.html#a791cc5e78425bce611db4e3bdc4b19d5":[15,0,12,7,6], +"df/d43/postfix__evaluation_8c.html#a8546e4b3f61be1f09ce47f428116ad7d":[15,0,12,7,3], +"df/d43/postfix__evaluation_8c.html#aa8dca7b867074164d5f45b0f3851269d":[15,0,12,7,5], +"df/d43/postfix__evaluation_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,12,7,2], +"df/d43/postfix__evaluation_8c.html#af395c540f7e70a8d82d055a0aa42bbef":[15,0,12,7,4], "df/d58/md_leetcode__r_e_a_d_m_e.html":[10], -"df/d58/md_leetcode__r_e_a_d_m_e.html#autotoc_md60":[4], -"df/d83/selection__sort_8c.html":[15,0,14,7], -"df/d83/selection__sort_8c.html#aa8dca7b867074164d5f45b0f3851269d":[15,0,14,7,3], -"df/d83/selection__sort_8c.html#ac0f2228420376f4db7e1274f2b41667c":[15,0,14,7,0], -"df/d83/selection__sort_8c.html#ad126fa7239be97373c96861adc70b1d3":[15,0,14,7,2], -"df/d83/selection__sort_8c.html#aeafe7419cfceaeccaf49f22842d9a617":[15,0,14,7,1], -"df/d86/structterm.html":[14,0,37], -"df/d86/structterm.html#a057f161d279d856d11786aa96fc87f74":[14,0,37,2], -"df/d86/structterm.html#a5a730814391f70179da78c657e6e6f7b":[14,0,37,0], -"df/d86/structterm.html#ab7ac49a58cc431c9838c855bf59a243a":[14,0,37,1], -"df/d98/quaternions_8c.html":[15,0,6,1], -"df/d98/quaternions_8c.html#aa8dca7b867074164d5f45b0f3851269d":[15,0,6,1,4], -"df/d98/quaternions_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,6,1,1], -"df/da5/problem__9_2sol1_8c.html":[15,0,12,22,0], -"df/da5/problem__9_2sol1_8c.html#a840291bc02cba5474a4cb46a9b9566fe":[15,0,12,22,0,0], -"df/db3/struct_l.html":[14,0,19], -"df/db3/struct_l.html#a4d585643a6364fbf79f54de5fa49d17f":[14,0,19,1], -"df/db3/struct_l.html#adbf91f5f6cc3047e13bb3dbbfb277be0":[14,0,19,0], -"df/dc6/acronym_8h_source.html":[15,0,4,0,0], -"df/ddb/structword__count__word.html":[14,0,41], -"df/ddb/structword__count__word.html#a44e237e11196ffa56574b90ea807e8fc":[14,0,41,0], -"df/ddb/structword__count__word.html#a9c018b5f83b2aeeefac5cc09e5f41efd":[14,0,41,1], -"df/dea/structdata.html":[14,0,8], -"df/dea/structdata.html#a7a7e33023945ddb393dc306c489c4049":[14,0,8,1], -"df/dea/structdata.html#ab1464d70ed28af0a16cdd2ebaa64027c":[14,0,8,0], -"df/df3/union__find_8c.html":[15,0,10,11], -"df/df3/union__find_8c.html#a0592dba56693fad79136250c11e5a7fe":[15,0,10,11,0], -"df/df3/union__find_8c.html#a3e13b69cce5a1b25ae034798092f3d86":[15,0,10,11,1], -"df/df3/union__find_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,10,11,3], -"df/df3/union__find_8c.html#af2f3ff6d98641f7d3be11f071c97908a":[15,0,10,11,2], -"dir_0472225043064b54f3dfff9011a9fae0.html":[15,0,2,8,0], -"dir_079e1f799fb08a8a0b98cb030ab15687.html":[15,0,12,13], -"dir_0bc3e2a5baf077fa21dadc079776fcac.html":[15,0,12,7], -"dir_167af11096b7752ff31b3d4bec489317.html":[15,0,12,19], -"dir_16b947d8e9a05fe119d0675493324331.html":[15,0,12,1], -"dir_16e00c78ef36d1842d0d8a4afc46b852.html":[15,0,12,14], -"dir_1833eb69ceee7a265ffba4c38c8243d2.html":[15,0,12,16], -"dir_18cba55772148686552805a354a79093.html":[15,0,12,6], -"dir_2176ba3565d8b1fe2a106d18679cc7bf.html":[15,0,2,8], -"dir_261dd1200fad5b2fe1eca9af8320656e.html":[15,0,2,6], -"dir_2abe2c0880d3fb0dba0f784bee3fc9e0.html":[15,0,12,11], -"dir_2b14f32f14b51065d3a322bea21da3c0.html":[15,0,12,5], -"dir_2e746e9d06bf2d8ff842208bcc6ebcfc.html":[15,0,2], -"dir_2f070f19f76dfadabbc24fe483d7e98d.html":[15,0,12,17], -"dir_2fede762f95c9c526850a639b984c56b.html":[15,0,2,4], -"dir_3343723ae086de42ee4ca9774da3a13f.html":[15,0,9], -"dir_4500de955d1eddb82f69331d96e39ed9.html":[15,0,4,1], -"dir_475f56e0a4ef6254f5610544d8d68aa3.html":[15,0,4,4], -"dir_48bf5503321d91c557399989fed5dabd.html":[15,0,4], -"dir_4991c92e00761dd3d764efa2906b4318.html":[15,0,12,9], -"dir_4a15c8553efb9e59e3f1091cc0d3a27d.html":[15,0,12,21], -"dir_4b6f782e158b0b98da980a0e11a23a15.html":[15,0,5], -"dir_4bae997a2671812c2140d5abfb6305a4.html":[15,0,12,20], -"dir_607f15d36c772334f988bb9ef82d102c.html":[15,0,12,18], -"dir_72aaf47615111200018c039a56ef48be.html":[15,0,8], -"dir_7445e5a68245b48f3c03982b6d501815.html":[15,0,2,2], -"dir_76784a7b04633629b9ecb5543b9ad889.html":[15,0,4,2], -"dir_81f43aa0067826ea5befe80cd7aefcc5.html":[15,0,4,3], -"dir_8c6743d405e8ed13cc39f42e382307fd.html":[15,0,12,0], -"dir_955029374964e51cf770754b424e7d39.html":[15,0,2,5], -"dir_9babc524d57e25f3d9f4179cabc3599e.html":[15,0,1], -"dir_9c6faab82c22511b50177aa2e38e2780.html":[15,0,11], -"dir_a52f4d3d586a58b02f3a4ddf0a992157.html":[15,0,10], -"dir_aba97bf327db94061e830e9bc18e925d.html":[15,0,12,4], -"dir_abf1a26ece768c4076e73592705ae077.html":[15,0,3], -"dir_b2dbfa46230fd9f775c32c1836ed3764.html":[15,0,12,15], -"dir_b3d331eabd4234f247030c297aaf021c.html":[15,0,12], -"dir_b6018f60d424a2ef7e4c942ac681e38b.html":[15,0,2,7], -"dir_bb1b521853a9c46347182a9d10420771.html":[15,0,14], -"dir_bd4a7dd282074645ef41b1ea31ac813a.html":[15,0,2,3], -"dir_c7ef0fcb2f2095a74f0a3a1634dfc798.html":[15,0,2,0], -"dir_d20ad0b8de644c123692ba5582cc7a7b.html":[15,0,0], -"dir_d4c35186c199e728d69dee6bf5b2473c.html":[15,0,12,22], -"dir_d9112ab06cf4d4e5a25d385a268d1949.html":[15,0,12,2], -"dir_d9e100c82ada2163abea49688a71e81c.html":[15,0,12,10], -"dir_da574daf9ce9c05b45556bdc871ed1e3.html":[15,0,13], -"dir_e3380d2178455503f266746fb14246a5.html":[15,0,6], -"dir_e39df94f82619fa5256f1786519937be.html":[15,0,2,1], -"dir_e79632891301b850df87e9c0030293fa.html":[15,0,7], -"dir_eeeea13e3a5e5edad3499183767ce312.html":[15,0,12,8], -"dir_f75ccd45e00436eafed446b9b2682984.html":[15,0,12,12], -"dir_f7d3c03fcac84aef1b0c66cc497ed1ea.html":[15,0,12,3], -"dir_fe5d69ed7d90cb356556070c2a2e5478.html":[15,0,4,0], +"df/d83/selection__sort_8c.html":[15,0,16,9], +"df/d83/selection__sort_8c.html#aa8dca7b867074164d5f45b0f3851269d":[15,0,16,9,3], +"df/d83/selection__sort_8c.html#ac0f2228420376f4db7e1274f2b41667c":[15,0,16,9,0], +"df/d83/selection__sort_8c.html#ad126fa7239be97373c96861adc70b1d3":[15,0,16,9,2], +"df/d83/selection__sort_8c.html#aeafe7419cfceaeccaf49f22842d9a617":[15,0,16,9,1], +"df/d86/structterm.html":[14,0,38], +"df/d86/structterm.html#a057f161d279d856d11786aa96fc87f74":[14,0,38,2], +"df/d86/structterm.html#a5a730814391f70179da78c657e6e6f7b":[14,0,38,0], +"df/d86/structterm.html#ab7ac49a58cc431c9838c855bf59a243a":[14,0,38,1], +"df/d98/quaternions_8c.html":[15,0,7,1], +"df/da5/problem__9_2sol1_8c.html":[15,0,14,22,0], +"df/da5/problem__9_2sol1_8c.html#a840291bc02cba5474a4cb46a9b9566fe":[15,0,14,22,0,0], +"df/db3/struct_l.html":[14,0,20], +"df/dc6/acronym_8h_source.html":[15,0,5,0,0], +"df/ddb/structword__count__word.html":[14,0,42], +"df/dea/structdata.html":[14,0,9], +"df/df3/union__find_8c.html":[15,0,12,12], +"df/df3/union__find_8c.html#a0592dba56693fad79136250c11e5a7fe":[15,0,12,12,0], +"df/df3/union__find_8c.html#a3e13b69cce5a1b25ae034798092f3d86":[15,0,12,12,1], +"df/df3/union__find_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[15,0,12,12,3], +"df/df3/union__find_8c.html#af2f3ff6d98641f7d3be11f071c97908a":[15,0,12,12,2], +"dir_0472225043064b54f3dfff9011a9fae0.html":[15,0,3,9,0], +"dir_079e1f799fb08a8a0b98cb030ab15687.html":[15,0,14,13], +"dir_0bc3e2a5baf077fa21dadc079776fcac.html":[15,0,14,7], +"dir_167af11096b7752ff31b3d4bec489317.html":[15,0,14,19], +"dir_16b947d8e9a05fe119d0675493324331.html":[15,0,14,1], +"dir_16e00c78ef36d1842d0d8a4afc46b852.html":[15,0,14,14], +"dir_1833eb69ceee7a265ffba4c38c8243d2.html":[15,0,14,16], +"dir_18cba55772148686552805a354a79093.html":[15,0,14,6], +"dir_2176ba3565d8b1fe2a106d18679cc7bf.html":[15,0,3,9], +"dir_261dd1200fad5b2fe1eca9af8320656e.html":[15,0,3,6], +"dir_2abe2c0880d3fb0dba0f784bee3fc9e0.html":[15,0,14,11], +"dir_2b14f32f14b51065d3a322bea21da3c0.html":[15,0,14,5], +"dir_2e746e9d06bf2d8ff842208bcc6ebcfc.html":[15,0,3], +"dir_2f070f19f76dfadabbc24fe483d7e98d.html":[15,0,14,17], +"dir_2fede762f95c9c526850a639b984c56b.html":[15,0,3,4], +"dir_3343723ae086de42ee4ca9774da3a13f.html":[15,0,11], +"dir_4500de955d1eddb82f69331d96e39ed9.html":[15,0,5,1], +"dir_475f56e0a4ef6254f5610544d8d68aa3.html":[15,0,5,4], +"dir_48bf5503321d91c557399989fed5dabd.html":[15,0,5], +"dir_4991c92e00761dd3d764efa2906b4318.html":[15,0,14,9], +"dir_4a15c8553efb9e59e3f1091cc0d3a27d.html":[15,0,14,21], +"dir_4b6f782e158b0b98da980a0e11a23a15.html":[15,0,6], +"dir_4bae997a2671812c2140d5abfb6305a4.html":[15,0,14,20], +"dir_607f15d36c772334f988bb9ef82d102c.html":[15,0,14,18], +"dir_72aaf47615111200018c039a56ef48be.html":[15,0,10], +"dir_7445e5a68245b48f3c03982b6d501815.html":[15,0,3,2], +"dir_76784a7b04633629b9ecb5543b9ad889.html":[15,0,5,2], +"dir_81f43aa0067826ea5befe80cd7aefcc5.html":[15,0,5,3], +"dir_8c6743d405e8ed13cc39f42e382307fd.html":[15,0,14,0], +"dir_955029374964e51cf770754b424e7d39.html":[15,0,3,5], +"dir_9babc524d57e25f3d9f4179cabc3599e.html":[15,0,2], +"dir_9c6faab82c22511b50177aa2e38e2780.html":[15,0,13], +"dir_a4300992e825aa9b9238bf43160a241e.html":[15,0,9], +"dir_a52f4d3d586a58b02f3a4ddf0a992157.html":[15,0,12], +"dir_a5f32cf82ad289a7dac212f63f40f55b.html":[15,0,0], +"dir_aba97bf327db94061e830e9bc18e925d.html":[15,0,14,4], +"dir_abf1a26ece768c4076e73592705ae077.html":[15,0,4], +"dir_b2dbfa46230fd9f775c32c1836ed3764.html":[15,0,14,15], +"dir_b3d331eabd4234f247030c297aaf021c.html":[15,0,14], +"dir_b6018f60d424a2ef7e4c942ac681e38b.html":[15,0,3,7], +"dir_bb1b521853a9c46347182a9d10420771.html":[15,0,16], +"dir_bd4a7dd282074645ef41b1ea31ac813a.html":[15,0,3,3], +"dir_c7ef0fcb2f2095a74f0a3a1634dfc798.html":[15,0,3,0], +"dir_d20ad0b8de644c123692ba5582cc7a7b.html":[15,0,1], +"dir_d4c35186c199e728d69dee6bf5b2473c.html":[15,0,14,22], +"dir_d9112ab06cf4d4e5a25d385a268d1949.html":[15,0,14,2], +"dir_d9e100c82ada2163abea49688a71e81c.html":[15,0,14,10], +"dir_da574daf9ce9c05b45556bdc871ed1e3.html":[15,0,15], +"dir_e3380d2178455503f266746fb14246a5.html":[15,0,7], +"dir_e39df94f82619fa5256f1786519937be.html":[15,0,3,1], +"dir_e79632891301b850df87e9c0030293fa.html":[15,0,8], +"dir_eeeea13e3a5e5edad3499183767ce312.html":[15,0,14,8], +"dir_f75ccd45e00436eafed446b9b2682984.html":[15,0,14,12], +"dir_f7d3c03fcac84aef1b0c66cc497ed1ea.html":[15,0,14,3], +"dir_fb09f588f9daea69f78b63a0310e98cc.html":[15,0,3,8], +"dir_fe5d69ed7d90cb356556070c2a2e5478.html":[15,0,5,0], "files.html":[15,0], "functions.html":[14,2,0], "functions_vars.html":[14,2,1], -"globals.html":[15,1,0], "globals.html":[15,1,0,0], +"globals.html":[15,1,0], "globals_a.html":[15,1,0,1], "globals_b.html":[15,1,0,2], "globals_c.html":[15,1,0,3], @@ -230,8 +164,8 @@ var NAVTREEINDEX3 = "globals_defs.html":[15,1,4], "globals_e.html":[15,1,0,5], "globals_f.html":[15,1,0,6], -"globals_func.html":[15,1,1,0], "globals_func.html":[15,1,1], +"globals_func.html":[15,1,1,0], "globals_func_a.html":[15,1,1,1], "globals_func_b.html":[15,1,1,2], "globals_func_c.html":[15,1,1,3], @@ -249,5 +183,39 @@ var NAVTREEINDEX3 = "globals_func_o.html":[15,1,1,15], "globals_func_p.html":[15,1,1,16], "globals_func_q.html":[15,1,1,17], -"globals_func_r.html":[15,1,1,18] +"globals_func_r.html":[15,1,1,18], +"globals_func_s.html":[15,1,1,19], +"globals_func_t.html":[15,1,1,20], +"globals_func_u.html":[15,1,1,21], +"globals_func_v.html":[15,1,1,22], +"globals_func_w.html":[15,1,1,23], +"globals_func_x.html":[15,1,1,24], +"globals_g.html":[15,1,0,7], +"globals_h.html":[15,1,0,8], +"globals_i.html":[15,1,0,9], +"globals_j.html":[15,1,0,10], +"globals_k.html":[15,1,0,11], +"globals_l.html":[15,1,0,12], +"globals_m.html":[15,1,0,13], +"globals_n.html":[15,1,0,14], +"globals_o.html":[15,1,0,15], +"globals_p.html":[15,1,0,16], +"globals_q.html":[15,1,0,17], +"globals_r.html":[15,1,0,18], +"globals_s.html":[15,1,0,19], +"globals_t.html":[15,1,0,20], +"globals_type.html":[15,1,3], +"globals_u.html":[15,1,0,21], +"globals_v.html":[15,1,0,22], +"globals_vars.html":[15,1,2], +"globals_w.html":[15,1,0,23], +"globals_x.html":[15,1,0,24], +"index.html":[], +"index.html":[0], +"index.html#autotoc_md63":[0,0], +"index.html#autotoc_md64":[0,1], +"index.html#autotoc_md65":[0,2], +"index.html#autotoc_md66":[0,3], +"modules.html":[13], +"pages.html":[] }; diff --git a/pages.html b/pages.html index ad4e756d1..c622f6803 100644 --- a/pages.html +++ b/pages.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C: Related Pages @@ -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('pages.html',''); initResizable(); });
    -
    -
    Related Pages
    +
    Related Pages
    Here is a list of all related documentation pages:
    @@ -103,7 +102,7 @@ $(document).ready(function(){initNavTree('pages.html',''); initResizable(); });  Dictionary  Simple generic Stack  List of all files - Sample solutions for <a href="http://exercism.io/">exercism.io</a> + Sample solutions for <a href="http://exercism.io/" target="_blank" >exercism.io</a>  Hash algorithms  LeetCode  ProjectEuler @@ -115,7 +114,7 @@ $(document).ready(function(){initNavTree('pages.html',''); initResizable(); }); diff --git a/resize.js b/resize.js index e1ad0fe3b..7fe30d10b 100644 --- a/resize.js +++ b/resize.js @@ -53,7 +53,7 @@ function initResizable() date.setTime(date.getTime()+(10*365*24*60*60*1000)); // default expiration is one week expiration = date.toGMTString(); } - document.cookie = cookie_namespace + "_" + cookie + "=" + val + "; expires=" + expiration+"; path=/"; + document.cookie = cookie_namespace + "_" + cookie + "=" + val + "; SameSite=Lax; expires=" + expiration+"; path=/"; } function resizeWidth() @@ -75,10 +75,20 @@ function initResizable() { var headerHeight = header.outerHeight(); var footerHeight = footer.outerHeight(); - var windowHeight = $(window).height() - headerHeight - footerHeight; - content.css({height:windowHeight + "px"}); - navtree.css({height:windowHeight + "px"}); - sidenav.css({height:windowHeight + "px"}); + var windowHeight = $(window).height(); + var contentHeight,navtreeHeight,sideNavHeight; + if (typeof page_layout==='undefined' || page_layout==0) { /* DISABLE_INDEX=NO */ + contentHeight = windowHeight - headerHeight - footerHeight; + navtreeHeight = contentHeight; + sideNavHeight = contentHeight; + } else if (page_layout==1) { /* DISABLE_INDEX=YES */ + contentHeight = windowHeight - footerHeight; + navtreeHeight = windowHeight - headerHeight; + sideNavHeight = windowHeight; + } + content.css({height:contentHeight + "px"}); + navtree.css({height:navtreeHeight + "px"}); + sidenav.css({height:sideNavHeight + "px"}); var width=$(window).width(); if (width!=collapsedWidth) { if (width=desktop_vp) { diff --git a/search/all_0.html b/search/all_0.html index 1ec5b2d59..65f85b5b7 100644 --- a/search/all_0.html +++ b/search/all_0.html @@ -2,7 +2,7 @@ - + @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/search/defines_a.js b/search/defines_a.js new file mode 100644 index 000000000..c551c8220 --- /dev/null +++ b/search/defines_a.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['sa_0',['SA',['../dd/d93/client_8c.html#a1e43924adac4ae865aa0acf79710261c',1,'SA(): client.c'],['../d1/d20/server_8c.html#a1e43924adac4ae865aa0acf79710261c',1,'SA(): server.c']]] +]; diff --git a/search/files_0.html b/search/files_0.html index 9498842a6..e2840840d 100644 --- a/search/files_0.html +++ b/search/files_0.html @@ -2,7 +2,7 @@ - + @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/search/files_15.js b/search/files_15.js new file mode 100644 index 000000000..7eae6a9cf --- /dev/null +++ b/search/files_15.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['vectors_5f3d_2ec_0',['vectors_3d.c',['../d5/db8/vectors__3d_8c.html',1,'']]] +]; diff --git a/search/files_16.html b/search/files_16.html new file mode 100644 index 000000000..59e789c8e --- /dev/null +++ b/search/files_16.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/search/files_16.js b/search/files_16.js new file mode 100644 index 000000000..8bcdef3c5 --- /dev/null +++ b/search/files_16.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['words_5falphabetical_2ec_0',['words_alphabetical.c',['../d3/d78/words__alphabetical_8c.html',1,'']]] +]; diff --git a/search/files_2.html b/search/files_2.html index 497cdf5c7..7a0a2e17d 100644 --- a/search/files_2.html +++ b/search/files_2.html @@ -2,7 +2,7 @@ - + @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/search/functions_18.js b/search/functions_18.js new file mode 100644 index 000000000..b86209cba --- /dev/null +++ b/search/functions_18.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['xor8_0',['xor8',['../d7/d3b/group__hash.html#gae4836b42b998b336298f3b19dcc9cdeb',1,'hash_xor8.c']]] +]; diff --git a/search/functions_2.html b/search/functions_2.html index ca5aa10e6..43aea5367 100644 --- a/search/functions_2.html +++ b/search/functions_2.html @@ -2,7 +2,7 @@ - + @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches
    @@ -12,14 +12,14 @@
    Loading...
    Searching...
    No Matches