RobinHankin / freegroup

The free group in R
0 stars 0 forks source link

Free abelian group #31

Closed RobinHankin closed 1 year ago

RobinHankin commented 1 year ago

The free abelian group should be implemented using the STL map class.

typedef map<string, signed int> freeabelian;

On the other hand it might be better to dispense with symbolics and use strictly positive integers instead:

typedef map<unsigned int, signed int> freeabelian;

This would be more consistent with the rest of the package. The issue is similar to the Great Rewrite of the hyper2 package where I changed old-style to new-style.

Another issue is whether or not this functionality is sufficiently distinct from the rest of the package to have its own package.

RobinHankin commented 1 year ago

The polynomials of a single variable x, with integer coefficients, form a free abelian group under polynomial addition, with the powers of x as a basis. So we could use either mvp or polynom. But this is not particularly "nice", and in any event I would need to code up vectorized operations somehow.

RobinHankin commented 1 year ago

See the frab package at https://cran.r-project.org/package=frab