{"id":21934942,"url":"https://github.com/tueda/donuts","last_synced_at":"2025-03-22T13:42:17.095Z","repository":{"id":147125023,"uuid":"203774149","full_name":"tueda/donuts","owner":"tueda","description":"A wrapper library for Rings: ⭕ + ⚡ = 🍩","archived":false,"fork":false,"pushed_at":"2024-02-10T08:51:40.000Z","size":382,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-27T13:12:51.301Z","etag":null,"topics":["computer-algebra","java","mathematics","multivariate-polynomials","wrapper"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tueda.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-08-22T10:48:35.000Z","updated_at":"2021-12-04T16:40:14.000Z","dependencies_parsed_at":"2023-12-27T10:24:16.901Z","dependency_job_id":"f08980a2-b31c-4ec5-8668-7aa5ba30a063","html_url":"https://github.com/tueda/donuts","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tueda%2Fdonuts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tueda%2Fdonuts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tueda%2Fdonuts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tueda%2Fdonuts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tueda","download_url":"https://codeload.github.com/tueda/donuts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244966458,"owners_count":20539794,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["computer-algebra","java","mathematics","multivariate-polynomials","wrapper"],"created_at":"2024-11-29T00:17:47.715Z","updated_at":"2025-03-22T13:42:17.076Z","avatar_url":"https://github.com/tueda.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Donuts\n======\n\n[![Test](https://github.com/tueda/donuts/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/tueda/donuts/actions?query=branch:main)\n[![Release](https://jitpack.io/v/tueda/donuts.svg)](https://jitpack.io/#tueda/donuts)\n[![Javadoc](https://img.shields.io/badge/javadoc-latest-brightgreen.svg)](https://jitpack.io/com/github/tueda/donuts/latest/javadoc/)\n\nA wrapper library for [Rings](https://github.com/PoslavskySV/rings).\n\nThis library provides polynomial arithmetic operations based on the Rings\nlibrary by Stanislav Poslavsky. The main difference from Rings is that this library\nallows operations between different polynomial rings; for example, addition of\ntwo polynomials in Z[x,\u0026nbsp;y] and Z[y,\u0026nbsp;z], respectively, gives a\npolynomial in Z[x,\u0026nbsp;y,\u0026nbsp;z].\n\nCurrently, the following wrapper classes are available:\n\n| Donuts             | Rings                                          |\n| ------------------ | ---------------------------------------------- |\n| `Polynomial`       | `MultivariatePolynomial\u003cBigInteger\u003e`           |\n| `RationalFunction` | `Rational\u003cMultivariatePolynomial\u003cBigInteger\u003e\u003e` |\n\nAll instances of the above classes of Donuts are *immutable* objects.\n\nA [Python binding](https://github.com/tueda/donuts-python) is available.\n\n\nRequirements\n------------\n\n- Java 8 or later\n\n\nExample\n-------\n\n```shell\n$ git clone https://github.com/tueda/donuts.git\n$ cd donuts\n$ ./gradlew shadowJar \u0026\u0026 jshell --class-path build/libs/donuts-*-all.jar # jshell is available in JDK9+\n```\n```java\njshell\u003e import com.github.tueda.donuts.*\n\njshell\u003e var a = new Polynomial(\"1 + x + y\") // in Z[x, y]\na ==\u003e 1+y+x\n\njshell\u003e var b = new Polynomial(\"1 + y + z\") // in Z[y, z]\nb ==\u003e 1+z+y\n\njshell\u003e var g = a.add(b) // in Z[x, y, z]\ng ==\u003e 2+z+2*y+x\n\njshell\u003e var ag = a.multiply(g)\nag ==\u003e 2+z+4*y+3*x+y*z+x*z+2*y^2+3*x*y+x^2\n\njshell\u003e var bg = b.multiply(g)\nbg ==\u003e 2+3*z+4*y+x+z^2+3*y*z+x*z+2*y^2+x*y\n\njshell\u003e ag.gcd(bg) // must be equal to g\n$7 ==\u003e 2+z+2*y+x\n\njshell\u003e ag.divide(bg) // same as new RationalFunction(ag, bg)\n$8 ==\u003e (1+y+x)/(1+z+y)\n\njshell\u003e new Polynomial(\"-2*x^4*y^3 + 2*x^3*y^4 + 2*x^2*y^5 - 2*x*y^6\").factors()\n$9 ==\u003e Polynomial[8] { -2, y, y, y, x, -y+x, -y+x, y+x }\n```\n\nDevelopment\n-----------\n\n```shell\n./gradlew spotlessApply      # code formatter\n./gradlew check              # build and test\n./gradlew jacocoTestReport   # code coverage\n./gradlew javadoc            # build documents\n./gradlew dependencyUpdates  # check dependency updates\n\n# Git hooks\npre-commit install\n\n# for releasing a new version\ngit-chglog --next-tag v1.0.0  # show the changelog, which must be added to CHANGELOG.md manually\n./gradlew release             # release a new version\n```\n\n\nAcknowledgements\n----------------\n\nThis software was developed as part of the project supported by JSPS KAKENHI Grant Number 19K03831.\n\n\nLicense\n-------\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftueda%2Fdonuts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftueda%2Fdonuts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftueda%2Fdonuts/lists"}