mathslib


Namemathslib JSON
Version 3.2.0 PyPI version JSON
download
home_pagehttps://github.com/igorvanloo/mathslib
SummaryLibrary of Mathematical functions and Algorithms
upload_time2025-01-12 10:28:59
maintainerNone
docs_urlNone
authorIgor van Loo
requires_python<4,>=3.7
licenseNone
keywords numbertheory maths algorithms
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ========
Overview
========

.. image:: https://img.shields.io/pypi/v/mathslib.svg
        :target: https://pypi.python.org/pypi/mathslib

.. image:: https://readthedocs.org/projects/mathslib/badge/?version=latest
        :target: https://mathslib.readthedocs.io/en/latest/?badge=latest
        :alt: Documentation Status

`mathslib`__ is a compilation of Mathematical Functions and Algorithms. Unless credit was given all
of the functions were written by me. Relevant articles are also linked where the implementation is complex.

I have used most of these for `Project Euler`_.
 
See my website `ivl-projecteuler.com`_ for their implementation

See the full documentation `here`_

Breakdown
---------
+----------------+------------------------------------------------------------+
|numtheory.py    | * phi(x)                                                   |
|                | * phi_sieve(x)                                             |
|                | * phi_sum(x)                                               |
|                | * mobius(x)                                                |
|                | * mobius_k_sieve(limit, k)                                 |
|                | * count_k_free(n, k)                                       |
|                | * pythagorean_triples(limit, non_primitive)                |
|                | * count_primitive_pythagorean_triples(n)                   |
|                | * k_smooth_numbers(max_prime, limit)                       |
|                | * k_powerful(k, limit, count)                              |
|                | * legendre_factorial(x)                                    |
|                | * tonelli_shanks(a, p)                                     |
|                | * chinese_remainder_theorem(a1, a2, n1, n2)                |
|                | * generalised_CRT(a1, a2, n1, n2)                          |
|                | * frobenius_number(\*integers)                             |
|                | * continued_fraction(x)                                    |
|                | * overall_fraction(x)                                      |
|                | * partition(x, L, show)                                    |
+----------------+------------------------------------------------------------+
|primes.py       | * prime_sieve(limit, block_size, segment, values)          |
|                | * is_prime(x)                                              |
|                | * prime_factors(x)                                         |
|                | * spf_sieve(x)                                             |
|                | * primepi(x)                                               |
|                | * primepi_sieve(x)                                         |
|                | * sum_of_primes(x)                                         |
|                | * fermat_primality_test(x)                                 |
|                | * miller_primality_test(n, millerrabin, numoftests)        |
+----------------+------------------------------------------------------------+
|divisors.py     | * divisors(x, proper)                                      |
|                | * divisor(x, n)                                            |
|                | * divisor_sieve(x, n)                                      |
+----------------+------------------------------------------------------------+
|linalg.py       | * gauss_jordan_elimination(matrix, augmentedpart)          |
|                | * solve(M, b)                                              |
|                | * inverse(matrix)                                          |
|                | * determinant(matrix)                                      |
|                | * matrix_addition(A, B, subtract)                          |
|                | * identity(l, val)                                         |
|                | * concatenate(A, B)                                        |
|                | * argmax(alist)                                            |
|                | * fillmatrix(size, val)                                    |
|                | * matrix_mul(A, B)                                         |
|                | * matrix_pow(A, n)                                         |
+----------------+------------------------------------------------------------+
|fib.py          | * fibonacci(n, m)                                          |
|                | * fib_till(limit)                                          |
|                | * zeckendorf_representation(x)                             |
+----------------+------------------------------------------------------------+
|algorithms.py   | * prims_algorithm(matrix)                                  |
|                | * dijkstras_algorithm(graph, start_node, INFINITY)         |
|                | * floyd_warshall_algorithm(graph, INFINITY)                |
|                | * knap_sack(values, weights, n, W, no_values)              |
|                | * knap_sack_values(values, weights, n, W, no_values)       |
|                | * BFS(g, start_node, end_node)                             |
|                | * DFS(g, start_node, end_node)                             |
|                | * convex_hull_gift_wrapping(pts)                           |
|                | * convex_hull_DC(pts)                                      |
+----------------+------------------------------------------------------------+
|simple.py       | * bin_exp(a, b, c, n, m)                                   | 
|                | * number_to_base(n, b)                                     |
|                | * extended_euclidean_algorithm(n, b)                       |
|                | * lcm(a_list)                                              |
|                | * mod_division(a, b, m)                                    |
|                | * bisect(alist, goal)                                      |
|                | * is_clockwise(a, b, c)                                    |
+----------------+------------------------------------------------------------+

.. _Project Euler: https://projecteuler.net
.. _ivl-projecteuler.com: https://ivl-projecteuler.com
.. _mathslib1: https://pypi.python.org/pypi/mathslib
.. _here: https://mathslib.readthedocs.io/en/latest/index.html
__ mathslib1_

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/igorvanloo/mathslib",
    "name": "mathslib",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4,>=3.7",
    "maintainer_email": null,
    "keywords": "numbertheory, maths, algorithms",
    "author": "Igor van Loo",
    "author_email": "igorvanloo@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/c8/86/43e798c3328ff0fd43c038408991625479d5adbcd487b7a701b985732217/mathslib-3.2.0.tar.gz",
    "platform": null,
    "description": "========\r\nOverview\r\n========\r\n\r\n.. image:: https://img.shields.io/pypi/v/mathslib.svg\r\n        :target: https://pypi.python.org/pypi/mathslib\r\n\r\n.. image:: https://readthedocs.org/projects/mathslib/badge/?version=latest\r\n        :target: https://mathslib.readthedocs.io/en/latest/?badge=latest\r\n        :alt: Documentation Status\r\n\r\n`mathslib`__ is a compilation of Mathematical Functions and Algorithms. Unless credit was given all\r\nof the functions were written by me. Relevant articles are also linked where the implementation is complex.\r\n\r\nI have used most of these for `Project Euler`_.\r\n \r\nSee my website `ivl-projecteuler.com`_ for their implementation\r\n\r\nSee the full documentation `here`_\r\n\r\nBreakdown\r\n---------\r\n+----------------+------------------------------------------------------------+\r\n|numtheory.py    | * phi(x)                                                   |\r\n|                | * phi_sieve(x)                                             |\r\n|                | * phi_sum(x)                                               |\r\n|                | * mobius(x)                                                |\r\n|                | * mobius_k_sieve(limit, k)                                 |\r\n|                | * count_k_free(n, k)                                       |\r\n|                | * pythagorean_triples(limit, non_primitive)                |\r\n|                | * count_primitive_pythagorean_triples(n)                   |\r\n|                | * k_smooth_numbers(max_prime, limit)                       |\r\n|                | * k_powerful(k, limit, count)                              |\r\n|                | * legendre_factorial(x)                                    |\r\n|                | * tonelli_shanks(a, p)                                     |\r\n|                | * chinese_remainder_theorem(a1, a2, n1, n2)                |\r\n|                | * generalised_CRT(a1, a2, n1, n2)                          |\r\n|                | * frobenius_number(\\*integers)                             |\r\n|                | * continued_fraction(x)                                    |\r\n|                | * overall_fraction(x)                                      |\r\n|                | * partition(x, L, show)                                    |\r\n+----------------+------------------------------------------------------------+\r\n|primes.py       | * prime_sieve(limit, block_size, segment, values)          |\r\n|                | * is_prime(x)                                              |\r\n|                | * prime_factors(x)                                         |\r\n|                | * spf_sieve(x)                                             |\r\n|                | * primepi(x)                                               |\r\n|                | * primepi_sieve(x)                                         |\r\n|                | * sum_of_primes(x)                                         |\r\n|                | * fermat_primality_test(x)                                 |\r\n|                | * miller_primality_test(n, millerrabin, numoftests)        |\r\n+----------------+------------------------------------------------------------+\r\n|divisors.py     | * divisors(x, proper)                                      |\r\n|                | * divisor(x, n)                                            |\r\n|                | * divisor_sieve(x, n)                                      |\r\n+----------------+------------------------------------------------------------+\r\n|linalg.py       | * gauss_jordan_elimination(matrix, augmentedpart)          |\r\n|                | * solve(M, b)                                              |\r\n|                | * inverse(matrix)                                          |\r\n|                | * determinant(matrix)                                      |\r\n|                | * matrix_addition(A, B, subtract)                          |\r\n|                | * identity(l, val)                                         |\r\n|                | * concatenate(A, B)                                        |\r\n|                | * argmax(alist)                                            |\r\n|                | * fillmatrix(size, val)                                    |\r\n|                | * matrix_mul(A, B)                                         |\r\n|                | * matrix_pow(A, n)                                         |\r\n+----------------+------------------------------------------------------------+\r\n|fib.py          | * fibonacci(n, m)                                          |\r\n|                | * fib_till(limit)                                          |\r\n|                | * zeckendorf_representation(x)                             |\r\n+----------------+------------------------------------------------------------+\r\n|algorithms.py   | * prims_algorithm(matrix)                                  |\r\n|                | * dijkstras_algorithm(graph, start_node, INFINITY)         |\r\n|                | * floyd_warshall_algorithm(graph, INFINITY)                |\r\n|                | * knap_sack(values, weights, n, W, no_values)              |\r\n|                | * knap_sack_values(values, weights, n, W, no_values)       |\r\n|                | * BFS(g, start_node, end_node)                             |\r\n|                | * DFS(g, start_node, end_node)                             |\r\n|                | * convex_hull_gift_wrapping(pts)                           |\r\n|                | * convex_hull_DC(pts)                                      |\r\n+----------------+------------------------------------------------------------+\r\n|simple.py       | * bin_exp(a, b, c, n, m)                                   | \r\n|                | * number_to_base(n, b)                                     |\r\n|                | * extended_euclidean_algorithm(n, b)                       |\r\n|                | * lcm(a_list)                                              |\r\n|                | * mod_division(a, b, m)                                    |\r\n|                | * bisect(alist, goal)                                      |\r\n|                | * is_clockwise(a, b, c)                                    |\r\n+----------------+------------------------------------------------------------+\r\n\r\n.. _Project Euler: https://projecteuler.net\r\n.. _ivl-projecteuler.com: https://ivl-projecteuler.com\r\n.. _mathslib1: https://pypi.python.org/pypi/mathslib\r\n.. _here: https://mathslib.readthedocs.io/en/latest/index.html\r\n__ mathslib1_\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Library of Mathematical functions and Algorithms",
    "version": "3.2.0",
    "project_urls": {
        "Bug Reports": "https://github.com/igorvanloo/mathslib/issues",
        "Homepage": "https://github.com/igorvanloo/mathslib",
        "Source": "https://github.com/igorvanloo/mathslib"
    },
    "split_keywords": [
        "numbertheory",
        " maths",
        " algorithms"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f53c38e73786dcb3a693e066c324fd9eb9ef147f9b3041a09536c04b08f61eb9",
                "md5": "4c5725127064fd4ba6caebe49d4947cc",
                "sha256": "0625bbe5cad957a5083e3ad284853e23f00349da7e76430d2b5127004c2f7541"
            },
            "downloads": -1,
            "filename": "mathslib-3.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4c5725127064fd4ba6caebe49d4947cc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=3.7",
            "size": 30734,
            "upload_time": "2025-01-12T10:28:55",
            "upload_time_iso_8601": "2025-01-12T10:28:55.112966Z",
            "url": "https://files.pythonhosted.org/packages/f5/3c/38e73786dcb3a693e066c324fd9eb9ef147f9b3041a09536c04b08f61eb9/mathslib-3.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c88643e798c3328ff0fd43c038408991625479d5adbcd487b7a701b985732217",
                "md5": "89577d1fb9b99324a3a1dcb25d930483",
                "sha256": "af3484ce75becad38b3815d3394e035659feb3af49368aac0b686a0324d7b6a9"
            },
            "downloads": -1,
            "filename": "mathslib-3.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "89577d1fb9b99324a3a1dcb25d930483",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.7",
            "size": 24519,
            "upload_time": "2025-01-12T10:28:59",
            "upload_time_iso_8601": "2025-01-12T10:28:59.475585Z",
            "url": "https://files.pythonhosted.org/packages/c8/86/43e798c3328ff0fd43c038408991625479d5adbcd487b7a701b985732217/mathslib-3.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-12 10:28:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "igorvanloo",
    "github_project": "mathslib",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "mathslib"
}
        
Elapsed time: 4.01742s