mathslib


Namemathslib JSON
Version 3.3.0 PyPI version JSON
download
home_pagehttps://github.com/igorvanloo/mathslib
SummaryLibrary of Mathematical functions and Algorithms
upload_time2025-02-15 15:25:53
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)          |
|                | * prime_sieve_in_range(low_limit, upp_limit, 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)                                      |
+----------------+------------------------------------------------------------+
|gaussianint.py  | * GI                                                       |
|                | * conj(self)                                               |
|                | * norm_sq(self)                                            |
|                | * prime_fac(self)                                          |
|                | * rem(x, y)                                                |
|                | * gcd(x, y)                                                |
+----------------+------------------------------------------------------------+
|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)                                    |
|                | * binom(n, k, p)                                           |
|                | * 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/31/49/40012a872ea7bc4f7791f079a452705771f2535253db13b312bd742b1d0e/mathslib-3.3.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|                | * prime_sieve_in_range(low_limit, upp_limit, 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|gaussianint.py  | * GI                                                       |\r\n|                | * conj(self)                                               |\r\n|                | * norm_sq(self)                                            |\r\n|                | * prime_fac(self)                                          |\r\n|                | * rem(x, y)                                                |\r\n|                | * gcd(x, y)                                                |\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|                | * binom(n, k, p)                                           |\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.3.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": "f276f7ec04c2ae11256376b286e9f839b798fa32906e8e731571976a7ea748ee",
                "md5": "f5b70f49d16ff0eaf0629e7c2f274028",
                "sha256": "0aa9fa7f6952310fba30a7372d957ff6adfa97ba630fd77e81a39e70e75a28b7"
            },
            "downloads": -1,
            "filename": "mathslib-3.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f5b70f49d16ff0eaf0629e7c2f274028",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=3.7",
            "size": 33686,
            "upload_time": "2025-02-15T15:25:51",
            "upload_time_iso_8601": "2025-02-15T15:25:51.766470Z",
            "url": "https://files.pythonhosted.org/packages/f2/76/f7ec04c2ae11256376b286e9f839b798fa32906e8e731571976a7ea748ee/mathslib-3.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "314940012a872ea7bc4f7791f079a452705771f2535253db13b312bd742b1d0e",
                "md5": "301f8f7aa3a8f568c4e8e0428c54d099",
                "sha256": "da2c614ad461fbacbd98679c3190b7b1a18452d9418432d37309cf54739679be"
            },
            "downloads": -1,
            "filename": "mathslib-3.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "301f8f7aa3a8f568c4e8e0428c54d099",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.7",
            "size": 27180,
            "upload_time": "2025-02-15T15:25:53",
            "upload_time_iso_8601": "2025-02-15T15:25:53.498341Z",
            "url": "https://files.pythonhosted.org/packages/31/49/40012a872ea7bc4f7791f079a452705771f2535253db13b312bd742b1d0e/mathslib-3.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-15 15:25:53",
    "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: 0.41732s