Charles Greathouse on Tue, 06 Sep 2016 22:32:21 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

No more vector gcd and lcm?


Recently changes were committed to the git version to drop support for gcd and lcm on vectors (and columns and matrices). This has been a useful feature, is there a reason for dropping it?

There are a thousand sequences in the OEIS which use lcm or gcd and it's not entirely clear which use the version that was removed. (Probably not that many, but still, breaking changes are bad.)

Of course fold can be used to replace these constructs, but this can be very much slower in the case of lcm. vector(10^6,i,random(10^6)+1) is 300x slower with fold than with the original version. (In fairness, I don't know of any applications of huge LCMs of big numbers.)

Charles Greathouse
Case Western Reserve University