flint icon indicating copy to clipboard operation
flint copied to clipboard

Global field accessor macros for matrices and polynomials

Open albinahlback opened this issue 1 year ago • 0 comments

If all matrix and polynomials of different types are on the same form, why not set global macros such as

#define flint_mat_entry(mat,i,j) ((mat)->rows[i] + (j))
#define flint_mat_nrows(mat) ((mat)->r)
#define flint_mat_ncols(mat) ((mat)->c)

#define flint_poly_coeffs(poly) ((poly)->coeffs)
#define flint_poly_length(poly) ((poly)->length)
#define flint_poly_alloc(poly) ((poly)->alloc)
#define flint_poly_degree(poly) ((poly)->length - 1)

Feels like it should yield very consistent internals.

albinahlback avatar May 17 '24 21:05 albinahlback