so that basis[[true, true, false]] should give the first two monomials, but instead we get the last two.
This also directly affects filter, since it internally uses boolean indexing: filter(mon -> degree(mon) == 1, basis) should give the first two elements, but it returns the last two.
Currently, indexing a monovec with a boolean array gives wrong results, as the implementation sorts the index array: https://github.com/JuliaAlgebra/DynamicPolynomials.jl/blob/2ca5cd58f993e8166f46420a1da17f11fba26537/src/monovec.jl#L42-L44
Therefore, regardless of how the
t
true values are distributed in the index array, we will always get thet
last monomials. Example:gives
so that
basis[[true, true, false]]
should give the first two monomials, but instead we get the last two.This also directly affects
filter
, since it internally uses boolean indexing:filter(mon -> degree(mon) == 1, basis)
should give the first two elements, but it returns the last two.