* Replacing the generator with numpy vector operations from lu_decomposition.
* Revert "Replacing the generator with numpy vector operations from lu_decomposition."
This reverts commit ad217c6616.
* Removes the warning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation
* Replaced loops in jacobi_iteration_method function with vector operations. That gives a reduction in the time for calculating the algorithm.
* Replaced loops in jacobi_iteration_method function with vector operations. That gives a reduction in the time for calculating the algorithm.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Delete main.py
* Update jacobi_iteration_method.py
Changed a line that was too long.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update jacobi_iteration_method.py
Changed the type of the returned list as required.
* Update jacobi_iteration_method.py
Replaced init_val with new_val.
* Update jacobi_iteration_method.py
Fixed bug: init_val: list[int] to list[float].
Since the numbers are fractional: init_val = [0.5, -0.5, -0.5].
* Update jacobi_iteration_method.py
Changed comments, made variable names more understandable.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update jacobi_iteration_method.py
left the old algorithm commented out, as it clearly shows what is being done.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update jacobi_iteration_method.py
Edits upon request.
* [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>
* use np.dot
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* further improvements using array slicing
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
* chore: Fix failing tests (ignore S307 "possibly insecure function")
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix: Move noqa back to right line
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* updating DIRECTORY.md
* Fix mypy errors in lu_decomposition.py
* Replace for-loops with comprehensions
* Add explanation of LU decomposition and extra doctests
Add an explanation of LU decomposition with conditions for when an LU
decomposition exists
Add extra doctests to handle each of the possible conditions for when a
decomposition exists/doesn't exist
* updating DIRECTORY.md
* updating DIRECTORY.md
---------
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* pre-commit: Upgrade psf/black for stable style 2023
Updating https://github.com/psf/black ... updating 22.12.0 -> 23.1.0 for their `2023 stable style`.
* https://github.com/psf/black/blob/main/CHANGES.md#2310
> This is the first [psf/black] release of 2023, and following our stability policy, it comes with a number of improvements to our stable style…
Also, add https://github.com/tox-dev/pyproject-fmt and https://github.com/abravalheri/validate-pyproject to pre-commit.
I only modified `.pre-commit-config.yaml` and all other files were modified by pre-commit.ci and psf/black.
* [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>
* feat: added ngram algorithm
* fix(test): use `math.isclose` to match floating point numbers approximately
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
* The black formatter is no longer beta
* pre-commit autoupdate
* pre-commit autoupdate
* Remove project_euler/problem_145 which is killing our CI tests
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Added 5 README files
* corrected arithmetic_analysis README
* Update audio_filters/README.md
Co-authored-by: John Law <johnlaw.po@gmail.com>
* Update backtracking/README.md
Co-authored-by: John Law <johnlaw.po@gmail.com>
* Update bit_manipulation/README.md
Co-authored-by: John Law <johnlaw.po@gmail.com>
Co-authored-by: John Law <johnlaw.po@gmail.com>
* case switch using python
* review comments
* added type hints
* general code format
* [mypy] Fix type annotations for secant_method.py
* remove bad push
* added type hints and doctests to arithmetic_analysis/newton_method.py
Continuing #2128
Also changed some variable names, made them more descriptive.
* Added type hints and doctests to arithmetic_analysis/newton_method.py
added a type alias for Callable[[float], float] and cleaned up the exception handling
* added type hints and doctests to arithmetic_analysis/newton_method.py
improved exception handling
* Update newton_method.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* added type hints and doctests to arithmetic_analysis/bisection.py
continuing in line with #2128
* modified arithmetic_analysis/bisection.py
Put back print statement at the end, replaced algorithm's print statement with an exception.
* modified arithmetic_analysis/bisection.py
Removed unnecessary type import "Optional"
* modified arithmetic_analysis/bisection.py
Replaced generic Exception with ValueError.
* modified arithmetic_analysis/bisection.py
fixed doctests
* Tighten up psf/black and flake8
* Fix some tests
* Fix some E741
* Fix some E741
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Create newton_forward_interpolation.py
This code is for calculating newton forward difference interpolation for fixed difference.
* Add doctests and reformat with black