const ex & ebasis = level==1 ? basis : basis.eval(level-1);
const ex & eexponent = level==1 ? exponent : exponent.eval(level-1);
- const numeric *num_basis = NULL;
- const numeric *num_exponent = NULL;
+ const numeric *num_basis = nullptr;
+ const numeric *num_exponent = nullptr;
if (is_exactly_a<numeric>(ebasis)) {
num_basis = &ex_to<numeric>(ebasis);
// NB: Partition must be sorted in non-decreasing order.
explicit coolmulti(const std::vector<int>& partition)
{
- head = NULL;
+ head = nullptr;
for (unsigned n = 0; n < partition.size(); ++n) {
head = new element(partition[n], head);
if (n <= 1)
void next_permutation()
{
element *before_k;
- if (after_i->next != NULL && i->value >= after_i->next->value)
+ if (after_i->next != nullptr && i->value >= after_i->next->value)
before_k = after_i;
else
before_k = i;
}
bool finished() const
{
- return after_i->next == NULL && after_i->value >= head->value;
+ return after_i->next == nullptr && after_i->value >= head->value;
}
} cmgen;
bool atend; // needed for simplifying iteration over permutations
{
coolmulti::element* it = cmgen.head;
size_t i = 0;
- while (it != NULL) {
+ while (it != nullptr) {
composition[i] = it->value;
it = it->next;
++i;