Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ New SiDB simulator QuickExact and simulation of atomic defects. #203

Merged
merged 389 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
389 commits
Select commit Hold shift + click to select a range
99c93d5
:art: ClangFormat changes
Apr 25, 2023
2487fc5
Merge remote-tracking branch 'origin/sidb_temperature_simulation' int…
Drewniok Apr 25, 2023
e5a6354
:art: copy enum class to try to solve window build issue.
Drewniok Apr 25, 2023
41a3bd8
:art: tiny change in docu.
Drewniok Apr 25, 2023
7109965
:art: ClangFormat changes
Apr 25, 2023
6703758
:twisted_rightwards_arrows: merge.
Drewniok Apr 25, 2023
926dd95
:art: ClangFormat changes
Apr 25, 2023
016f682
Merge branch 'main' into fast_three_state
Drewniok Apr 26, 2023
0dca9cf
Merge branch 'marcelwa:main' into main
Drewniok Apr 26, 2023
79025b5
Merge branch 'main' into fast_three_state
Drewniok Apr 26, 2023
e824429
:fire: remove file from git.
Drewniok Apr 26, 2023
0286d6e
:white_check_mark: add additional test.
Drewniok Apr 26, 2023
072e5ff
:bug: add ``recompute_energy`` and test which failed before.
Drewniok Apr 26, 2023
ff785b1
:art: change to scoped enumerator.
Drewniok Apr 26, 2023
e67ed41
:art: ClangFormat changes
Apr 26, 2023
ab1497b
:art: use enum struct.
Drewniok Apr 26, 2023
14e2946
Merge remote-tracking branch 'origin/sidb_temperature_simulation' int…
Drewniok Apr 26, 2023
e173661
:fire: remove ``enum class``due to windows CI issue.
Drewniok Apr 26, 2023
1d7534d
:art: ClangFormat changes
Apr 26, 2023
c240099
:art: replace reference.
Drewniok Apr 26, 2023
a5ab4a5
Merge remote-tracking branch 'origin/sidb_temperature_simulation' int…
Drewniok Apr 26, 2023
5b41713
:sparkles: code to generate unique random layouts.
Drewniok Apr 26, 2023
69f3119
:sparkles: Temperature-aware simulation can be conducted with ``exgs`…
Drewniok Apr 27, 2023
efa5e46
:art: ClangFormat changes
Apr 27, 2023
f63d9cf
:art: rename struct member.
Drewniok Apr 27, 2023
1f6f0b6
:art: activate automatic state count detection.
Drewniok Apr 27, 2023
c583c68
Merge branch 'main' into sidb_temperature_simulation
Drewniok May 1, 2023
582554d
:art: update after review (main change: replace stats_pointer as inpu…
Drewniok May 1, 2023
ebf7925
Merge branch 'main' into sidb_temperature_simulation
Drewniok May 1, 2023
ce8b2e2
Merge branch 'marcelwa:main' into main
Drewniok May 1, 2023
40b4f77
:art: ClangFormat changes
May 1, 2023
b3c886d
:art: introduce impl_class for quickexact.
Drewniok May 2, 2023
88815fc
:twisted_rightwards_arrows: merge ``sidb_temperature_simulation`` in …
Drewniok May 2, 2023
fb734f2
:art: remove ``const``keyword.
Drewniok May 2, 2023
cbb9a41
Merge branch 'temperature_simulation_fetched' into fast_three_state
Drewniok May 2, 2023
e741662
:art: add ``const``keyword.
Drewniok May 3, 2023
0361150
Merge branch 'temperature_simulation_fetched' into fast_three_state
Drewniok May 3, 2023
5dcdd73
:art: split in several smaller functions.
Drewniok May 3, 2023
a948f76
:art: rename some functions.
Drewniok May 3, 2023
e1d14b8
:memo: add docu.
Drewniok May 3, 2023
3c7c91e
:sparkles: automatic base number detection can be turned ``on`` and `…
Drewniok May 4, 2023
cc7b8d8
:memo: add more documentation.
Drewniok May 4, 2023
d5872de
:fire: remove files to shift it to separate PR.
Drewniok May 4, 2023
ea5f152
:art: change order of ``const``keyword and type.
Drewniok May 4, 2023
767eb31
Merge branch 'temperature_simulation_fetched' into fast_three_state
Drewniok May 4, 2023
bb69495
:memo: add RST.
Drewniok May 4, 2023
a553966
:memo: add documentation.
Drewniok May 5, 2023
9135e60
:green_heart: add ``const`` keyword.
Drewniok May 5, 2023
853fbfe
:art: smaller changes to try to fix test issue.
Drewniok May 5, 2023
915a90f
:white_check_mark: small change to avoid windows issue.
Drewniok May 5, 2023
862e716
:memo: add documentation.
Drewniok May 5, 2023
bd077aa
:memo: add documentation.
Drewniok May 10, 2023
a00c212
Merge branch 'main' into fast_three_state
Drewniok May 10, 2023
64501c1
Merge branch 'marcelwa:main' into main
Drewniok May 10, 2023
b9656d9
Merge branch 'main' into fast_three_state
Drewniok May 10, 2023
68f6885
Merge branch 'marcelwa:main' into main
Drewniok May 11, 2023
84634cd
Merge branch 'marcelwa:main' into main
Drewniok May 12, 2023
441dce3
Merge branch 'main' into fast_three_state
Drewniok May 12, 2023
f44157d
:twisted_rightwards_arrows: merge with temperature-branch.
Drewniok May 12, 2023
c677422
:art: small changes here and there (documentation, remove header, etc.)
Drewniok May 12, 2023
597b1a7
Merge branch 'marcelwa:main' into main
Drewniok May 12, 2023
6481a84
Merge branch 'main' into fast_three_state
Drewniok May 12, 2023
c96be08
:fire: remove additional function.
Drewniok May 14, 2023
1920794
Merge branch 'marcelwa:main' into main
Drewniok May 14, 2023
70e64c9
Merge remote-tracking branch 'origin/fast_three_state' into fast_thre…
Drewniok May 14, 2023
4f2b0e6
Merge branch 'main' into fast_three_state
Drewniok May 14, 2023
c242f9b
:art: reformat code.
Drewniok May 15, 2023
69fa1e8
:art: add equal sign.
Drewniok May 15, 2023
a785434
:art: clang-tidy suggestions.
Drewniok May 15, 2023
5d74ac6
Merge branch 'marcelwa:main' into main
Drewniok May 21, 2023
f408962
Merge branch 'marcelwa:main' into main
Drewniok May 24, 2023
b4138de
Merge branch 'marcelwa:main' into main
Drewniok May 25, 2023
930fcf2
Merge branch 'marcelwa:main' into main
Drewniok Jun 5, 2023
8fc1e3b
Merge branch 'main' into fast_three_state
Drewniok Jun 5, 2023
e125f27
:art: fix a few typo.
Drewniok Jun 5, 2023
f678e40
:art: renaming and put ``stats`` as last.
Drewniok Jun 6, 2023
4e38871
:art: implement Marcel's first comments.
Drewniok Jun 6, 2023
58566ee
:art: add enum classes to make use of functions friendlier.
Drewniok Jun 6, 2023
83ed772
:art: add enum class for both exhaustive simulators.
Drewniok Jun 6, 2023
2cdc9ed
:fire: remove ``this``.
Drewniok Jun 6, 2023
021df7a
:art: only one enum class in enum_class_exhaustive_algorithm.hpp
Drewniok Jun 6, 2023
d818c3f
:art: simulation_result is added as an attribute.
Drewniok Jun 6, 2023
3fc0726
:art: replace keyword ``set`` by ``assign`` to be consistent.
Drewniok Jun 6, 2023
c97b019
:art: take order of member function from the ``pyml`` branch.
Drewniok Jun 6, 2023
cbd8345
Merge branch 'marcelwa:main' into main
Drewniok Jun 7, 2023
7edd877
:sparkles: add the equality and inequality operator.
Drewniok Jun 7, 2023
475b1c8
:white_check_mark: add test for the equality and inequality operator.
Drewniok Jun 7, 2023
8556973
:art: use ``sidb_surface`` to store defects.
Drewniok Jun 7, 2023
2147968
Merge branch 'main' into fast_three_state
Drewniok Jun 7, 2023
2903532
Merge branch 'marcelwa:main' into main
Drewniok Jun 12, 2023
f70ceb6
Merge branch 'marcelwa:main' into main
Drewniok Jun 14, 2023
0932c41
:art: add test.
Drewniok Jun 14, 2023
24ff3a7
Merge branch 'marcelwa:main' into main
Drewniok Jun 16, 2023
aff9b24
Merge branch 'main' into fast_three_state
Drewniok Jun 16, 2023
e00269f
:art: reformat code.
Drewniok Jun 16, 2023
a4f3150
Merge branch 'marcelwa:main' into main
Drewniok Jun 19, 2023
5c94467
Merge branch 'main' into fast_three_state
Drewniok Jun 19, 2023
9b7f0a3
:bug: correct wrong unit test.
Drewniok Jun 19, 2023
3c2add8
:art: change unit test.
Drewniok Jun 19, 2023
7c58497
:sparkles: added avoidance distance simulation.
Drewniok Jun 22, 2023
fbed04c
:sparkles: bounding box for siqad layout.
Drewniok Jun 22, 2023
0138858
:sparkles: function to determine the defect influence distance.
Drewniok Jun 22, 2023
9c78984
Merge branch 'marcelwa:main' into main
Drewniok Jun 23, 2023
90414a0
:art: more defect places added.
Drewniok Jun 23, 2023
0a48161
:art: sort sidbs in the charge distribution surface at the initializa…
Drewniok Jun 26, 2023
82661ba
:art: add parameter struct.
Drewniok Jun 26, 2023
1f2fdce
:white_check_mark: add tests for the defect_influence_distance function.
Drewniok Jun 26, 2023
d489dd9
:art: add new type.
Drewniok Jun 26, 2023
cf7367a
Merge branch 'main' into fast_three_state
Drewniok Jun 26, 2023
420679e
:bug: add WithinAbs in unit test.
Drewniok Jun 26, 2023
66688c6
:bug: delete Check for negative indices.
Drewniok Jun 26, 2023
67a32fc
:bug: small bug fix.
Drewniok Jun 27, 2023
adb3c63
:bug: add previously deleted cells to layout.
Drewniok Jun 27, 2023
c3f4e96
Merge branch 'marcelwa:main' into main
Drewniok Jun 28, 2023
853be74
Merge branch 'cda-tum:main' into main
Drewniok Jul 5, 2023
13eab3c
Merge branch 'cda-tum:main' into main
Drewniok Jul 10, 2023
205291b
:sparkles: Multithreading for defect avoidance simulation.
Drewniok Jul 14, 2023
7a9def6
:art: add lambda caption.
Drewniok Jul 18, 2023
1c59a58
Merge branch 'cda-tum:main' into main
Drewniok Jul 18, 2023
1f87c22
Merge branch 'cda-tum:main' into main
Drewniok Jul 20, 2023
e308ef8
Merge branch 'main' into fast_three_state
Drewniok Jul 20, 2023
ae6888b
:twisted_rightwards_arrows: merge ``main``. Unit library is new.
Drewniok Jul 21, 2023
b5e1da6
:art: adapting code for unit library.
Drewniok Jul 21, 2023
6bd8335
:art: adapt sidb defects to unit library.
Drewniok Jul 21, 2023
29a69f2
:art: adapt sidb defects to unit library.
Drewniok Jul 21, 2023
5c73a57
Merge branch 'defect_unit_library' into fast_three_state
Drewniok Jul 21, 2023
74e8928
:art: implement unit library to code.
Drewniok Jul 21, 2023
dc55796
:art: implement unit library to code.
Drewniok Jul 21, 2023
d300bc1
Merge branch 'cda-tum:main' into main
Drewniok Jul 24, 2023
c45aa99
:art: integrate unit library.
Drewniok Jul 24, 2023
9a328fa
Merge branch 'main' into fast_three_state
Drewniok Jul 24, 2023
af76e19
:art: all unit test run successfully.
Drewniok Jul 24, 2023
5cb20c7
:art: small changes, trying to improve performance.
Drewniok Jul 24, 2023
2dc75ac
Merge branch 'cda-tum:main' into main
Drewniok Jul 25, 2023
2f6990e
:heavy_minus_sign: Remove ``unit`` library due to increasing simulati…
Drewniok Jul 25, 2023
ce63b2d
:art: implement Marcel's suggestions.
Drewniok Jul 25, 2023
ab73daa
Merge branch 'main' into remove_unit_library
Drewniok Jul 25, 2023
0cb32e2
:white_check_mark: add a few more tests.
Drewniok Jul 25, 2023
cbf75c2
Merge branch 'main' into fast_three_state
Drewniok Jul 26, 2023
9fc5819
Merge branch 'cda-tum:main' into main
Drewniok Jul 26, 2023
8d58695
Merge branch 'main' into remove_unit_library
Drewniok Jul 26, 2023
2f8650a
:white_check_mark: add a few more tests.
Drewniok Jul 26, 2023
cbfd028
Merge branch 'remove_unit_library' into fast_three_state
Drewniok Jul 26, 2023
6f5e9be
:white_check_mark: remove ``unit library``.
Drewniok Jul 26, 2023
97123ba
:memo: more documentation (add physical unit information).
Drewniok Jul 26, 2023
bd5cfc3
Merge branch 'cda-tum:main' into main
Drewniok Jul 26, 2023
22d93da
:memo: add docu.
Drewniok Jul 26, 2023
4421776
:white_check_mark: All tests run successfully.
Drewniok Jul 26, 2023
2d54ba6
Merge branch 'main' into fast_three_state
Drewniok Jul 26, 2023
b331e1f
:bug: add time_to_solution unit test again, issue caused by github me…
Drewniok Jul 26, 2023
51b93cb
Merge branch 'cda-tum:main' into main
Drewniok Jul 26, 2023
f6a98f3
:art: remove redundant unit test case.
Drewniok Jul 26, 2023
fda1125
Merge branch 'main' into fast_three_state
Drewniok Jul 26, 2023
7983d54
:art: change ``CHECK`` for defect position due to symmetry.
Drewniok Jul 26, 2023
8dcfe25
:bug: wrong cell where ``get_local_potential`` is applied.
Drewniok Jul 26, 2023
163fa00
:art: reformat code.
Drewniok Jul 26, 2023
f1ec086
:white_check_mark: add unit test.
Drewniok Jul 26, 2023
66b2d19
:art: Structural improvements and consistency fixes for the code of t…
marcelwa Jul 31, 2023
9fc79a9
Merge remote-tracking branch 'origin/fast_three_state' into fast_thre…
Drewniok Aug 2, 2023
5727ac6
:art: rename function.
Drewniok Aug 3, 2023
751369c
Merge branch 'cda-tum:main' into main
Drewniok Aug 3, 2023
d9193e3
Merge branch 'main' into fast_three_state
Drewniok Aug 3, 2023
eb12b2a
:twisted_rightwards_arrows: merge ``main``.
Drewniok Aug 3, 2023
1659e4f
:white_check_mark: add more unit tests.
Drewniok Aug 4, 2023
9f909c9
:white_check_mark: add more unit tests to cover different physical pa…
Drewniok Aug 4, 2023
af9f06d
:art: delete redundant line of code.
Drewniok Aug 9, 2023
311339b
Merge branch 'cda-tum:main' into main
Drewniok Aug 10, 2023
8c9d164
:sparkles: function to determine whether positive charges can occur i…
Drewniok Aug 12, 2023
16c12e4
Merge branch 'cda-tum:main' into main
Drewniok Aug 27, 2023
7bf37f3
:art: add pre-mature break.
Drewniok Aug 27, 2023
5953198
:sparkles: finish function to detect if SiDBs can be positively charged.
Drewniok Aug 28, 2023
a4854ac
:art: more generic description.
Drewniok Aug 28, 2023
668ad34
:art: code cleaning.
Drewniok Aug 28, 2023
113e48a
:art: code cleanup.
Drewniok Aug 28, 2023
2371a61
:art: code cleanup.
Drewniok Aug 28, 2023
0054e36
:white_check_mark: correct bug in test.
Drewniok Aug 28, 2023
1b3a00a
:art: if statement over several statements.
Drewniok Aug 28, 2023
1b492d4
:bug: Wrong cell whose local potential is accessed.
Drewniok Aug 29, 2023
4ee06d4
:bug: remove runtime test due to issues in debug mode.
Drewniok Aug 29, 2023
2d85997
Merge branch 'main' into fast_three_state
Drewniok Aug 29, 2023
b11c732
:art: delete cout.
Drewniok Aug 29, 2023
9f4426b
Merge branch 'cda-tum:main' into main
Drewniok Aug 29, 2023
fb5701b
Merge branch 'main' into fast_three_state
Drewniok Aug 29, 2023
9c84a29
:bug: make sure that defects, if any, are included in the simulation …
Drewniok Aug 29, 2023
1e99837
:white_check_mark: add test to check if defects are included in the s…
Drewniok Aug 29, 2023
6eccd58
Merge branch 'cda-tum:main' into main
Drewniok Aug 30, 2023
00e7add
:white_check_mark: Gray code iterator to iterate from a start integer…
Drewniok Aug 30, 2023
5974af0
Merge branch 'main' into fast_three_state
Drewniok Aug 30, 2023
05d81af
:memo: add docu.
Drewniok Aug 30, 2023
da9342e
:art: add postfix increment operator.
Drewniok Aug 30, 2023
198abda
:art: remove ambiguous operators.
Drewniok Aug 30, 2023
fcf197e
:art: use ``QuickExact`` for temperature simulation.
Drewniok Aug 30, 2023
77206e9
:art: implement suggestions and add docu.
Drewniok Aug 30, 2023
918b755
Merge branch 'cda-tum:main' into main
Drewniok Aug 30, 2023
42fd13e
:art: implement suggestions.
Drewniok Aug 30, 2023
44b1769
:art: use pair for additional_scanning_area.
Drewniok Aug 30, 2023
9718746
Merge branch 'main' into fast_three_state
Drewniok Aug 30, 2023
380180a
:art: remove unnecessary ``if`` statement and add tests.
Drewniok Aug 30, 2023
31a7327
:art: add atomic header.
Drewniok Aug 31, 2023
812fca8
:art: remove atomic again.
Drewniok Aug 31, 2023
1a6b74c
:art: wrong data type.
Drewniok Aug 31, 2023
66b2ce3
:memo: add more docu.
Drewniok Aug 31, 2023
0d0a001
:white_check_mark: add test.
Drewniok Aug 31, 2023
ed016bc
:white_check_mark: implement ``clang-tidy``.
Drewniok Sep 1, 2023
fc06e61
:white_check_mark: add more test.
Drewniok Sep 1, 2023
89bc9ae
Merge branch 'cda-tum:main' into main
Drewniok Sep 1, 2023
081cc0a
Merge branch 'main' into fast_three_state
Drewniok Sep 1, 2023
8ee67bc
:art: implement ``clang-tidy`` suggestions.
Drewniok Sep 1, 2023
7c7b6f0
:white_check_mark: add more tests.
Drewniok Sep 3, 2023
d3d6649
:bug: wrong function call.
Drewniok Sep 3, 2023
01c3df2
:white_check_mark: add more tests.
Drewniok Sep 4, 2023
dde48d3
:white_check_mark: add more test.
Drewniok Sep 4, 2023
b85f1d5
:art: add test and fix inconsistency.
Drewniok Sep 5, 2023
64c4862
Merge branch 'cda-tum:main' into main
Drewniok Sep 5, 2023
89e4168
Merge branch 'main' into fast_three_state
Drewniok Sep 5, 2023
ec29d9c
Merge branch 'main' into fast_three_state
marcelwa Sep 5, 2023
5c4b856
Merge branch 'main' into fast_three_state
Drewniok Sep 5, 2023
c7fab2b
:art: split ``maximal_defect_influence_distance`` into smaller functi…
Drewniok Sep 5, 2023
c06bf45
:memo: add ``maximal_defect_influence_distance`` to docu.
Drewniok Sep 5, 2023
b8bd848
:art: replace wrong function and add unit test.
Drewniok Sep 5, 2023
62ceedb
:memo: update docu.
Drewniok Sep 5, 2023
e01ec80
Merge branch 'main' into fast_three_state
Drewniok Sep 5, 2023
4817da7
:art: reformat code, simplify code, and add more unit tests.
Drewniok Sep 6, 2023
45cdcfd
Merge branch 'main' into fast_three_state
Drewniok Sep 6, 2023
9f01017
:art: solve ``bitwise '|' with boolean operands`` warning.
Drewniok Sep 6, 2023
f9d37af
:art: compare float with ``CHECK_THAT``.
Drewniok Sep 6, 2023
593acfd
:art: fix inconsistency.
Drewniok Sep 6, 2023
9d45e28
:art: fix inconsistency and add test.
Drewniok Sep 6, 2023
799632e
:art: fix inconsistency.
Drewniok Sep 6, 2023
606f338
:art: reformat code.
Drewniok Sep 6, 2023
72b35c6
:art: reformat code.
Drewniok Sep 6, 2023
00477b3
:art: implement Marcel's suggestions.
Drewniok Sep 7, 2023
cb0810a
:art: implement Marcel's suggestions and reformat code.
Drewniok Sep 7, 2023
45f332b
:art: implement Marcel's suggestions and reformat code.
Drewniok Sep 7, 2023
547099a
:art: implement Marcel's suggestions and reformat code.
Drewniok Sep 7, 2023
a48ee60
:art: implement Marcel's suggestions and reformat code.
Drewniok Sep 7, 2023
e8d666a
:art: rename ``maximal`` to ``maximum``.
Drewniok Sep 7, 2023
b9d440f
:memo: rename ``maximal`` to ``maximum``.
Drewniok Sep 7, 2023
ab4e79d
:art: implement ``clang-tidy``suggestions and use ``std::for_each`` i…
Drewniok Sep 7, 2023
4dd833c
:art: reformat code.
Drewniok Sep 7, 2023
1b9a27e
Merge branch 'main' into fast_three_state
Drewniok Sep 8, 2023
faeb076
:art: implement cppcheck warnings.
Drewniok Sep 8, 2023
334990d
:art: implement Marcel's suggestions.
Drewniok Sep 8, 2023
99a8fc0
Merge branch 'main' into fast_three_state
Drewniok Sep 8, 2023
5ef8fb1
:art: update sidb_simulation.rst
Drewniok Sep 8, 2023
8764fe9
:art: use template again.
Drewniok Sep 8, 2023
540ca1e
:art: implement clang-tidy suggestions.
Drewniok Sep 10, 2023
348d37f
:art: remove ``std::move``
Drewniok Sep 10, 2023
5526e92
:art: implement ``clang-tidy`` suggestions.
Drewniok Sep 11, 2023
40f9578
:art: Implement ``clang-tidy`` suggestions.
Drewniok Sep 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 24 additions & 4 deletions docs/algorithms/sidb_simulation.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
SiDB Electrostatic Ground State Simulation
------------------------------------------
Physical Simulation of Silicon Dangling Bond Logic
--------------------------------------------------

These headers provide functions for physically simulating the *ground state* of an SiDB layout. Ground state simulations
are a crucial step in the physical design flow of SiDB layouts, as they are used to validate their functionality.
These headers provide functions for physically simulating an SiDB layout, which is a crucial step in the physical design flow of SiDB layouts, as they are used to validate their functionality.


Physical Parameters
Expand Down Expand Up @@ -39,6 +38,13 @@ Heuristic Ground State Simulation
Exhaustive Ground State Simulation
##################################

**Header:** ``fiction/algorithms/simulation/sidb/quickexact.hpp``

.. doxygenenum:: fiction::automatic_base_number_detection
.. doxygenstruct:: fiction::quickexact_params
:members:
.. doxygenfunction:: fiction::quickexact

**Header:** ``fiction/algorithms/simulation/sidb/exhaustive_ground_state_simulation.hpp``

.. doxygenfunction:: fiction::exhaustive_ground_state_simulation
Expand Down Expand Up @@ -87,12 +93,26 @@ Temperature Behavior
.. doxygenfunction:: fiction::calculate_energy_and_state_type


Maximum Defect Influence Distance
#################################

**Header:** ``fiction/algorithms/simulation/sidb/maximum_defect_influence_distance.hpp``

.. doxygenstruct:: fiction::maximum_defect_influence_distance_params
:members:
.. doxygenstruct:: fiction::maximum_defect_influence_distance_stats
:members:
.. doxygenfunction:: fiction::maximum_defect_influence_distance


Time-to-Solution (TTS) Statistics
#################################

**Header:** ``fiction/algorithms/simulation/sidb/time_to_solution.hpp``

.. doxygenenum:: fiction::exhaustive_algorithm
.. doxygenstruct:: fiction::time_to_solution_params
:members:
.. doxygenfunction:: fiction::sim_acc_tts


Expand Down
326 changes: 326 additions & 0 deletions include/fiction/algorithms/iter/gray_code_iterator.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,326 @@
//
// Created by Jan Drewniok on 30.08.23.
//

#ifndef FICTION_GRAY_CODE_ITERATOR_HPP
#define FICTION_GRAY_CODE_ITERATOR_HPP

#include <cstdint>
#include <iterator>
#include <vector>

namespace fiction
{
/**
* An iterator type that iterates over Gray code representations for decimal numbers.
*
* The `gray_code_iterator` class provides an iterator for generating Gray code representations
* for a range of decimal numbers. It starts from a specified number and produces Gray codes
* in ascending order based on bitwise XOR operations.
*/
class gray_code_iterator
Drewniok marked this conversation as resolved.
Show resolved Hide resolved
Drewniok marked this conversation as resolved.
Show resolved Hide resolved
{
public:
/**
* Constructs a Gray Code Iterator with a specified starting number.
*
* Constructs a `gray_code_iterator` that generates Gray codes for decimal numbers
* starting from the given `start` number.
*
* @param start The starting decimal number for the iterator.
*/
explicit gray_code_iterator(const uint64_t start) noexcept :
start_number{start},
current_iteration{start},
current_gray_code{start}
{
binary_to_gray();
};
/**
* Dereference operator. Returns a reference to the Gray code of the current iteration.
*
* @return Reference to the current Gray code.
*/
[[nodiscard]] const uint64_t& operator*() const
{
return current_gray_code;
}
/**
* Prefix increment operator. Sets the number and the corresponding Gray code.
*
* @return Reference to `this`.
*/
gray_code_iterator& operator++() noexcept
{
++current_iteration;
binary_to_gray();

return *this;
}
/**
* Equality comparison operator. Compares the current iterator with another iterator.
*
* @param other The iterator to compare with.
* @return `true` if the current iterator is equal to the other iterator, `false` otherwise.
*/
[[nodiscard]] bool operator==(const gray_code_iterator& other) const
{
return (current_gray_code == other.current_gray_code);
}
/**
* Inequality comparison operator. Compares the current iterator with another iterator.
*
* @param other The iterator to compare with.
* @return `true` if the current iterator is not equal to the other iterator, `false` otherwise.
*/
[[nodiscard]] bool operator!=(const gray_code_iterator& other) const
{
return !(*this == other);
}
/**
* Less-than comparison operator. Compares the current iterator with another iterator.
*
* @param other The iterator to compare with.
* @return `true` if the current iterator is less than the other iterator, `false` otherwise.
*/
[[nodiscard]] bool operator<(const gray_code_iterator& other) const
{
return current_gray_code < other.current_gray_code;
}
/**
* Less-than or equal-to comparison operator. Compares the current iterator with another iterator.
*
* @param other The iterator to compare with.
* @return `true` if the current iterator is less than or equal to the other iterator, `false` otherwise.
*/
[[nodiscard]] bool operator<=(const gray_code_iterator& other) const
{
return current_gray_code <= other.current_gray_code;
}
/**
* Postfix increment operator. Sets the next Gray Code.
*
* @return Copy of `this` before incrementing.
*/
gray_code_iterator operator++(int) noexcept
{
auto result{*this};

++(*this);

return result;
}
/**
* Addition operator. Computes the Gray code of the current iterator plus the given integer.
*
* @param m The amount of Gray codes to skip.
* @return Iterator of the current iterator plus the given integer.
*/
[[nodiscard]] gray_code_iterator operator+(const int m) const noexcept
{
auto result{*this};

result += m;

return result;
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsign-conversion"
/**
* Addition assignment operator. Iterator is increased by given number.
*
* @param m The amount of Gray codes to skip.
* @return Reference to `this`.
*/
gray_code_iterator& operator+=(const int m) noexcept
{
current_iteration += m;
binary_to_gray();

return *this;
}
#pragma GCC diagnostic pop
/**
* Subtraction operator. Computes the Gray code of the current iterator minus the given integer.
*
* @param m The amount of Gray codes to skip.
* @return Iterator of the current iterator minus the given integer.
*/
[[nodiscard]] gray_code_iterator operator-(const int m) const noexcept
{
auto result{*this};

result -= m;

return result;
}
/**
* Prefix decrement operator. Sets the previous Gray code.
*
* @return Reference to `this`.
*/
gray_code_iterator& operator--() noexcept
{
--current_iteration;

binary_to_gray();

return *this;
}
/**
* Postfix decrement operator. Sets the previous Gray Code.
*
* @return Copy of `this` before decrementing.
*/
gray_code_iterator operator--(int) noexcept
{
auto result{*this};

--(*this);

return result;
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsign-conversion"
/**
* Subtraction assignment operator. Sets a previous Gray code.
*
* @param m The amount of Gray codes to skip.
* @return Reference to `this`.
*/
gray_code_iterator& operator-=(const int m) noexcept
{
current_iteration -= m;

binary_to_gray();

return *this;
}
#pragma GCC diagnostic pop
/**
* Assignment operator. Sets the current number to the given integer.
*
* @param m The number to set.
*/
gray_code_iterator& operator=(const uint64_t m) noexcept
{
current_iteration = m;
binary_to_gray();
return *this;
}
/**
* Subscript operator. Returns the Gray code at a specific position in the iteration range.
*
* @param index The position in the iteration range.
* @return The Gray code at the specified position.
*/
uint64_t operator[](size_t index) const
{
// Calculate the Gray code at the specified position
uint64_t result = start_number + static_cast<uint64_t>(index);
result ^= (result >> 1u);
return result;
}
/**
* Equality operator. Compares the current number with the given integer.
*
* @param m Integer to compare with.
* @return `true` if the current number is equal to `m`, `false` otherwise.
*/
[[nodiscard]] bool operator==(const uint64_t m) const noexcept
{
return current_iteration == m;
}
/**
* Inequality operator. Compares the current number with the given integer.
*
* @param m Integer to compare with.
* @return `true` if the current number is not equal to `m`, `false` otherwise.
*/
[[nodiscard]] bool operator!=(const uint64_t m) const noexcept
{
return current_iteration != m;
}
/**
* Less-than operator. Compares the current number with the given integer.
*
* @param m Integer to compare with.
* @return `true` if the current number is less than `m`, `false` otherwise.
*/
[[nodiscard]] bool operator<(const uint64_t m) const noexcept
{
return current_iteration < m;
}
/**
* Less-or-equal-than operator. Compares the current number with the given integer.
*
* @param m Integer to compare with.
* @return `true` if the current number is less than or equal to `m`, `false` otherwise.
*/
[[nodiscard]] bool operator<=(const uint64_t m) const noexcept
{
return current_iteration <= m;
}
/**
* Greater-than operator. Compares the current number with the given integer.
*
* @param m Integer to compare with.
* @return `true` if the current number is greater than `m`, `false` otherwise.
*/
[[nodiscard]] bool operator>(const uint64_t m) const noexcept
{
return current_iteration > m;
}
/**
* Greater-or-equal-than operator. Compares the current number with the given integer.
*
* @param m Integer to compare with.
* @return `true` if the current number is greater than or equal to `m`, `false` otherwise.
*/
[[nodiscard]] bool operator>=(const uint64_t m) const noexcept
{
return current_iteration >= m;
}

private:
/**
* Start number of the iteration.
*/
const uint64_t start_number;
Drewniok marked this conversation as resolved.
Show resolved Hide resolved
/**
* Current number (i.e., current iteration number).
*/
uint64_t current_iteration;
/**
* Current Gray Code.
*/
uint64_t current_gray_code;
/**
* Converts the current decimal number into its corresponding Gray code representation.
*
* This function operates on the current decimal number and produces its Gray code
* representation using the bitwise XOR operation. Gray code is a binary numeral system
* in which two successive values differ in only one bit.
*
* The result is stored in the 'current_gray_code' variable.
*/
void binary_to_gray()
{
current_gray_code = current_iteration ^ (current_iteration >> 1u);
}
};

} // namespace fiction

Drewniok marked this conversation as resolved.
Show resolved Hide resolved
// make `gray_code_iterator` compatible with STL iterator categories
namespace std
{
template <>
struct iterator_traits<fiction::gray_code_iterator>
{
using iterator_category = std::random_access_iterator_tag;
using value_type = uint64_t;
Drewniok marked this conversation as resolved.
Show resolved Hide resolved
};
} // namespace std

#endif // FICTION_GRAY_CODE_ITERATOR_HPP
Loading
Loading