shwaka / kohomology

Cohomology calculator for Sullivan algebras
https://shwaka.github.io/kohomology
GNU General Public License v3.0
2 stars 0 forks source link

Use "binary GCD" algorithm #308

Open shwaka opened 1 year ago

shwaka commented 1 year ago

"binary GCD" を使うと速く計算できるらしい。 先にgcd用のテストを書いた方が良い気がする。

Reference:

shwaka commented 1 year ago

ionspin/kotlin-multiplatform-bignum では binary GCD を使って実装してるっぽい。

https://github.com/ionspin/kotlin-multiplatform-bignum/blob/281d0e79ddc48883134bdbf91224c967bcbe6aee/bignum/src/commonMain/kotlin/com/ionspin/kotlin/bignum/integer/base63/array/BigInteger63Arithmetic.kt#L1731-L1743

shwaka commented 1 year ago

java.math.BigInteger.gcd も binary GCD で実装されてるっぽい?

shwaka commented 1 year ago

とりあえず JavaRationaljava.math.BigInteger.gcd を使ってみた cba1b695032b1684116c448d5ee74f7c044d3a72