{"id":25878414,"url":"https://github.com/fionn/lagrange-polynomial","last_synced_at":"2026-06-13T07:31:52.198Z","repository":{"id":57677616,"uuid":"248531122","full_name":"fionn/lagrange-polynomial","owner":"fionn","description":"Numerical Lagrange polynomials over 𝔽ₚ","archived":false,"fork":false,"pushed_at":"2025-09-09T08:55:59.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-29T21:04:35.121Z","etag":null,"topics":["cryptography","lagrange-polynomial-interpolation","numerical-methods"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/lagrange-polynomial/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fionn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-19T14:57:58.000Z","updated_at":"2025-09-09T08:55:56.000Z","dependencies_parsed_at":"2022-09-13T13:02:31.260Z","dependency_job_id":null,"html_url":"https://github.com/fionn/lagrange-polynomial","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/fionn/lagrange-polynomial","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fionn%2Flagrange-polynomial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fionn%2Flagrange-polynomial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fionn%2Flagrange-polynomial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fionn%2Flagrange-polynomial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fionn","download_url":"https://codeload.github.com/fionn/lagrange-polynomial/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fionn%2Flagrange-polynomial/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34276501,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cryptography","lagrange-polynomial-interpolation","numerical-methods"],"created_at":"2025-03-02T12:30:39.158Z","updated_at":"2026-06-13T07:31:52.179Z","avatar_url":"https://github.com/fionn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lagrange Polynomials\n\nModule to generate Lagrange polynomials over integers for 1-dimensional data.\nThis is generally useful for interpolation.\n\n## Installation\n\nInstall with `pip`.\n\n## Usage\n\n### Example\n\n```python\nfrom lagrange_polynomial import LagrangePolynomial\n\nxs = range(100)\nys = [f(x) for x in xs]          # For some function f\n\nlp = LagrangePolynomial(xs, ys)  # Instantiate a polynomial with sequences of\n                                 # x- and y-coordinates.\n\nfor x in xs:\n    assert ys[x] == lp(x)        # Polynomial will intersect original points\n    coefficient = lp.basis[0](x) # Get the 0th basis vector at x\n```\n\n### Interface\n\nThe `LagrangePolynomial` class takes two equally-sized sequences and an optional integer _p_.\nThe instance is a Lagrange polynomial _L_: _x_ -\u003e _L_(_x_) over GF(_p_). If _p_ is not provided, it defaults to the 8\u003csup\u003eth\u003c/sup\u003e Mersenne prime _M_\u003csub\u003e31\u003c/sub\u003e.\n\nIt has a `basis` property, a `LagrangeBasis` object subclassing `Sequence`.\nEach element _ℓⱼ_ indexed by integers _j_ in `range(len(xs))` is a function taking _x_ to its _j_\u003csup\u003eth\u003c/sup\u003e basis vector _ℓⱼ_(_x_).\n\n## Test\n\nTest with `make test`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffionn%2Flagrange-polynomial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffionn%2Flagrange-polynomial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffionn%2Flagrange-polynomial/lists"}