16 auto leftIt = left.
begin();
17 auto rightIt = right.
begin();
18 auto leftEnd = left.
end();
19 auto rightEnd = right.
end();
20 auto resultIt =
result.begin();
24 if (leftIt == leftEnd)
29 std::copy(rightIt.loc(),rightEnd.loc(),resultIt.loc());
30 resultIt += ((rightEnd.loc() - rightIt.loc()) >> 1);
34 if (rightIt == rightEnd)
39 std::copy(leftIt.loc(),leftEnd.loc(),resultIt.loc());
40 resultIt += ((leftEnd.loc() - leftIt.loc()) >> 1);
44 if (leftIt.var() < rightIt.var())
47 std::copy(leftIt.loc(), leftIt.loc() + 2, resultIt.loc());
51 else if (leftIt.var() > rightIt.var())
54 std::copy(rightIt.loc(), rightIt.loc() + 2, resultIt.loc());
61 resultIt.loc()[0] = leftIt.var();
62 auto temp = bothFunc(leftIt.power(), rightIt.power());
65 resultIt.loc()[1] = bothFunc(leftIt.power(), rightIt.power());
73 *
rng.first = resultIt.loc() -
rng.first;
116 const std::vector<std::string>& varnames,
123 for (
auto t = m.
begin(); t != m.
end(); ++t)
127 if (v >= varnames.size() or v < 0)
newf4::MonomialView — non-owning view over a [length, var_1, e_1, ...]-encoded monomial.
std::pair< T *, T * > shrinkLastAllocate(T *begin, T *end, T *newtop)
std::pair< T *, T * > allocateArray(size_t nelems)
Thin RAII wrapper around memtailor::Arena providing bump-pointer array allocation with optional mutex...
MonomialView(MonomialInt *data)
static MonomialView quotient(const MonomialView &left, const MonomialView &right, MemoryBlock &block)
static void display(std::ostream &o, const std::vector< std::string > &varnames, const newf4::MonomialView &m)
static MonomialView combine(const MonomialView &left, const MonomialView &right, bool copyLeft, bool copyRight, std::function< int(int, int)>, MemoryBlock &block)
auto begin() const -> MonomialIterator< true >
auto end() const -> MonomialIterator< true >
static MonomialView lcm(const MonomialView &left, const MonomialView &right, MemoryBlock &block)
static MonomialView product(const MonomialView &left, const MonomialView &right, MemoryBlock &block)
namespace exc — internal C++ exception types and the TRY / CATCH macro pair.
VALGRIND_MAKE_MEM_DEFINED & result(result)