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

Merge changes from original Repository #3

Merged
merged 635 commits into from
Sep 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
635 commits
Select commit Hold shift + click to select a range
9da6f48
Add binary_coded_decimal.py (#10656)
manmita Oct 17, 2023
788e4ed
Fix doctest power recursion (#10659)
Jaivignesh-afk Oct 17, 2023
361f64c
Adds hinge loss function algorithm (#10628)
PoojanSmart Oct 18, 2023
572de4f
Added A General Swish Activation Function inNeural Networks (#10415)
shivansh-bhatnagar18 Oct 18, 2023
9adb7ce
Update primelib.py (#10209)
rtang09 Oct 19, 2023
30c8d55
Update binary_exponentiation.py (#10253)
rtang09 Oct 19, 2023
b301e58
Update binary_exponentiation.py (#10342)
ialoko Oct 19, 2023
3388864
Edit Distance Algorithm for String Matching (#10571)
anshul-2010 Oct 19, 2023
289a4dd
docs: add test scenarios to pull request template (#10396)
kibolho Oct 19, 2023
bd3072b
Added Mean Squared Logarithmic Error (MSLE) Loss Function (#10637)
ank426 Oct 19, 2023
6987614
*added docstring and doctest for find_isolated_nodes (#10684)
ketan96-m Oct 19, 2023
26ffad9
Simplify is_bst.py (#10627)
cclauss Oct 19, 2023
be94690
Create swap_all_odd_and_even_bits.py (#10692)
NikhithaBandari Oct 19, 2023
34f48b6
Create vernam_cipher.py (#10702)
Anupamaraie Oct 19, 2023
9875f37
Consolidate bubble sort iterative and recursive (#10651)
R055A Oct 19, 2023
5180533
Fix ruff error in `machine_learning/sequential_minimum_optimization.p…
tianyizheng02 Oct 20, 2023
4154428
[ADD]: Improved tests in power recursion! (#10664)
imSanko Oct 20, 2023
82fc24c
Test cases for check_bipartite_graph_bfs (#10688)
RaymondDashWu Oct 20, 2023
1976048
Concatenates both check bipatrite graphs(bfs&dfs) (#10708)
shivaparihar6119 Oct 20, 2023
6f2d6f7
Move files for special numbers to own directory (#10714)
tianyizheng02 Oct 20, 2023
ce0ede6
Fix typo in DPLL file name (#10723)
tianyizheng02 Oct 20, 2023
5799376
Added New Tests in Signum (#10724)
imSanko Oct 20, 2023
52a987e
Add docstrings and doctests and fix a bug ciphers/trifid_cipher.py (#…
FEROS01 Oct 20, 2023
5645084
Consolidate loss functions into a single file (#10737)
tianyizheng02 Oct 20, 2023
47c19d9
Add: FP Growth Algorithm (#10746)
JeelGajera Oct 21, 2023
06edc0e
Consolidate binary exponentiation files (#10742)
tianyizheng02 Oct 21, 2023
b814cf3
add exponential search algorithm (#10732)
kiarash8112 Oct 21, 2023
4707fdb
Add tests for Perfect_Number (#10745)
imSanko Oct 21, 2023
d956203
added a function to calculate perceived frequency by observer using D…
Baron105 Oct 21, 2023
c92e86b
Add tests to data_structures/linked_list/swap_nodes.py (#10751)
PreciousJac0b Oct 21, 2023
d73a4c2
adding new physics algorithm: center of mass (#10743)
santiditomas Oct 21, 2023
0601b56
Add tests without modifying code (#10740)
gio-puter Oct 22, 2023
7d0f6e0
Updated doctests for nor_gate (#10791)
nkstonks Oct 22, 2023
6c8743f
Add: Time Conversion Function (#10749)
JeelGajera Oct 22, 2023
a8b94ab
Enhance readability of N Queens (#9265)
Hardvan Oct 22, 2023
fdb0635
added doctest to playfair_cipher.py (#10823)
AnshuSharma111 Oct 22, 2023
abd6bca
Added Binary Focal Cross Entropy (#10674)
ank426 Oct 23, 2023
dc4e898
Added docstring/documentation for sigmoid_function (#10756)
Suyashd999 Oct 23, 2023
68faebe
feat: Add mass energy equivalence in physics and doctests (#10202)
SilverDragonOfR Oct 23, 2023
abc3909
Added the algorithm to compute the terminal velocity of an object fal…
pluto-tofu Oct 23, 2023
a9cee1d
Add perfect cube binary search (#10477)
CouldNot Oct 23, 2023
a8b6bda
Delete `arithmetic_analysis/` directory and relocate its contents (#1…
tianyizheng02 Oct 23, 2023
417b7ed
code enhancement in `sort.double_sort` (#10798)
Krishna-Singhal Oct 23, 2023
d051db1
Add Simple Moving Average (SMA) Calculation (#9300)
Berat-O Oct 23, 2023
4cbefad
[New Algorithm] - Triangular Numbers (#10663)
Tauseef-Hilal Oct 23, 2023
54e2aa6
Enhance readability of Minimax (#10838)
Hardvan Oct 23, 2023
3012206
Add Floyd's Cycle Detection Algorithm (#10833)
aqib-m31 Oct 23, 2023
ffd3a56
Updated Selection Sort (#10855)
nababuddin Oct 23, 2023
e5d6969
[pre-commit.ci] pre-commit autoupdate (#10856)
pre-commit-ci[bot] Oct 23, 2023
b98312c
Consolidate Newton-Raphson implementations (#10859)
tianyizheng02 Oct 23, 2023
6971af2
feat: RGB to CMYK color converter (#10741)
Mrk-Mzj Oct 23, 2023
481aff7
Add `Mirror a Binary Tree` solution (#9534)
gogouravr Oct 24, 2023
17059b7
Added doctests , type hints for other/nested_brackets.py (#10872)
bhavesh1oo Oct 24, 2023
eb17fcf
Use dataclasses in circular_linked_list.py (#10884)
cclauss Oct 24, 2023
a23dd7e
Change from only weatherstack to both (#10882)
nababuddin Oct 24, 2023
28f4c16
Tried new TESTS for the binomial_coefficient (#10822)
imSanko Oct 24, 2023
aeee0f4
Add doctests for fractional knapsack (#10891)
Hardvan Oct 24, 2023
28302db
Remove myself from CODEOWNERS (#10220)
dhruvmanila Oct 24, 2023
fd227d8
Add function docstrings, comments and type hints (#10893)
Hardvan Oct 24, 2023
dab4e64
Code enhancements in binary_insertion_sort.py (#10918)
Bisma-Nadeemm Oct 24, 2023
76acc6d
Adding doctests to frequency_finder.py (#10341)
ialoko Oct 24, 2023
c2c6cb0
Add dataclasses to binary_search_tree.py (#10920)
cclauss Oct 25, 2023
3d0a409
Improved Equilibrium Index of an Array. (#10899)
AdityaAtoZ Oct 25, 2023
e1e5963
Code Enhancements in merge_sort.py (#10911)
Bisma-Nadeemm Oct 25, 2023
0ffe506
added mean absolute percentage error (#10464)
Humzafazal72 Oct 25, 2023
0e7f828
Add error tests in doctest and fix error message (#10930)
CouldNot Oct 26, 2023
1a5d5cf
Mean absolute error (#10927)
megpay Oct 26, 2023
a8f05fe
Add doctests and type hints (#10974)
edy252 Oct 26, 2023
c71c280
added runge kutta gills method to maths/ numerical_analysis (#10967)
ravi-ivar-7 Oct 26, 2023
dd7d18d
Added doctest, docstring and typehint for sigmoid_function & cost_fun…
Suyashd999 Oct 26, 2023
e5a6a97
Added Lens formulae to the Physics repository (#10187)
san-jay-14 Oct 26, 2023
e791a20
Capacitor equivalence algorithm (#9814)
Mary-0165 Oct 26, 2023
ade2837
Update capitalize.py (#10573)
its-100rabh Oct 26, 2023
6497917
Added Kth largest element algorithm (#10687)
neha3423 Oct 26, 2023
42c49ee
Fix typo in haralick_descriptors.py (#10988)
habipakyol Oct 26, 2023
29b8ccd
Added doctest to hash_table.py (#10984)
Suyashd999 Oct 26, 2023
69f7f32
Update cocktail_shaker_sort.py (#10987)
Akash-Jambulkar Oct 26, 2023
5792503
Speed up `dijkstra_bankers_algorithm.py` (#10861)
tianyizheng02 Oct 26, 2023
8adbf47
Fix Typo & Grammatical Errors (#10980)
kishanrajput23 Oct 26, 2023
34b25c0
Add doctest for maths/primelib (#10978)
tielarose Oct 26, 2023
a8dfd40
Add new algorithm index_2d_array_in_1d (#10973)
edy252 Oct 26, 2023
fe4aad0
Added doctest & docstring to quadratic_probing.py (#10996)
Suyashd999 Oct 26, 2023
5987f86
Add automatic differentiation algorithm (#10977)
PoojanSmart Oct 27, 2023
34eb9c5
Added doctest to hash_table.py (#11023)
Suyashd999 Oct 27, 2023
e4eda14
Add perplexity loss algorithm (#11028)
PoojanSmart Oct 27, 2023
f336cca
Added doctest to double_hash.py (#11020)
Suyashd999 Oct 27, 2023
185a355
Create monotonic_array.py (#11025)
Khushi-Shukla Oct 27, 2023
b0837d3
Increase code coverage for dijkstra algorithm (#10695)
R055A Oct 27, 2023
0eb1825
Tests for odd_even_transposition_parallel (#10926)
RaymondDashWu Oct 27, 2023
5df16f1
Add doctest to hashes/hamming_code.py (#10961)
tielarose Oct 27, 2023
a0e80a7
Added Gradient Boosting Classifier (#10944)
SannketNikam Oct 27, 2023
1e1ee00
Excess 3 code (#11001)
manmita Oct 27, 2023
f243631
Add FuzzySet Class for Triangular Fuzzy Sets (#11036)
Shreya123714 Oct 28, 2023
b51b833
Added doctest to heap.py (#11059)
Suyashd999 Oct 28, 2023
d80ee90
Create crossword_puzzle_solver.py (#11011)
Khushi-Shukla Oct 28, 2023
444dfb0
Added adams-bashforth method of order 2, 3, 4, 5 (#10969)
ravi-ivar-7 Oct 28, 2023
aa5c97d
Create ipv4_conversion.py (#11008)
its-tapas Oct 28, 2023
e3eb9da
Add bitap_string_match algo (#11060)
edy252 Oct 28, 2023
5019561
Create multiplexer.py (#11064)
its-tapas Oct 29, 2023
bad39cd
Add more doctest to intro_sort.py #9943 (#11068)
ojas-wani Oct 29, 2023
adb13a1
Update instagram_pic.py (#10957)
nababuddin Oct 29, 2023
8217f9b
Create find_previous_power_of_two.py (#11004)
its-tapas Oct 29, 2023
403d3b8
Add Integer Square Root Algorithm (#10949)
aqib-m31 Oct 29, 2023
cc22d0b
Generate parentheses (#10903)
aayushsoni4 Oct 29, 2023
7c1dfec
XOR Cipher: doctests and bug fixes (#10840)
FarzadHayat Oct 29, 2023
6b588e4
Added doctests for fibonacci.py (#10836)
nkstonks Oct 29, 2023
d59cf17
Add running key cipher (#10834)
ArshdeepSingh98 Oct 29, 2023
3ad90ce
add a yield method to fibonaci (#10826)
08183080 Oct 29, 2023
67c85ee
Added doctest to hash_map.py (#11082)
Suyashd999 Oct 29, 2023
be60f42
Add Josephus Problem (#10928)
aqib-m31 Oct 29, 2023
eafdb8b
Dahhou ilyas (#10058)
dahhou-ilyas Oct 29, 2023
760d9be
Added Fast Inverse Square Root (#11054)
aryanshb Oct 29, 2023
c7a1331
Create karnaugh_map_simplification.py (#11056)
Khushi-Shukla Oct 29, 2023
13e66c1
Fix typo power_using_recursion.py (#11083)
Oct 29, 2023
2531f8e
test: adding more tests to missing number algorithm (#10394)
kibolho Oct 29, 2023
c38b222
serialize deserialize binary tree (#9625)
AVAniketh0905 Oct 29, 2023
ad9948d
implementation of Gaussian Elimination pivoting as a numerical linear…
TheKidPadra Oct 30, 2023
ddd4023
Happy number (new algorithm) (#10864)
Devadeut Oct 30, 2023
79a327f
[pre-commit.ci] pre-commit autoupdate (#11106)
pre-commit-ci[bot] Oct 30, 2023
b072ba6
Added tests for validate_sudoku_board.py (#11108)
AksharGoyal Oct 31, 2023
99f3a0e
adding-docstrings (#11114)
Arya-Hari Oct 31, 2023
ebfdb12
Added doctest to hash_map.py (#11105)
Suyashd999 Nov 4, 2023
257cfbd
Added doctest to decision_tree.py (#11143)
Suyashd999 Nov 5, 2023
1e50cf3
Added doctest to binary_search_tree.py (#11141)
Suyashd999 Nov 5, 2023
e48ea7d
Create get_ip_geolocation.py (#10902)
nababuddin Nov 5, 2023
eb989c0
Data structures/arrays/triplet sum (#11134)
Skyad Nov 6, 2023
fa508d7
Added doctest to detecting_english_programmatically.py (#11135)
Suyashd999 Nov 6, 2023
12e4016
Added doctest to string_switch_case.py (#11136)
Suyashd999 Nov 6, 2023
a13e9c2
[pre-commit.ci] pre-commit autoupdate (#11146)
pre-commit-ci[bot] Nov 7, 2023
8b73526
Added doctest to randomized_heap.py (#11151)
Suyashd999 Nov 12, 2023
fb17eea
Added doctest to stack.py (#11149)
Suyashd999 Nov 12, 2023
0e2e6ab
Added doctest to heap.py (#11129)
Suyashd999 Nov 13, 2023
5f61af4
Fix ignore venv in build_directory_md.py (#11156)
FishyGitHubUser Nov 16, 2023
3999abf
adding a geometry module (#11138)
meg-1 Nov 24, 2023
b8e7a4c
Fix typo in knight_tour.py (#11173)
FishyGitHubUser Nov 25, 2023
5898b96
Typo deicmal -> decimal (#11169)
rahidzeynal Nov 25, 2023
4151a13
add graphs/ant_colony_optimization_algorithms.py (#11163)
Clarkzzzzz Nov 25, 2023
050b2a6
Bug fix combinations (#11158)
moaldeen Nov 25, 2023
8b39a0f
[pre-commit.ci] pre-commit autoupdate (#11154)
pre-commit-ci[bot] Nov 25, 2023
86ae30d
Create Spearman's rank correlation coefficient (#11155)
cyrixninja Nov 25, 2023
84a1533
Added doctest to binary_search_tree.py (#11145)
Suyashd999 Nov 25, 2023
154e5e8
Update levenshtein_distance.py (#11171)
pedram-mohajer Nov 26, 2023
b860003
Add doctest to is_safe function (#11183)
pedram-mohajer Nov 27, 2023
0ac97f3
[pre-commit.ci] pre-commit autoupdate (#11184)
pre-commit-ci[bot] Nov 27, 2023
82e539d
Create smallestRange.py (#11179)
pedram-mohajer Dec 1, 2023
a73f37b
[pre-commit.ci] pre-commit autoupdate (#11195)
pre-commit-ci[bot] Dec 4, 2023
c14a580
[pre-commit.ci] pre-commit autoupdate (#11210)
pre-commit-ci[bot] Dec 11, 2023
2d0ed13
[pre-commit.ci] pre-commit autoupdate (#11215)
pre-commit-ci[bot] Dec 18, 2023
b46fc1d
Corrected the Python Doctest command in equilibrium_index_in_array.py…
thecoddiwompler Dec 19, 2023
7b9f82c
optimize quicksort implementation (#11196)
tusharpamnani Dec 20, 2023
94c8e1a
[pre-commit.ci] pre-commit autoupdate (#11223)
pre-commit-ci[bot] Dec 25, 2023
51c5c87
File moved to neural_network/activation_functions (#11216)
ParamThakkar123 Dec 27, 2023
9caf478
[pre-commit.ci] pre-commit autoupdate (#11231)
pre-commit-ci[bot] Jan 8, 2024
227944e
fix: consider months and days in `years_old` (#11234)
vil02 Jan 12, 2024
a56f24e
fix: use `GITHUB_ACTOR` in `git config` (#11233)
vil02 Jan 12, 2024
ffb93ad
chore: update `actions/setup-python` to `v5` (#11236)
vil02 Jan 12, 2024
13559ae
style: use proper indentation in `ruff.yml` (#11237)
vil02 Jan 13, 2024
dd47651
[pre-commit.ci] pre-commit autoupdate (#11246)
pre-commit-ci[bot] Jan 15, 2024
4b6f688
Use compiled black as the pre-commit formatter (#11247)
AtomicVar Jan 16, 2024
0101dd4
Fixed Inappropriate Logical Expression (#11203)
fazledyn-or Jan 16, 2024
05a5cda
Added doctest to skew_heap.py (#11147)
Suyashd999 Jan 18, 2024
3952ba7
Add categorical focal cross-entropy loss algorithm (#11248)
AtomicVar Jan 18, 2024
b01571d
[pre-commit.ci] pre-commit autoupdate (#11255)
pre-commit-ci[bot] Jan 22, 2024
b092d77
fixes #11256 : computer vision link update in .computer_vision/README…
geoffreylgv Jan 24, 2024
c0e700c
[pre-commit.ci] pre-commit autoupdate (#11261)
pre-commit-ci[bot] Jan 29, 2024
c1d29ba
Add smooth l1 loss algorithm (#11239)
AtomicVar Jan 30, 2024
8995f45
Rename .github/.github/dependabot.yml to .github/dependabot.yml (#11264)
cclauss Feb 1, 2024
6a16974
Bump actions/cache from 3 to 4 (#11265)
dependabot[bot] Feb 1, 2024
4128f19
Fixed lines that needed to be uncommented after Hacktoberfest (#11267)
tonguegrease Feb 2, 2024
ed8d920
[pre-commit.ci] pre-commit autoupdate (#11275)
pre-commit-ci[bot] Feb 5, 2024
5d6846b
[pre-commit.ci] pre-commit autoupdate (#11292)
pre-commit-ci[bot] Feb 12, 2024
c6ca194
[pre-commit.ci] pre-commit autoupdate (#11296)
pre-commit-ci[bot] Feb 19, 2024
fd27953
Reenable files when TensorFlow supports the current Python (#11318)
MaximSmolskiy Mar 12, 2024
5f95d6f
fix: function name typo (#11319)
testwill Mar 12, 2024
bc8df6d
[pre-commit.ci] pre-commit autoupdate (#11322)
pre-commit-ci[bot] Mar 13, 2024
435309a
[pre-commit.ci] pre-commit autoupdate (#11325)
pre-commit-ci[bot] Mar 18, 2024
8faf823
adding a proper fractions algorithm (#11224)
meg-1 Mar 20, 2024
a936e94
Enable ruff ARG001 rule (#11321)
MaximSmolskiy Mar 20, 2024
481c071
add vicsek to fractals (#11306)
PAxitoo Mar 20, 2024
102e9a3
Enable ruff DTZ001 rule (#11326)
MaximSmolskiy Mar 25, 2024
ead5431
[pre-commit.ci] pre-commit autoupdate (#11328)
pre-commit-ci[bot] Mar 25, 2024
b5cb1fb
Enable ruff DTZ005 rule (#11327)
MaximSmolskiy Mar 25, 2024
19fd435
Improved doctests for some functions (#11334)
MrBubb1es Mar 28, 2024
516a302
Enable ruff PLR5501 rule (#11332)
MaximSmolskiy Mar 28, 2024
da47d5c
Enable ruff N999 rule (#11331)
MaximSmolskiy Mar 28, 2024
efb7463
Enable ruff PLW0120 rule (#11330)
MaximSmolskiy Mar 28, 2024
f2246ce
Enable ruff ICN001 rule (#11329)
MaximSmolskiy Mar 28, 2024
c328b00
[pre-commit.ci] pre-commit autoupdate (#11339)
pre-commit-ci[bot] Apr 1, 2024
39daaf8
Enable ruff RUF100 rule (#11337)
MaximSmolskiy Apr 1, 2024
f8a9489
Enable ruff NPY002 rule (#11336)
MaximSmolskiy Apr 1, 2024
93fb555
Enable ruff SIM102 rule (#11341)
MaximSmolskiy Apr 2, 2024
f8cdb3e
Enable ruff S105 rule (#11343)
MaximSmolskiy Apr 2, 2024
f437f92
Enable ruff INP001 rule (#11346)
MaximSmolskiy Apr 2, 2024
f5bbea3
Enable ruff RUF005 rule (#11344)
MaximSmolskiy Apr 2, 2024
53b2926
Enable ruff PGH003 rule (#11345)
MaximSmolskiy Apr 2, 2024
cc2f5b1
Do not fix ruff EXE001 rule (#11350)
MaximSmolskiy Apr 8, 2024
9e55c9d
Added documentations (#11352)
Jiayoqin Apr 8, 2024
14ca726
[pre-commit.ci] pre-commit autoupdate (#11355)
pre-commit-ci[bot] Apr 9, 2024
0a9a860
[pre-commit.ci] pre-commit autoupdate (#11364)
pre-commit-ci[bot] Apr 15, 2024
a42eb35
Enable ruff E741 rule (#11370)
MaximSmolskiy Apr 19, 2024
4259348
Add doctests in all functions in basic_string.py (#11374)
KelvinPuyam Apr 20, 2024
7b88e15
Enable ruff RUF007 rule (#11349)
MaximSmolskiy Apr 20, 2024
2702bf9
Enable ruff S113 rule (#11375)
MaximSmolskiy Apr 21, 2024
dbfa218
[pre-commit.ci] pre-commit autoupdate (#11380)
pre-commit-ci[bot] Apr 22, 2024
79dc7c9
Enable ruff RUF001 rule (#11378)
MaximSmolskiy Apr 22, 2024
4700297
Enable ruff RUF002 rule (#11377)
MaximSmolskiy Apr 22, 2024
d016fda
Enable ruff RUF003 rule (#11376)
MaximSmolskiy Apr 22, 2024
3925b81
Fix ARG005 per file ignore (#11383)
MaximSmolskiy Apr 24, 2024
2d6be5f
Enable ruff UP031 rule (#11388)
MaximSmolskiy Apr 30, 2024
a7e0b14
[pre-commit.ci] pre-commit autoupdate (#11387)
pre-commit-ci[bot] Apr 30, 2024
c026b19
adding a matrix equalization algorithm (#11360)
meg-1 May 1, 2024
5131e31
Fix some ARG002 per file ignores (#11382)
MaximSmolskiy May 1, 2024
ea53051
Use `spawn` start method in multiprocessing programs (#11391)
XuehaiPan May 2, 2024
1868c0b
[pre-commit.ci] pre-commit autoupdate (#11394)
pre-commit-ci[bot] May 6, 2024
c599f6c
Fix some SIM114 per file ignores (#11395)
MaximSmolskiy May 10, 2024
1f368da
[pre-commit.ci] pre-commit autoupdate (#11402)
pre-commit-ci[bot] May 14, 2024
0139143
[pre-commit.ci] pre-commit autoupdate (#11408)
pre-commit-ci[bot] May 20, 2024
82aa909
[pre-commit.ci] pre-commit autoupdate (#11417)
pre-commit-ci[bot] May 28, 2024
b8afb21
Changed the N to self.N in show_data in segment_tree.py (#11276)
Marco-campione-github May 31, 2024
70bd06d
add doctest/document to actual_power and document to power (#11187)
pedram-mohajer Jun 1, 2024
723cf9c
Remove duplicate implementation of median of two arrays algorithm (#1…
tianyizheng02 Jun 1, 2024
edee8e6
use format to remove '0b' (#11307)
groupsvkg Jun 2, 2024
2f1704d
issue #11150 Ensure explicit column selection and data type setting i…
MannCode Jun 3, 2024
ffaa976
Fixes #9943 (#10252)
Jun 3, 2024
c919579
Add KL divergence loss algorithm (#11238)
AtomicVar Jun 3, 2024
5827aac
[pre-commit.ci] pre-commit autoupdate (#11430)
pre-commit-ci[bot] Jun 3, 2024
41a1cdf
Add rainfall intensity calculation function (#11432)
yuriishizawa Jun 11, 2024
4467423
Fix grammar and spelling mistakes in sequential_minimum_optimization.…
tianyizheng02 Jun 13, 2024
af6a45e
Remove some per file ignores (#11381)
MaximSmolskiy Jun 16, 2024
df94d46
Fix/fixes get top billionaries code (#11466)
ra230537 Jun 16, 2024
31d1cd8
[pre-commit.ci] pre-commit autoupdate (#11435)
pre-commit-ci[bot] Jun 17, 2024
1cfca52
chore: fix typos (#11467)
xiaoxianBoy Jun 17, 2024
75b8667
[pre-commit.ci] pre-commit autoupdate (#11472)
pre-commit-ci[bot] Jun 24, 2024
6882a8b
Tests/add new test case weight_conversion (#11468)
ShiryuReb Jun 26, 2024
716bdeb
[pre-commit.ci] pre-commit autoupdate (#11473)
pre-commit-ci[bot] Jul 2, 2024
c1dc8e9
Create count_vowels.py (#11474)
its-100rabh Jul 4, 2024
9190888
[pre-commit.ci] pre-commit autoupdate (#11481)
pre-commit-ci[bot] Jul 8, 2024
2d8f22a
[pre-commit.ci] pre-commit autoupdate (#11489)
pre-commit-ci[bot] Jul 15, 2024
d9ded07
[pre-commit.ci] pre-commit autoupdate (#11495)
pre-commit-ci[bot] Jul 23, 2024
1468003
Add doctests to interpolation_search.py (#11492)
Ihor-Pryyma Jul 25, 2024
240d1b7
[pre-commit.ci] pre-commit autoupdate (#11500)
pre-commit-ci[bot] Jul 29, 2024
dfe6795
[pre-commit.ci] pre-commit autoupdate (#11507)
pre-commit-ci[bot] Aug 5, 2024
ed1900f
Fix typo in integration_by_simpson_approx.py (#11501)
CarlosZamG Aug 6, 2024
31c424f
[pre-commit.ci] pre-commit autoupdate (#11515)
pre-commit-ci[bot] Aug 12, 2024
4841828
Remove separate directory for `gaussian_elimination_pivoting.py` (#11…
tianyizheng02 Aug 22, 2024
e3fa014
Fix ruff (#11527)
MaximSmolskiy Aug 25, 2024
c8e131b
[pre-commit.ci] pre-commit autoupdate (#11522)
pre-commit-ci[bot] Aug 26, 2024
bd8085c
[pre-commit.ci] pre-commit autoupdate (#11535)
pre-commit-ci[bot] Sep 2, 2024
f16d38f
kd tree data structure implementation (#11532)
Ramy-Badr-Ahmed Sep 3, 2024
729c1f9
[pre-commit.ci] pre-commit autoupdate (#11557)
pre-commit-ci[bot] Sep 9, 2024
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
Prev Previous commit
Next Next commit
implementation of Gaussian Elimination pivoting as a numerical linear…
… algebra algorithm (TheAlgorithms#10457)

* Adding new implementation

Adding my python implementation of Gaussian Elimination pivoting as a numerical linear algebra algorithm

* Delete linear_algebra/src/GaussianEliminationpivoting.py

* Adding new implementation

Adding my python implementation of Gaussian Elimination pivoting as a numerical linear algebra algorithm

* Delete linear_algebra/src/gaussianeliminationpivoting.py

* Adding new implementation

Adding my python implementation of Gaussian Elimination pivoting as a numerical linear algebra algorithm 
for the third time because the last two times had conflict with the rules in PR

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Delete linear_algebra/src/gaussianeliminationpivoting.py

* Adding gaussianeliminationpivoting.py

Adding my python implementation of Gaussian Elimination pivoting as a numerical linear algebra algorithm 
for the fourth time because the last three times had conflict with the rules in PR and bots

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update gaussianeliminationpivoting.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update gaussianeliminationpivoting.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update gaussianeliminationpivoting.py

I changed a to matrix and coeff_matrix for better clarity

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update gaussianeliminationpivoting.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update gaussianeliminationpivoting.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update gaussianeliminationpivoting.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update and rename gaussianeliminationpivoting.py to gaussian_elimination_pivoting.py

renamed the file

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update gaussian_elimination_pivoting.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update gaussian_elimination_pivoting.py

* Update gaussian_elimination_pivoting.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update gaussian_elimination_pivoting.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update gaussian_elimination_pivoting.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update gaussian_elimination_pivoting.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update gaussian_elimination_pivoting.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update gaussian_elimination_pivoting.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update gaussian_elimination_pivoting.py

* Update gaussian_elimination_pivoting.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update gaussian_elimination_pivoting.py

* Update gaussian_elimination_pivoting.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update gaussian_elimination_pivoting.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update gaussian_elimination_pivoting.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update gaussian_elimination_pivoting.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update gaussian_elimination_pivoting.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update gaussian_elimination_pivoting.py

* Update gaussian_elimination_pivoting.py

* Update gaussian_elimination_pivoting.py

* Update gaussian_elimination_pivoting.py

* Delete linear_algebra/src/gaussian_elimination_pivoting.py

* Add files via upload

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update gaussian_elimination_pivoting.py

* Update gaussian_elimination_pivoting.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Delete linear_algebra/src/gaussian_elimination_pivoting/text.py

* Add files via upload

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update linear_algebra/src/gaussian_elimination_pivoting/gaussian_elimination_pivoting.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update gaussian_elimination_pivoting.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update gaussian_elimination_pivoting.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update gaussian_elimination_pivoting.py

* Update gaussian_elimination_pivoting.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update gaussian_elimination_pivoting.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update gaussian_elimination_pivoting.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update gaussian_elimination_pivoting.py

* Update gaussian_elimination_pivoting.py

* Update gaussian_elimination_pivoting.py

* Update gaussian_elimination_pivoting.py

* Update gaussian_elimination_pivoting.py

* Update gaussian_elimination_pivoting.py

* Update gaussian_elimination_pivoting.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update gaussian_elimination_pivoting.py

* Update gaussian_elimination_pivoting.py

* Update gaussian_elimination_pivoting.py

* Update gaussian_elimination_pivoting.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
  • Loading branch information
3 people authored Oct 30, 2023
commit ad9948d5d4d65d1457b58d278e780a1b9470a715
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
import numpy as np

matrix = np.array(
[
[5.0, -5.0, -3.0, 4.0, -11.0],
[1.0, -4.0, 6.0, -4.0, -10.0],
[-2.0, -5.0, 4.0, -5.0, -12.0],
[-3.0, -3.0, 5.0, -5.0, 8.0],
],
dtype=float,
)


def solve_linear_system(matrix: np.ndarray) -> np.ndarray:
"""
Solve a linear system of equations using Gaussian elimination with partial pivoting

Args:
- matrix: Coefficient matrix with the last column representing the constants.

Returns:
- Solution vector.

Raises:
- ValueError: If the matrix is not correct (i.e., singular).

https://courses.engr.illinois.edu/cs357/su2013/lect.htm Lecture 7

Example:
>>> A = np.array([[2, 1, -1], [-3, -1, 2], [-2, 1, 2]], dtype=float)
>>> B = np.array([8, -11, -3], dtype=float)
>>> solution = solve_linear_system(np.column_stack((A, B)))
>>> np.allclose(solution, np.array([2., 3., -1.]))
True
>>> solve_linear_system(np.array([[0, 0], [0, 0]], dtype=float))
array([nan, nan])
"""
ab = np.copy(matrix)
num_of_rows = ab.shape[0]
num_of_columns = ab.shape[1] - 1
x_lst: list[float] = []

# Lead element search
for column_num in range(num_of_rows):
for i in range(column_num, num_of_columns):
if abs(ab[i][column_num]) > abs(ab[column_num][column_num]):
ab[[column_num, i]] = ab[[i, column_num]]
if ab[column_num, column_num] == 0.0:
raise ValueError("Matrix is not correct")
else:
pass
if column_num != 0:
for i in range(column_num, num_of_rows):
ab[i, :] -= (
ab[i, column_num - 1]
/ ab[column_num - 1, column_num - 1]
* ab[column_num - 1, :]
)

# Upper triangular matrix
for column_num in range(num_of_rows):
for i in range(column_num, num_of_columns):
if abs(ab[i][column_num]) > abs(ab[column_num][column_num]):
ab[[column_num, i]] = ab[[i, column_num]]
if ab[column_num, column_num] == 0.0:
raise ValueError("Matrix is not correct")
else:
pass
if column_num != 0:
for i in range(column_num, num_of_rows):
ab[i, :] -= (
ab[i, column_num - 1]
/ ab[column_num - 1, column_num - 1]
* ab[column_num - 1, :]
)

# Find x vector (Back Substitution)
for column_num in range(num_of_rows - 1, -1, -1):
x = ab[column_num, -1] / ab[column_num, column_num]
x_lst.insert(0, x)
for i in range(column_num - 1, -1, -1):
ab[i, -1] -= ab[i, column_num] * x

# Return the solution vector
return np.asarray(x_lst)


if __name__ == "__main__":
from doctest import testmod
from pathlib import Path

testmod()
file_path = Path(__file__).parent / "matrix.txt"
try:
matrix = np.loadtxt(file_path)
except FileNotFoundError:
print(f"Error: {file_path} not found. Using default matrix instead.")

# Example usage:
print(f"Matrix:\n{matrix}")
print(f"{solve_linear_system(matrix) = }")
4 changes: 4 additions & 0 deletions linear_algebra/src/gaussian_elimination_pivoting/matrix.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
5.0 -5.0 -3.0 4.0 -11.0
1.0 -4.0 6.0 -4.0 -10.0
-2.0 -5.0 4.0 -5.0 -12.0
-3.0 -3.0 5.0 -5.0 8.0