-#include "polynomial/upoly.hpp"
-#include "polynomial/upoly_io.hpp"
-#include "polynomial/mod_gcd.hpp"
-#include "ginac.h"
+/** @file exam_misc.cpp
+ *
+ * Testing modular GCD.
+ */
+
+/*
+ * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
#include <cln/random.h>
-#include <string>
#include <iostream>
#include <map>
+#include <string>
+
+#include "polynomial/upoly.h"
+#include "polynomial/upoly_io.h"
+#include "polynomial/mod_gcd.h"
+#include "ginac.h"
using namespace GiNaC;
static upoly ex_to_upoly(const ex& e, const symbol& x);
exvector tv(p.size());
for (std::size_t i = 0; i < p.size(); ++i)
tv[i] = pow(x, i)*numeric(p[i]);
- return (new add(tv))->setflag(status_flags::dynallocated);
+ return dynallocate<add>(tv);
}
static upoly make_random_upoly(const std::size_t deg)
p[deg] = cln::random_I(biggish);
return p;
}
-