carl  24.04
Computer ARithmetic Library
SeparablePart.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "../Monomial.h"
4 
5 namespace carl {
6 
7 /**
8  * Calculates the separable part of this monomial.
9  * For a monomial \f$ \\prod_i x_i^{e_i}\f$ with \f$e_i \neq 0 \f$, this is \f$ \\prod_i x_i^1 \f$.
10  * @return Separable part.
11  */
13  Monomial::Content newExps;
14  for (auto& it: m) {
15  newExps.emplace_back(it.first, 1);
16  }
17  return createMonomial(std::move(newExps), m.num_variables());
18 }
19 
20 
21 }
carl is the main namespace for the library.
Monomial::Arg createMonomial(T &&... t)
Definition: MonomialPool.h:168
Monomial::Arg separable_part(const Monomial &m)
Calculates the separable part of this monomial.
Definition: SeparablePart.h:12
The general-purpose monomials.
Definition: Monomial.h:59
std::shared_ptr< const Monomial > Arg
Definition: Monomial.h:62
std::vector< std::pair< Variable, std::size_t > > Content
Definition: Monomial.h:63
std::size_t num_variables() const
Returns the number of variables that occur in the monomial.
Definition: Monomial.h:245