- Added copyright and GPL licencing to new files.
- Increased year to 2009.
- Changed guarding macros in header to uniform pattern without leading or
trailing __ (double underscores).
- Put includes of system wide header consistently below own includes (help
a tiny bit to clarify dependencies).
-/**
- * @file bugme_chinrem_gcd.cpp
- * A small program exposing historical bug in poly_cra function.
+/** @file bugme_chinrem_gcd.cpp
+ *
+ * A small program exposing historical bug in poly_cra function. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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 <string>
-#include <iostream>
+
#include "ginac.h"
+
+#include <iostream>
+#include <string>
using namespace std;
-namespace GiNaC
-{
+
+namespace GiNaC {
extern ex chinrem_gcd(const ex& A, const ex& B);
}
+
using namespace GiNaC;
static const std::string p1_srep("\
-936639990-14679334842*x^9-6214147095*x^35+22219362387*x^69-31276301429*x^25+1199649580*x^98+2134905268*x^56+25591410149*x^72+5507703343*x^11+18467021749*x^43+11196778577*x^85+26050790733*x^29-178435747*x^2+1890708440*x^88-561107347*x^13-31038290506*x^51-1330154020*x^15+23467669465*x^59-3966988360*x^16+26794929142*x^38+11598735101*x^75-8608995580*x^3-30174373832*x^46+3580061526*x^91+7814495607*x^20+6624766926*x^78-11990574398*x^54-6863205889*x^33-319408644*x^65-11580405260*x^41-9654281719*x^81+23532819511*x^24-3890383043*x^94+27682281779*x^62+1363904895*x^68-272899085*x^49-933592128*x^97-2954269379*x^28+8432066353*x^36+14038262112*x^71-5474416933*x^84+741141010*x^100+38375274669*x^57-19509035058*x^44-1029159530*x^87+17276957972*x^8+23471621465*x^19-4745283802*x^74-15331409214*x^23-1261023993*x^90+17469329915*x^52-7544450778*x^64+12293848678*x^10-12162845828*x^39+11912265375*x^77-35110566664*x^27-5872201799*x^60+16636451249*x^80-6663332709*x^12+26248623452*x^47+2292551912*x^93-13410537172*x^14+4255578378*x^55+11614165303*x^31-6270990007*x^34-6744628155*x^67+3692350529*x^96-17204774085*x^63-11157075535*x^18+4275663006*x^70+18517327396*x^42+2030662033*x^83-3435911855*x^50-227816977*x^99+4507833875*x-41046742100*x^37+9385606040*x^73-5892518210*x^22+512268187*x^86+9183261708*x^58-2542140060*x^4-19627087954*x^45+142491112*x^89-4846605217*x^26-4503859503*x^30-38388107386*x^32+2123912816*x^5-2508504600*x^76-15282350857*x^53-12217636980*x^40-4828562936*x^79+1788729074*x^6-967823912*x^92+6436149609*x^7+44704228721*x^61+21474090980*x^17+36034512058*x^66+10918084347*x^21+1913801599*x^82+1530941050*x^48-7104898913*x^95");
-
static const std::string p2_srep("\
1882371920+29943249139*x^9-21558061051*x^35+24497174109*x^69+3363043648*x^25+5186524611*x^98-17753230977*x^56+16461882236*x^72+11039962159*x^11-85814533599*x^43-12986831645*x^85+4813620791*x^29-2133682609*x^2+9141433582*x^88-14841292646*x^13+19494168654*x^51-426278523*x^15-18246235652*x^59-12424469513*x^16-14414308862*x^38-16262001424*x^75+1584505491*x^3+6616907060*x^46+9411879011*x^91+7056872613*x^20+29675566382*x^78-48441925739*x^54+12038293769*x^33-22463329638*x^65+21957440404*x^41+26252749471*x^81-28689993421*x^24+1190623161*x^94-3323333429*x^62+778770195*x^68-23673866858*x^49+10263027507*x^97+29115114125*x^28-34230002076*x^36-217623403*x^71-6344703601*x^84+2789684836*x^100-44973929094*x^57-6061422988*x^44+18964048763*x^87+3160532878*x^8-8039690791*x^19-5750277357*x^74+5544486596*x^23+1800283356*x^90-8174921854*x^52+2577247520*x^64-1088265300*x^10+18566882873*x^39+12678193001*x^77-7204610489*x^27+9980611956*x^60+12672890141*x^80+4463462090*x^12-30937311949*x^47-3883570155*x^93+7561875663*x^14-3850452489*x^55+20714527103*x^31-9973372012*x^34+440594870*x^67+10385086102*x^96-20693764726*x^63+11049483001*x^18-11578701274*x^70-5548876327*x^42+20393397488*x^83+20531692560*x^50+1309311388*x^99-7521320830*x-2750892631*x^37-6001481047*x^73+7149046134*x^22+10287410396*x^86+7332053562*x^58-1135211878*x^4-7420079075*x^45+9742202475*x^89-214559874*x^26+29530802947*x^30-2280622009*x^32-4237029618*x^5+13760397067*x^76+18073788685*x^53+2485463829*x^40+1889202286*x^79+8841198971*x^6+13562767020*x^92+110919258*x^7+6961020716*x^61+11700952246*x^17-13528331424*x^66-19801882818*x^21+25061328813*x^82+1553111326*x^48+4638169279*x^95");
cout << "not found.";
return 0;
}
-
* functions. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <cstdlib> // rand()
#include "ginac.h"
-using namespace std;
using namespace GiNaC;
+#include <cstdlib> // for rand()
+#include <iostream>
+using namespace std;
+
/* Some tests on the sine trigonometric function. */
static unsigned inifcns_check_sin()
{
* the underlying symbolic manipulations. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "ginac.h"
+using namespace GiNaC;
+
+#include <cstdlib> // for rand()
#include <iostream>
#include <sstream>
-#include <cstdlib> // rand()
-#include "ginac.h"
using namespace std;
-using namespace GiNaC;
extern const ex
dense_univariate_poly(const symbol & x, unsigned degree);
* manipulations. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <cstdlib> // rand(), RAND_MAX
#include "ginac.h"
-using namespace std;
using namespace GiNaC;
+#include <cstdlib> // for rand(), RAND_MAX
+#include <iostream>
+using namespace std;
+
extern const ex
sparse_tree(const symbol & x, const symbol & y, const symbol & z,
int level, bool trig = false, bool rational = true,
* tests on these numbers like is_integer() etc... */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <cstdlib> // rand()
#include "ginac.h"
-using namespace std;
using namespace GiNaC;
+#include <cstdlib> // for rand()
+#include <iostream>
+using namespace std;
+
/* Simple and maybe somewhat pointless consistency tests of assorted tests and
* conversions. */
static unsigned check_numeric1()
-#ifndef GINAC_CHECK_ERROR_REPORT_HPP
-#define GINAC_CHECK_ERROR_REPORT_HPP
+/** @file error_report.h
+ *
+ * Macro for additional debugging output.
+ */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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
+ */
+
+#ifndef GINAC_CHECK_ERROR_REPORT_H
+#define GINAC_CHECK_ERROR_REPORT_H
+
#include <sstream>
#include <stdexcept>
} \
} while (0)
-#endif // GINAC_CHECK_ERROR_REPORT_HPP
-
+#endif // ndef GINAC_CHECK_ERROR_REPORT_H
* Here we test GiNaC's archiving system. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <fstream>
#include "ginac.h"
-using namespace std;
using namespace GiNaC;
+#include <fstream>
+#include <iostream>
+using namespace std;
+
unsigned exam_archive()
{
unsigned result = 0;
* Here we test GiNaC's Clifford algebra objects. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
#include "ginac.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+using namespace std;
+
const numeric half(1, 2);
static unsigned check_equal(const ex &e1, const ex &e2)
* Here we test GiNaC's color objects (su(3) Lie algebra). */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
#include "ginac.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+using namespace std;
+
static unsigned check_equal(const ex &e1, const ex &e2)
{
ex e = e1 - e2;
-#include <iostream>
+/** @file exam_cra.cpp
+ *
+ * Test of Chinese remainder algorithm. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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 "polynomial/cra_garner.h"
+
#include <cln/integer.h>
#include <cln/integer_io.h>
#include <cln/random.h>
#include <cln/numtheory.h>
-#include "polynomial/cra_garner.h"
+using namespace cln;
+#include <iostream>
+#include <limits>
#include <map>
-#include <vector>
#include <stdexcept>
-#include <limits>
-using namespace cln;
+#include <vector>
using namespace std;
/// Generate a sequences of primes p_i such that \prod_i p_i < limit
std::cerr << v[i] << " ";
std::cerr << "]";
}
-
* Tests for symbolic differentiation, including various functions. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
#include "ginac.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+using namespace std;
+
static unsigned check_diff(const ex &e, const symbol &x,
const ex &d, unsigned nth=1)
{
* Factorization test suite. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
#include "ginac.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+using namespace std;
+
static symbol w("w"), x("x"), y("y"), z("z");
static unsigned check_factor(const ex& e)
* Regression tests for the exhashmap<> container. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
#include "ginac.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+using namespace std;
+
unsigned exam_hashmap()
{
unsigned result = 0;
* Here we test manipulations on GiNaC's indexed objects. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
#include "ginac.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+using namespace std;
+
static unsigned check_equal(const ex &e1, const ex &e2)
{
ex e = e1 - e2;
* functions. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
#include "ginac.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+using namespace std;
+
/* Assorted tests on other transcendental functions. */
static unsigned inifcns_consist_trans()
{
* functions. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <fstream>
#include "ginac.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+#include <fstream>
+using namespace std;
////////////////////////////////////////////////////////////////////////////////
+/** @file exam_inifcns_nstdsums.h
+ *
+ * Comparison data for the test of polylogarithms. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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
+ */
+
string data[] = {
"1",
"1",
* These exams test solving small linear systems of symbolic equations. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
#include "ginac.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+using namespace std;
+
static unsigned exam_lsolve1()
{
// A trivial example.
* Here we examine manipulations on GiNaC's symbolic matrices. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <stdexcept>
-#include <iostream>
#include "ginac.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+#include <stdexcept>
+using namespace std;
+
static unsigned matrix_determinants()
{
unsigned result = 0;
*/
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
#include "ginac.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+using namespace std;
+
#define VECSIZE 30
static unsigned exam_expand_subs()
{
+/** @file exam_misc.cpp
+ *
+ * Testing modular GCD.
+ */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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 <iostream>
+#include <map>
+#include <string>
+
#include "polynomial/upoly.h"
#include "polynomial/upoly_io.h"
#include "polynomial/mod_gcd.h"
#include "ginac.h"
-#include <cln/random.h>
-#include <string>
-#include <iostream>
-#include <map>
using namespace GiNaC;
static upoly ex_to_upoly(const ex& e, const symbol& x);
p[deg] = cln::random_I(biggish);
return p;
}
-
* Rational function normalization test suite. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
#include "ginac.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+using namespace std;
+
static symbol w("w"), x("x"), y("y"), z("z");
static unsigned check_normal(const ex &e, const ex &d)
* tests on these numbers like is_integer() etc... */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <sstream>
#include "ginac.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+#include <sstream>
+using namespace std;
/* Simple and maybe somewhat pointless consistency tests of assorted tests and
* conversions. */
* these oopses for good, so we run those stupid tests... */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
#include "ginac.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+using namespace std;
+
// The very first pair of historic problems had its roots in power.cpp and was
// finally resolved on April 27th 1999. (Fixing the first on April 23rd
// actually introduced the second.)
* rational function normalization in normalization.cpp. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
#include "ginac.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+using namespace std;
+
const int MAX_VARIABLES = 3;
static symbol x("x"), z("z");
* this code, it is a sanity check rather deeply rooted in GiNaC's classes. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
#include "ginac.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+using namespace std;
+
static unsigned exam_powerlaws1()
{
// (x^a)^b = x^(a*b)
* Series expansion test (Laurent and Taylor series). */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
#include "ginac.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+using namespace std;
+
static symbol x("x");
static unsigned check_series(const ex &e, const ex &point, const ex &d, int order = 8)
* Small test for the structure<> template. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
#include "ginac.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+using namespace std;
struct sprod_s {
ex left, right;
* input in the consistency checks. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <cstdlib>
#include "ginac.h"
-using namespace std;
using namespace GiNaC;
+#include <cstdlib>
+using namespace std;
+
/* Create a dense univariate random polynomial in x.
* (of the form 9 - 22*a - 17*a^2 + 14*a^3 + 7*a^4 + 7a^5 if degree==5) */
const ex
-/**
- * @file heur_gcd_oops.cpp Check for a bug in heur_gcd().
+/** @file heur_gcd_bug.cpp
*
- * heur_gcd() did not check if the arguments are integer polynomials
- * (and did not convert them to integer polynomials), which lead to
- * endless loop or (even worse) wrong result.
+ * heur_gcd_oops.cpp Check for a bug in heur_gcd().
+ *
+ * heur_gcd() did not check if the arguments are integer polynomials
+ * (and did not convert them to integer polynomials), which lead to
+ * endless loop or (even worse) wrong result. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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 <iostream>
+
#include "ginac.h"
using namespace GiNaC;
+
+#include <iostream>
using namespace std;
int main(int argc, char** argv)
}
return 0;
}
-
-/**
- * @file match_bug.cpp
+/** @file match_bug.cpp
*
- * Check for bug in GiNaC::ex::match() described here:
- * http://www.ginac.de/pipermail/ginac-devel/2006-April/000942.html
+ * Check for bug in GiNaC::ex::match() described here:
+ * http://www.ginac.de/pipermail/ginac-devel/2006-April/000942.html */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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 "ginac.h"
#include "error_report.h"
+
#include <iostream>
using namespace GiNaC;
std::cout << "not found. ";
return 0;
}
-
-/**
- * @file mul_eval_memleak.cpp Test for memory leak in {mul,power}::eval
+/** @file mul_eval_memleak.cpp
*
- * The bug was introduced by
+ * mul_eval_memleak.cpp Test for memory leak in {mul,power}::eval
*
- * commit f418c6ee4d558c852e1fb95533af07a3ae43f409
- * Author: Alexei Sheplyakov <varg@theor.jinr.ru>
- * Date: Wed Jul 11 14:34:42 2007 +0400
- * (it was commited into the official branch as
- * commit a602d34c225dceb3e53742a7b3e19a4b5e280485
- * Author: Jens Vollinga <vollinga@thep.physik.uni-mainz.de>
- * Date: Wed Jul 11 21:07:40 2007 +0000)
+ * The bug was introduced by
+ *
+ * commit f418c6ee4d558c852e1fb95533af07a3ae43f409
+ * Author: Alexei Sheplyakov <varg@theor.jinr.ru>
+ * Date: Wed Jul 11 14:34:42 2007 +0400
+ * (it was commited into the official branch as
+ * commit a602d34c225dceb3e53742a7b3e19a4b5e280485
+ * Author: Jens Vollinga <vollinga@thep.physik.uni-mainz.de>
+ * Date: Wed Jul 11 21:07:40 2007 +0000)
*/
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
#include <ginac/ginac.h>
-#include <string>
+using namespace GiNaC;
+
+#include <iostream>
#include <stdexcept>
+#include <string>
using namespace std;
-using namespace GiNaC;
const unsigned check_mul_eval_memleak(const unsigned N)
{
}
return 0;
}
-
-/**
- * @file numeric_archive.cpp Check for a bug in numeric::archive
+/** @file numeric_archive.cpp
*
- * numeric::archive used to fail if the real part of a complex number
- * is a rational number and the imaginary part is a floating point one.
+ * Check for a bug in numeric::archive
+ *
+ * numeric::archive used to fail if the real part of a complex number
+ * is a rational number and the imaginary part is a floating point one. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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 "ginac.h"
+using namespace GiNaC;
+
+#include <algorithm>
#include <cln/cln.h>
#include <iostream>
-#include <stdexcept>
-#include <vector>
#include <iterator>
-#include <algorithm>
#include <sstream>
-#include "ginac.h"
+#include <stdexcept>
+#include <vector>
using namespace cln;
-using namespace GiNaC;
struct archive_unarchive_check
{
-/// @file parser_a_b.cpp Check for some silly bugs in the parser.
+/** @file parser_bugs.cpp
+ *
+ * Check for some silly bugs in the parser. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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 "ginac.h"
-#include <string>
+using namespace GiNaC;
+
#include <iostream>
-#include <stdexcept>
#include <sstream>
-using namespace GiNaC;
+#include <stdexcept>
+#include <string>
// - a - b was misparsed as -a + b due to a bug in parser::parse_unary_expr()
static int check1(std::ostream& err_str)
}
return errors;
}
-
-/**
- * This small program exhibits the memory leak in the ginac_yylex().
- * Run it as
+/** @file parser_memleak.cpp
*
- * valgrind --leak-check=yes ./parser_memleak
+ * This small program exhibits the memory leak in the ginac_yylex().
+ * Run it as
*
- * or simply
+ * valgrind --leak-check=yes ./parser_memleak
*
- * ulimit -v `expr 64 \* 1024` ./parser_memleak
+ * or simply
+ *
+ * ulimit -v `expr 64 \* 1024` ./parser_memleak
+ */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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 <ginac/ginac.h>
+using namespace GiNaC;
+
#include <iostream>
#include <stdexcept>
-#include <ginac/ginac.h>
using namespace std;
-using namespace GiNaC;
int main(int argc, char** argv) {
const symbol x("x"), y("y");
+/** @file randomize_serials.cpp
+ *
+ * Utilitiy function used by the benchmarks.
+ */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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 "ginac.h"
+using namespace GiNaC;
+
#include <cstdlib>
#include <ctime>
-#include "ginac.h"
using namespace std;
-using namespace GiNaC;
/** Generate a random amount of symbols and destroy them again immediatly.
* This operation effectively makes the serial numbers of all subsequent
symbol("dummy");
}
}
-
-
+/** @file test_runner.h
+ *
+ * Utility functions for benchmarking. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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
+ */
+
#ifndef GINAC_CHECK_TEST_RUNNER_H
#define GINAC_CHECK_TEST_RUNNER_H
-#include <iostream>
+
+#include "timer.h"
+
#include <cstdlib>
-#include <string>
#include <ctime>
-#include "timer.h"
+#include <iostream>
+#include <string>
template<typename T> static void
run_benchmark(T& benchmark,
return value;
}
-#endif // GINAC_CHECK_TEST_RUNNER_H
-
+#endif // ndef GINAC_CHECK_TEST_RUNNER_H
*/
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <utility>
-#include <vector>
-#include <set>
+#include "ginac.h"
+#include "timer.h"
+using namespace GiNaC;
+
#include <map>
-#include <typeinfo>
+#include <set>
#include <stdexcept>
-#include "timer.h"
-#include "ginac.h"
+#include <typeinfo>
+#include <utility>
+#include <vector>
using namespace std;
-using namespace GiNaC;
// whether to run this beast or not:
static const bool do_test = true;
* after which e should be just a1^2. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "ginac.h"
+#include "timer.h"
+using namespace GiNaC;
+
#include <iostream>
#include <sstream>
#include <vector>
-#include "ginac.h"
-#include "timer.h"
using namespace std;
-using namespace GiNaC;
static unsigned expand_subs(unsigned size)
{
*/
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
#include "ginac.h"
#include "timer.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+using namespace std;
+
static unsigned test()
{
unsigned result = 0;
* Some timings on series expansion of the Gamma function around a pole. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <vector>
#include "ginac.h"
#include "timer.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+#include <vector>
+using namespace std;
+
unsigned tgammaseries(unsigned order)
{
unsigned result = 0;
* Timings for exhashmap<> operations. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <vector>
#include "ginac.h"
#include "timer.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+#include <vector>
+using namespace std;
+
template <class T>
static void run_timing(unsigned size, double &time_insert, double &time_find, double &time_erase)
{
* Lewis and Michael Wester. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <vector>
#include "ginac.h"
#include "timer.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+#include <vector>
+using namespace std;
+
static unsigned test()
{
for (int i=1; i<=99; ++i)
* Lewis and Michael Wester. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <vector>
#include "ginac.h"
#include "timer.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+#include <vector>
+using namespace std;
+
static unsigned test()
{
numeric s;
* Lewis and Michael Wester. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <vector>
#include "ginac.h"
#include "timer.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+#include <vector>
+using namespace std;
+
static unsigned test()
{
numeric x(13*17*31);
* Lewis and Michael Wester. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <vector>
#include "ginac.h"
#include "timer.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+#include <vector>
+using namespace std;
+
static unsigned test()
{
ex s;
* Lewis and Michael Wester. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <vector>
#include "ginac.h"
#include "timer.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+#include <vector>
+using namespace std;
+
static unsigned test()
{
ex s;
* Lewis and Michael Wester. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <vector>
#include "ginac.h"
#include "timer.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+#include <vector>
+using namespace std;
+
static unsigned test()
{
symbol x("x");
* Lewis and Michael Wester. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <vector>
#include "ginac.h"
#include "timer.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+#include <vector>
+using namespace std;
+
static unsigned test()
{
symbol x("x");
* Lewis and Michael Wester. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <vector>
#include "ginac.h"
#include "timer.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+#include <vector>
+using namespace std;
+
static unsigned test(unsigned n)
{
matrix hilbert(n,n);
* by Robert H. Lewis and Michael Wester. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <vector>
#include "ginac.h"
#include "timer.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+#include <vector>
+using namespace std;
+
static unsigned test(unsigned n)
{
unsigned result = 0;
* Lewis and Michael Wester. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
#include "ginac.h"
#include "timer.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+using namespace std;
+
static unsigned test()
{
// Determinant of a sparse matrix that comes up in graph theory:
* Lewis and Michael Wester. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
#include "ginac.h"
#include "timer.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+using namespace std;
+
static const bool do_test = false; // set to true in order to run this beast
static unsigned test()
* Fermat-test). */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <vector>
#include "ginac.h"
#include "timer.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+#include <vector>
+using namespace std;
+
static const bool do_test = false; // set to true in order to run this beast
static unsigned test()
* Lewis and Michael Wester. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <vector>
#include "ginac.h"
#include "timer.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+#include <vector>
+using namespace std;
+
static const bool do_test2 = false; // set to true in order to run this beast
static const symbol a1("a1"), a2("a2"), a3("a3"), a4("a4"), a5("a5"), a6("a6");
* Lewis and Michael Wester. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <vector>
#include "ginac.h"
#include "timer.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+#include <vector>
+using namespace std;
+
static unsigned test()
{
// This is a pattern that comes up in graph theory:
* Lewis and Michael Wester. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <vector>
#include "ginac.h"
#include "timer.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+#include <vector>
+using namespace std;
+
static unsigned test()
{
// create the matrix from test P...
* Lewis and Michael Wester. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <vector>
#include "ginac.h"
#include "timer.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+#include <vector>
+using namespace std;
+
static const bool do_test = true; // set to true in order to run this beast
static unsigned test()
* Lewis and Michael Wester. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <vector>
#include "ginac.h"
#include "timer.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+#include <vector>
+using namespace std;
+
static const bool do_test = true; // set to true in order to run this beast
static unsigned test()
-#include <iostream>
-#include <string>
-#include <sstream>
+/** @file time_parser.cpp
+ *
+ * Time the parser. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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 "ginac.h"
+#include "timer.h"
+using namespace GiNaC;
+
#include <cstddef>
#include <cstdlib>
-#include <vector>
+#include <iostream>
+#include <sstream>
#include <stdexcept>
-#include "ginac.h"
-#include "timer.h"
-extern void randomify_symbol_serials();
+#include <string>
+#include <vector>
using namespace std;
-using namespace GiNaC;
+
+extern void randomify_symbol_serials();
/// make a string "1+x+2*x^2+...+n*x^n"
static string prepare_str(const unsigned n, const char x = 'x')
*/
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <vector>
#include "ginac.h"
#include "timer.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+#include <vector>
+using namespace std;
+
static unsigned toeplitz_det(unsigned size)
{
unsigned result = 0;
-#include <string>
-#include <cassert>
-#include <iostream>
-#include "timer.h"
+/** @file time_uvar_gcd.cpp
+ *
+ * Time the different GCD algorithms. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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 "ginac.h"
+#include "timer.h"
#include "error_report.h"
#include "test_runner.h"
#include "polynomial/remainder.h"
#include "polynomial/mod_gcd.h"
using namespace GiNaC;
+#include <string>
+#include <cassert>
+#include <iostream>
+
static const std::string p1_srep("\
-936639990+26248623452*x^47-30174373832*x^46-19627087954*x^45 \
+23532819511*x^24-15331409214*x^23-5892518210*x^22-2954269379*x^28 \
p[deg] = cln::random_I(biggish);
return p;
}
-
*/
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <vector>
#include "ginac.h"
#include "timer.h"
-using namespace std;
using namespace GiNaC;
+#include <iostream>
+#include <vector>
+using namespace std;
+
static unsigned vandermonde_det(unsigned size)
{
unsigned result = 0;
* A simple stop watch class. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
#ifdef HAVE_RUSAGE
#include <sys/resource.h>
#include <unistd.h>
#include <ctime>
#endif
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include "timer.h"
timer::timer() : on(false)
* A simple stop watch class. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
+
#ifdef HAVE_RUSAGE
#include <sys/resource.h>
#else
This is a tutorial that documents GiNaC @value{VERSION}, an open
framework for symbolic computation within the C++ programming language.
-Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+Copyright (C) 1999-2009 Johannes Gutenberg University Mainz, Germany
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@page
@vskip 0pt plus 1filll
-Copyright @copyright{} 1999-2008 Johannes Gutenberg University Mainz, Germany
+Copyright @copyright{} 1999-2009 Johannes Gutenberg University Mainz, Germany
@sp 2
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@section License
The GiNaC framework for symbolic computation within the C++ programming
-language is Copyright @copyright{} 1999-2008 Johannes Gutenberg
+language is Copyright @copyright{} 1999-2009 Johannes Gutenberg
University Mainz, Germany.
This program is free software; you can redistribute it and/or
* Implementation of GiNaC's sums of expressions. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <stdexcept>
-#include <limits>
-#include <string>
-
#include "add.h"
#include "mul.h"
#include "archive.h"
#include "clifford.h"
#include "ncmul.h"
+#include <iostream>
+#include <limits>
+#include <stdexcept>
+#include <string>
+
namespace GiNaC {
GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(add, expairseq,
* Interface to GiNaC's sums of expressions. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_ADD_H__
-#define __GINAC_ADD_H__
+#ifndef GINAC_ADD_H
+#define GINAC_ADD_H
#include "expairseq.h"
} // namespace GiNaC
-#endif // ndef __GINAC_ADD_H__
+#endif // ndef GINAC_ADD_H
* Archiving of GiNaC expressions. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <stdexcept>
-
#include "archive.h"
#include "registrar.h"
#include "ex.h"
#include "config.h"
#include "tostring.h"
+#include <iostream>
+#include <stdexcept>
+
namespace GiNaC {
* Archiving of GiNaC expressions. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_ARCHIVE_H__
-#define __GINAC_ARCHIVE_H__
+#ifndef GINAC_ARCHIVE_H
+#define GINAC_ARCHIVE_H
#include "ex.h"
#include <iosfwd>
+#include <map>
#include <string>
#include <vector>
-#include <map>
namespace GiNaC {
std::ostream &operator<<(std::ostream &os, const archive &ar);
std::istream &operator>>(std::istream &is, archive &ar);
-
} // namespace GiNaC
-#endif // ndef __GINAC_ARCHIVE_H__
+#endif // ndef GINAC_ARCHIVE_H
* Assertion macro definition. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_ASSERTION_H__
-#define __GINAC_ASSERTION_H__
+#ifndef GINAC_ASSERTION_H
+#define GINAC_ASSERTION_H
#if !defined(GINAC_ASSERT)
#if defined(DO_GINAC_ASSERT)
#endif
#endif
-#endif // ndef __GINAC_ASSERTION_H__
+#endif // ndef GINAC_ASSERTION_H
* Implementation of GiNaC's ABC. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <stdexcept>
-#include <typeinfo>
-
#include "basic.h"
#include "ex.h"
#include "numeric.h"
#include "utils.h"
#include "inifcns.h"
+#include <iostream>
+#include <stdexcept>
+#include <typeinfo>
+
namespace GiNaC {
GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(basic, void,
* Interface to GiNaC's ABC. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_BASIC_H__
-#define __GINAC_BASIC_H__
-
-#include <cstddef> // for size_t
-#include <vector>
-#include <set>
-#include <map>
-#include <typeinfo> // for typeid
-// CINT needs <algorithm> to work properly with <vector>
-#include <algorithm>
+#ifndef GINAC_BASIC_H
+#define GINAC_BASIC_H
#include "flags.h"
#include "ptr.h"
#include "assertion.h"
#include "registrar.h"
+// CINT needs <algorithm> to work properly with <vector>
+#include <algorithm>
+#include <cstddef> // for size_t
+#include <map>
+#include <set>
+#include <typeinfo> // for typeid
+#include <vector>
+
namespace GiNaC {
class ex;
} // namespace GiNaC
-#endif // ndef __GINAC_BASIC_H__
+#endif // ndef GINAC_BASIC_H
* Helper templates to provide per-class information for class hierarchies. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_CLASS_INFO_H__
-#define __GINAC_CLASS_INFO_H__
+#ifndef GINAC_CLASS_INFO_H
+#define GINAC_CLASS_INFO_H
#include <cstddef> // for size_t
#include <cstring>
-#include <vector>
-#include <map>
-#include <string>
-#include <iostream>
#include <iomanip>
+#include <iostream>
+#include <map>
#include <stdexcept>
+#include <string>
+#include <vector>
namespace GiNaC {
} // namespace GiNaC
-#endif // ndef __GINAC_CLASS_INFO_H__
+#endif // ndef GINAC_CLASS_INFO_H
* Implementation of GiNaC's clifford algebra (Dirac gamma) objects. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <stdexcept>
-
#include "clifford.h"
#include "ex.h"
#include "archive.h"
#include "utils.h"
+#include <stdexcept>
+
namespace GiNaC {
GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(clifford, indexed,
* Interface to GiNaC's clifford algebra (Dirac gamma) objects. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_CLIFFORD_H__
-#define __GINAC_CLIFFORD_H__
+#ifndef GINAC_CLIFFORD_H
+#define GINAC_CLIFFORD_H
#include "indexed.h"
#include "tensor.h"
namespace GiNaC {
-
/** This class holds an object representing an element of the Clifford
* algebra (the Dirac gamma matrices). These objects only carry Lorentz
* indices. Spinor indices are hidden. A representation label (an unsigned
} // namespace GiNaC
-#endif // ndef __GINAC_CLIFFORD_H__
+#endif // ndef GINAC_CLIFFORD_H
* Implementation of GiNaC's color (SU(3) Lie algebra) objects. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <stdexcept>
-
#include "color.h"
#include "idx.h"
#include "ncmul.h"
#include "archive.h"
#include "utils.h"
+#include <iostream>
+#include <stdexcept>
+
namespace GiNaC {
GINAC_IMPLEMENT_REGISTERED_CLASS(color, indexed)
* Interface to GiNaC's color (SU(3) Lie algebra) objects. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_COLOR_H__
-#define __GINAC_COLOR_H__
+#ifndef GINAC_COLOR_H
+#define GINAC_COLOR_H
#include "indexed.h"
#include "tensor.h"
namespace GiNaC {
-
/** This class holds a generator T_a or the unity element of the Lie algebra
* of SU(3), as used for calculations in quantum chromodynamics. A
* representation label (an unsigned 8-bit integer) is used to distinguish
* @param rl Representation label */
ex color_trace(const ex & e, unsigned char rl = 0);
-
} // namespace GiNaC
-#endif // ndef __GINAC_COLOR_H__
+#endif // ndef GINAC_COLOR_H
-#ifndef GINAC_COMPILER_DEP_HH
-#define GINAC_COMPILER_DEP_HH
+/** @file compiler.h
+ *
+ * Definition of optimizing macros. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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
+ */
+
+#ifndef GINAC_COMPILER_H
+#define GINAC_COMPILER_H
#ifdef __GNUC__
#define unlikely(cond) __builtin_expect((cond), 0)
#define likely(cond) (cond)
#endif
-#endif /* GINAC_COMPILER_DEP_HH */
+#endif // ndef GINAC_COMPILER_DEP_H
* Implementation of GiNaC's constant types and some special constants. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <string>
-#include <stdexcept>
-#include <iostream>
-
#include "constant.h"
#include "numeric.h"
#include "ex.h"
#include "utils.h"
#include "inifcns.h"
+#include <iostream>
+#include <stdexcept>
+#include <string>
+
namespace GiNaC {
GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(constant, basic,
* Interface to GiNaC's constant types and some special constants. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_CONSTANT_H__
-#define __GINAC_CONSTANT_H__
+#ifndef GINAC_CONSTANT_H
+#define GINAC_CONSTANT_H
-#include <string>
#include "basic.h"
#include "ex.h"
#include "archive.h"
+#include <string>
+
namespace GiNaC {
typedef ex (*evalffunctype)();
} // namespace GiNaC
-#endif // ndef __GINAC_CONSTANT_H__
+#endif // ndef GINAC_CONSTANT_H
* Wrapper template for making GiNaC classes out of STL containers. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_CONTAINER_H__
-#define __GINAC_CONTAINER_H__
-
-#include <iterator>
-#include <stdexcept>
-#include <algorithm>
-#include <vector>
-#include <list>
-#include <memory>
+#ifndef GINAC_CONTAINER_H
+#define GINAC_CONTAINER_H
#include "ex.h"
#include "print.h"
#include "archive.h"
#include "assertion.h"
-namespace GiNaC {
+#include <algorithm>
+#include <iterator>
+#include <list>
+#include <memory>
+#include <stdexcept>
+#include <vector>
+namespace GiNaC {
/** Helper template for encapsulating the reserve() mechanics of STL containers. */
template <template <class T, class = std::allocator<T> > class C>
} // namespace GiNaC
-#endif // ndef __GINAC_CONTAINER_H__
+#endif // ndef GINAC_CONTAINER_H
* Implementation of GiNaC's light-weight expression handles. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <stdexcept>
-
#include "ex.h"
#include "add.h"
#include "mul.h"
#include "relational.h"
#include "utils.h"
+#include <iostream>
+#include <stdexcept>
+
namespace GiNaC {
//////////
* Interface to GiNaC's light-weight expression handles. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_EX_H__
-#define __GINAC_EX_H__
+#ifndef GINAC_EX_H
+#define GINAC_EX_H
+#include "basic.h"
+#include "ptr.h"
+
+#include <functional>
#include <iosfwd>
#include <iterator>
-#include <functional>
#include <stack>
-#include "basic.h"
-#include "ptr.h"
-
namespace GiNaC {
-
/** Helper class to initialize the library. There must be one static object
* of this class in every object file that makes use of our flyweights in
* order to guarantee proper initialization. Hence we put it into this
} // namespace std
-#endif // ndef __GINAC_EX_H__
+#endif // ndef GINAC_EX_H
*/
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
#include "excompiler.h"
-#include <stdexcept>
-#include <ios>
-#include <fstream>
-#include <sstream>
-#include <string>
-#include <vector>
-
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#ifdef HAVE_LIBDL
-#include <dlfcn.h>
-#endif // def HAVE_LIBDL
-
#include "ex.h"
#include "lst.h"
#include "operators.h"
#include "relational.h"
#include "symbol.h"
+#ifdef HAVE_LIBDL
+#include <dlfcn.h>
+#endif // def HAVE_LIBDL
+#include <fstream>
+#include <ios>
+#include <sstream>
+#include <stdexcept>
+#include <string>
+#include <vector>
+
namespace GiNaC {
#ifdef HAVE_LIBDL
/** @file excompiler.h
*
* Functions to facilitate the conversion of a ex to a function pointer suited for
- * fast numerical integration.
- *
- */
+ * fast numerical integration. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_EXCOMPILER_H__
-#define __GINAC_EXCOMPILER_H__
-
-#include <string>
+#ifndef GINAC_EXCOMPILER_H
+#define GINAC_EXCOMPILER_H
#include "lst.h"
+#include <string>
+
namespace GiNaC {
class ex;
} // namespace GiNaC
-#endif // ndef __GINAC_EXCOMPILER_H__
+#endif // ndef GINAC_EXCOMPILER_H
* Implementation of expression pairs (building blocks of expairseq). */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-
#include "expair.h"
#include "operators.h"
+#include <iostream>
+
namespace GiNaC {
void expair::print(std::ostream & os) const
* Definition of expression pairs (building blocks of expairseq). */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_EXPAIR_H__
-#define __GINAC_EXPAIR_H__
+#ifndef GINAC_EXPAIR_H
+#define GINAC_EXPAIR_H
#include "ex.h"
#include "numeric.h"
} // namespace GiNaC
-#endif // ndef __GINAC_EXPAIR_H__
+#endif // ndef GINAC_EXPAIR_H
* Implementation of sequences of expression pairs. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <algorithm>
-#include <string>
-#include <stdexcept>
-#include <iterator>
-
#include "expairseq.h"
#include "lst.h"
#include "add.h"
#include "utils.h"
#include "indexed.h"
+#include <algorithm>
#if EXPAIRSEQ_USE_HASHTAB
#include <cmath>
#endif // EXPAIRSEQ_USE_HASHTAB
+#include <iostream>
+#include <iterator>
+#include <stdexcept>
+#include <string>
namespace GiNaC {
* Interface to sequences of expression pairs. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_EXPAIRSEQ_H__
-#define __GINAC_EXPAIRSEQ_H__
-
-#include <vector>
-#include <list>
-#include <memory>
-// CINT needs <algorithm> to work properly with <vector> and <list>
-#include <algorithm>
+#ifndef GINAC_EXPAIRSEQ_H
+#define GINAC_EXPAIRSEQ_H
#include "expair.h"
#include "indexed.h"
+// CINT needs <algorithm> to work properly with <vector> and <list>
+#include <algorithm>
+#include <list>
+#include <memory>
+#include <vector>
+
namespace GiNaC {
/** Using hash tables can potentially enhance the asymptotic behaviour of
} // namespace GiNaC
-#endif // ndef __GINAC_EXPAIRSEQ_H__
+#endif // ndef GINAC_EXPAIRSEQ_H
* Implementation of GiNaC's exprseq. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Definition of GiNaC's exprseq. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_EXPRSEQ_H__
-#define __GINAC_EXPRSEQ_H__
-
-#include <vector>
+#ifndef GINAC_EXPRSEQ_H
+#define GINAC_EXPRSEQ_H
#include "container.h"
+#include <vector>
+
namespace GiNaC {
typedef container<std::vector> exprseq;
} // namespace GiNaC
-#endif // ndef __GINAC_EXPRSEQ_H__
+#endif // ndef GINAC_EXPRSEQ_H
*/
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
/** @file factor.h
*
- * Polynomial factorization.
- *
- */
+ * Polynomial factorization. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_FACTOR_H__
-#define __GINAC_FACTOR_H__
+#ifndef GINAC_FACTOR_H
+#define GINAC_FACTOR_H
namespace GiNaC {
} // namespace GiNaC
-#endif // ndef __GINAC_FACTOR_H__
+#endif // ndef GINAC_FACTOR_H
* somewhat obsolete (most of this can be replaced by exceptions). */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-
#include "fail.h"
#include "archive.h"
#include "utils.h"
+#include <iostream>
+
namespace GiNaC {
GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(fail, basic,
* somewhat obsolete (most of this can be replaced by exceptions). */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_FAIL_H__
-#define __GINAC_FAIL_H__
+#ifndef GINAC_FAIL_H
+#define GINAC_FAIL_H
#include "basic.h"
#include "archive.h"
} // namespace GiNaC
-#endif // ndef __GINAC_FAIL_H__
+#endif // ndef GINAC_FAIL_H
* Implementation of abstract derivatives of functions. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-
#include "fderivative.h"
#include "operators.h"
#include "archive.h"
#include "utils.h"
+#include <iostream>
+
namespace GiNaC {
GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(fderivative, function,
* Interface to abstract derivatives of functions. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_FDERIVATIVE_H__
-#define __GINAC_FDERIVATIVE_H__
-
-#include <set>
+#ifndef GINAC_FDERIVATIVE_H
+#define GINAC_FDERIVATIVE_H
#include "function.h"
-namespace GiNaC {
+#include <set>
+namespace GiNaC {
typedef std::multiset<unsigned> paramset;
} // namespace GiNaC
-#endif // ndef __GINAC_DERIVATIVE_H__
+#endif // ndef GINAC_DERIVATIVE_H
* Collection of all flags used through the GiNaC framework. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_FLAGS_H__
-#define __GINAC_FLAGS_H__
+#ifndef GINAC_FLAGS_H
+#define GINAC_FLAGS_H
namespace GiNaC {
} // namespace GiNaC
-#endif // ndef __GINAC_FLAGS_H__
+#endif // ndef GINAC_FLAGS_H
# function.pl options: \$maxargs=${maxargs}
#
-# GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+# GiNaC Copyright (C) 1999-2009 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
* Please do not modify it directly, edit the perl script instead!
* function.pl options: \$maxargs=${maxargs}
*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_FUNCTION_H__
-#define __GINAC_FUNCTION_H__
+#ifndef GINAC_FUNCTION_H
+#define GINAC_FUNCTION_H
-#include <string>
-#include <vector>
+#include "exprseq.h"
// CINT needs <algorithm> to work properly with <vector>
#include <algorithm>
-
-#include "exprseq.h"
+#include <string>
+#include <vector>
// the following lines have been generated for max. ${maxargs} parameters
$declare_function_macro
} // namespace GiNaC
-#endif // ndef __GINAC_FUNCTION_H__
+#endif // ndef GINAC_FUNCTION_H
END_OF_INTERFACE
* This include file includes all other public GiNaC headers. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_H__
-#define __GINAC_H__
+#ifndef GINAC_H
+#define GINAC_H
#include "version.h"
#pragma link C++ nestedtypedef;
#endif
-#endif // ndef __GINAC_H__
+#endif // ndef GINAC_H
* Replacement for map<> using hash tables. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_HASH_MAP_H__
-#define __GINAC_HASH_MAP_H__
+#ifndef GINAC_HASH_MAP_H
+#define GINAC_HASH_MAP_H
-#include <list>
-#include <iterator>
#include <algorithm>
#include <functional>
+#include <iterator>
+#include <list>
#include <utility>
-
namespace GiNaC {
/*
} // namespace std
-#endif // ndef __GINAC_HASH_MAP_H__
+#endif // ndef GINAC_HASH_MAP_H
* Implementation of GiNaC's indices. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <sstream>
-#include <stdexcept>
-
#include "idx.h"
#include "symbol.h"
#include "lst.h"
#include "archive.h"
#include "utils.h"
+#include <iostream>
+#include <sstream>
+#include <stdexcept>
+
namespace GiNaC {
GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(idx, basic,
* Interface to GiNaC's indices. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_IDX_H__
-#define __GINAC_IDX_H__
+#ifndef GINAC_IDX_H
+#define GINAC_IDX_H
#include "ex.h"
#include "numeric.h"
namespace GiNaC {
-
/** This class holds one index of an indexed object. Indices can
* theoretically consist of any symbolic expression but they are usually
* only just a symbol (e.g. "mu", "i") or numeric (integer). Indices belong
} // namespace GiNaC
-#endif // ndef __GINAC_IDX_H__
+#endif // ndef GINAC_IDX_H
* Implementation of GiNaC's indexed expressions. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <sstream>
-#include <stdexcept>
-#include <limits>
-
#include "indexed.h"
#include "idx.h"
#include "add.h"
#include "matrix.h"
#include "inifcns.h"
+#include <iostream>
+#include <limits>
+#include <sstream>
+#include <stdexcept>
+
namespace GiNaC {
GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(indexed, exprseq,
* Interface to GiNaC's indexed expressions. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_INDEXED_H__
-#define __GINAC_INDEXED_H__
-
-#include <map>
+#ifndef GINAC_INDEXED_H
+#define GINAC_INDEXED_H
#include "exprseq.h"
#include "wildcard.h"
-namespace GiNaC {
+#include <map>
+namespace GiNaC {
class scalar_products;
class symmetry;
} // namespace GiNaC
-#endif // ndef __GINAC_INDEXED_H__
+#endif // ndef GINAC_INDEXED_H
* Implementation of GiNaC's initially known functions. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <vector>
-#include <stdexcept>
-
#include "inifcns.h"
#include "ex.h"
#include "constant.h"
#include "symmetry.h"
#include "utils.h"
+#include <stdexcept>
+#include <vector>
+
namespace GiNaC {
//////////
* Interface to GiNaC's initially known functions. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_INIFCNS_H__
-#define __GINAC_INIFCNS_H__
+#ifndef GINAC_INIFCNS_H
+#define GINAC_INIFCNS_H
#include "numeric.h"
#include "function.h"
} // namespace GiNaC
-#endif // ndef __GINAC_INIFCNS_H__
+#endif // ndef GINAC_INIFCNS_H
* some related stuff. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <vector>
-#include <stdexcept>
-
#include "inifcns.h"
#include "constant.h"
#include "pseries.h"
#include "symmetry.h"
#include "utils.h"
+#include <stdexcept>
+#include <vector>
+
namespace GiNaC {
//////////
*/
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <sstream>
-#include <stdexcept>
-#include <vector>
-#include <cln/cln.h>
-
#include "inifcns.h"
#include "add.h"
#include "utils.h"
#include "wildcard.h"
+#include <cln/cln.h>
+#include <sstream>
+#include <stdexcept>
+#include <vector>
namespace GiNaC {
* functions. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <vector>
-#include <stdexcept>
-
#include "inifcns.h"
#include "ex.h"
#include "constant.h"
#include "pseries.h"
#include "utils.h"
+#include <stdexcept>
+#include <vector>
+
namespace GiNaC {
//////////
* Implementation of GiNaC's symbolic integral. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Interface to GiNaC's symbolic integral. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_INTEGRAL_H__
-#define __GINAC_INTEGRAL_H__
+#ifndef GINAC_INTEGRAL_H
+#define GINAC_INTEGRAL_H
#include "basic.h"
#include "ex.h"
} // namespace GiNaC
-#endif // ndef __GINAC_INTEGRAL_H__
+#endif // ndef GINAC_INTEGRAL_H
* Implementation of GiNaC's lst. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Definition of GiNaC's lst. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_LST_H__
-#define __GINAC_LST_H__
-
-#include <list>
+#ifndef GINAC_LST_H
+#define GINAC_LST_H
#include "container.h"
+#include <list>
+
namespace GiNaC {
typedef container<std::list> lst;
} // namespace GiNaC
-#endif // ndef __GINAC_LST_H__
+#endif // ndef GINAC_LST_H
* Implementation of symbolic matrices */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <string>
-#include <iostream>
-#include <sstream>
-#include <algorithm>
-#include <map>
-#include <stdexcept>
-
#include "matrix.h"
#include "numeric.h"
#include "lst.h"
#include "archive.h"
#include "utils.h"
+#include <algorithm>
+#include <iostream>
+#include <map>
+#include <sstream>
+#include <stdexcept>
+#include <string>
+
namespace GiNaC {
GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(matrix, basic,
* Interface to symbolic matrices */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_MATRIX_H__
-#define __GINAC_MATRIX_H__
+#ifndef GINAC_MATRIX_H
+#define GINAC_MATRIX_H
-#include <vector>
-#include <string>
#include "basic.h"
#include "ex.h"
#include "archive.h"
-namespace GiNaC {
+#include <string>
+#include <vector>
+namespace GiNaC {
/** Helper template to allow initialization of matrices via an overloaded
* comma operator (idea stolen from Blitz++). */
} // namespace GiNaC
-#endif // ndef __GINAC_MATRIX_H__
+#endif // ndef GINAC_MATRIX_H
* Implementation of GiNaC's products of expressions. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <vector>
-#include <stdexcept>
-#include <limits>
-
#include "mul.h"
#include "add.h"
#include "power.h"
#include "symbol.h"
#include "compiler.h"
+#include <iostream>
+#include <limits>
+#include <stdexcept>
+#include <vector>
+
namespace GiNaC {
GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(mul, expairseq,
* Interface to GiNaC's products of expressions. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_MUL_H__
-#define __GINAC_MUL_H__
+#ifndef GINAC_MUL_H
+#define GINAC_MUL_H
#include "expairseq.h"
} // namespace GiNaC
-#endif // ndef __GINAC_MUL_H__
+#endif // ndef GINAC_MUL_H
* Implementation of GiNaC's non-commutative products of expressions. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <algorithm>
-#include <iostream>
-#include <stdexcept>
-
#include "ncmul.h"
#include "ex.h"
#include "add.h"
#include "indexed.h"
#include "utils.h"
+#include <algorithm>
+#include <iostream>
+#include <stdexcept>
+
namespace GiNaC {
GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(ncmul, exprseq,
* Interface to GiNaC's non-commutative products of expressions. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_NCMUL_H__
-#define __GINAC_NCMUL_H__
+#ifndef GINAC_NCMUL_H
+#define GINAC_NCMUL_H
#include "exprseq.h"
#include "archive.h"
} // namespace GiNaC
-#endif // ndef __GINAC_NCMUL_H__
+#endif // ndef GINAC_NCMUL_H
* computation, square-free factorization and rational function normalization. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <algorithm>
-#include <map>
-
#include "normal.h"
#include "basic.h"
#include "ex.h"
#include "utils.h"
#include "polynomial/chinrem_gcd.h"
+#include <algorithm>
+#include <map>
+
namespace GiNaC {
// If comparing expressions (ex::compare()) is fast, you can set this to 1.
* computation, square-free factorization and rational function normalization. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_NORMAL_H__
-#define __GINAC_NORMAL_H__
+#ifndef GINAC_NORMAL_H
+#define GINAC_NORMAL_H
#include "lst.h"
} // namespace GiNaC
-#endif // ndef __GINAC_NORMAL_H__
+#endif // ndef GINAC_NORMAL_H
* of special functions or implement the interface to the bignum package. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
#include "config.h"
-#include <vector>
-#include <stdexcept>
-#include <string>
-#include <sstream>
-#include <limits>
-
#include "numeric.h"
#include "ex.h"
#include "operators.h"
#include "tostring.h"
#include "utils.h"
+#include <limits>
+#include <sstream>
+#include <stdexcept>
+#include <string>
+#include <vector>
+
// CLN should pollute the global namespace as little as possible. Hence, we
// include most of it here and include only the part needed for properly
// declaring cln::cl_number in numeric.h. This can only be safely done in
* Makes the interface to the underlying bignum package available. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_NUMERIC_H__
-#define __GINAC_NUMERIC_H__
+#ifndef GINAC_NUMERIC_H
+#define GINAC_NUMERIC_H
#include "basic.h"
#include "ex.h"
#include "archive.h"
-#include <stdexcept>
-#include <vector>
-
#include <cln/complex.h>
-
#if defined(G__CINTVERSION) && !defined(__MAKECINT__)
// Cint @$#$! doesn't like forward declaring classes used for casting operators
// so we have to include the definition of cln::cl_N here, but it is enough to
// do so for the compiler, hence the !defined(__MAKECINT__).
#include <cln/complex_class.h>
#endif
+#include <stdexcept>
+#include <vector>
namespace GiNaC {
#pragma link off defined_in cln/complex_class.h;
#endif
-#endif // ndef __GINAC_NUMERIC_H__
+#endif // ndef GINAC_NUMERIC_H
* Implementation of GiNaC's overloaded operators. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <iomanip>
-
#include "operators.h"
#include "numeric.h"
#include "add.h"
#include "print.h"
#include "utils.h"
+#include <iomanip>
+#include <iostream>
+
namespace GiNaC {
/** Used internally by operator+() to add two ex objects together. */
* Interface to GiNaC's overloaded operators. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_OPERATORS_H__
-#define __GINAC_OPERATORS_H__
+#ifndef GINAC_OPERATORS_H
+#define GINAC_OPERATORS_H
#include <iosfwd>
} // namespace GiNaC
-#endif // ndef __GINAC_OPERATORS_H__
+#endif // ndef GINAC_OPERATORS_H
-#ifndef GINAC_PARSER_DEBUG_HPP
-#define GINAC_PARSER_DEBUG_HPP
+/** @file debug.h
+ *
+ * Debugging facilities for parser. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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
+ */
+
+#ifndef GINAC_PARSER_DEBUG_H
+#define GINAC_PARSER_DEBUG_H
+
+#include "compiler.h"
+
#include <iosfwd>
#include <sstream>
#include <stdexcept>
-#include "compiler.h"
+
#ifndef __GNUC__
#if __STDC_VERSION__ < 199901L
#define __PRETTY_FUNCTION__ "<unknown>"
} \
} while (0)
-#endif // GINAC_PARSER_DEBUG_HPP
-
+#endif // GINAC_PARSER_DEBUG_H
-#include <string>
-#include <iostream>
-#include <sstream>
+/** @file lexer.cpp
+ *
+ * Implementation of GiNaC's lexer. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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 "lexer.h"
#include "compiler.h"
-namespace GiNaC
-{
+#include <iostream>
+#include <sstream>
+#include <string>
+
+namespace GiNaC {
+
/// Skip to the end of line
static int skipline(std::istream* s);
/// Skip to the next non-whitespace character
}
} // namespace GiNaC
-
-#ifndef GINAC_LEXER_HPP_
-#define GINAC_LEXER_HPP_
+/** @file lexer.h
+ *
+ * The lexer. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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
+ */
+
+#ifndef GINAC_LEXER_H
+#define GINAC_LEXER_H
+
#include <iosfwd>
#include <string>
#include <cstddef>
-namespace GiNaC
-{
+
+namespace GiNaC {
class lexer
{
} // namespace GiNaC
-#endif // GINAC_LEXER_HPP_
-
+#endif // ndef GINAC_LEXER_H
+/** @file parse_binop_rhs.cpp
+ *
+ * Code to deal with binary operators. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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 "ex.h"
#include "symbol.h"
#include "mul.h"
#include "add.h"
#include "power.h"
#include "operators.h"
-#include <stdexcept>
-#include <sstream>
#include "parser.h"
#include "lexer.h"
#include "debug.h"
-namespace GiNaC
-{
+#include <sstream>
+#include <stdexcept>
+
+namespace GiNaC {
/// Make a sum or a product.
static ex make_binop_expr(const int binop, const exvector& args);
}
} // namespace GiNaC
-
+/** @file parse_context.cpp
+ *
+ * Implementation of the parser context. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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 "parse_context.h"
+
#include <sstream>
#include <stdexcept>
-namespace GiNaC
-{
+
+namespace GiNaC {
symbol
find_or_insert_symbol(const std::string& name, symtab& syms, const bool strict)
return sy;
}
-}
-
+} // namespace GiNaC
-#ifndef _GINAC_PARSE_CONTEXT_HPP
-#define _GINAC_PARSE_CONTEXT_HPP
-#include <string>
-#include <cstddef> // size_t
+/** @file parse_context.h
+ *
+ * Interface to parser context. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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
+ */
+
+#ifndef GINAC_PARSE_CONTEXT_H
+#define GINAC_PARSE_CONTEXT_H
+
#include "ex.h"
#include "symbol.h"
+
+#include <cstddef> // for size_t
#include <map>
+#include <string>
#include <utility>
-namespace GiNaC
-{
+namespace GiNaC {
/**
* Establishes correspondence between the strings and expressions.
*/
extern const prototype_table& get_default_reader();
-}
-
-#endif // _GINAC_PARSE_CONTEXT_HPP
+} // namespace GiNaC
+#endif // GINAC_PARSE_CONTEXT_H
-#include <stdexcept>
-#include <sstream>
+/** @file parser.cpp
+ *
+ * Implementation of GiNaC's parser. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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 "parser.h"
#include "lexer.h"
#include "debug.h"
#include "mul.h"
#include "constant.h"
-namespace GiNaC
-{
+#include <sstream>
+#include <stdexcept>
+
+namespace GiNaC {
/// identifier_expr: identifier | identifier '(' expression* ')'
ex parser::parse_identifier_expr()
-#ifndef GINAC_PARSER_HPP_
-#define GINAC_PARSER_HPP_
+/** @file parser.h
+ *
+ * Interface to the parser. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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
+ */
+
+#ifndef GINAC_PARSER_H
+#define GINAC_PARSER_H
#include "parse_context.h"
-#include <stdexcept>
#include "ex.h"
-namespace GiNaC
-{
+#include <stdexcept>
+
+namespace GiNaC {
class lexer;
} // namespace GiNaC
-#endif // GINAC_PARSER_HPP_
-
+#endif // ndef GINAC_PARSER_H
-/// @file parser_compat.cpp Parser interface compatible with the old
-/// (bison/flex based) parser.
+/** @file parser_compat.cpp
+ *
+ * Parser interface compatible with the old (bison/flex based) parser. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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 "ex.h"
#include "idx.h"
#include "lst.h"
#include "parser.h"
-#include <string>
+
#include <iostream>
+#include <string>
+
+namespace GiNaC {
-namespace GiNaC
-{
static symtab make_symtab(const ex& l);
ptr<basic> ex::construct_from_string_and_lst(const std::string &s, const ex &l)
throw (std::invalid_argument("get_symbol_name(): unexpected expression type"));
}
-}
-
+} // namespace GiNaC
+/** @file cinrem_gcd.cpp
+ *
+ * Chinese remainder algorithm. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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 "chinrem_gcd.h"
#include "optimal_vars_finder.h"
-namespace GiNaC
-{
+namespace GiNaC {
ex chinrem_gcd(const ex& A, const ex& B)
{
ex g = chinrem_gcd(A, B, vars);
return g;
}
-} // namespace GiNaC
+} // namespace GiNaC
+/** @file chinrem_gcd.h
+ *
+ * Interface to GCD functions using Chinese remainder algorithm. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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
+ */
+
#ifndef GINAC_CHINREM_GCD_H
#define GINAC_CHINREM_GCD_H
+
#include "ex.h"
-namespace GiNaC
-{
+namespace GiNaC {
extern ex chinrem_gcd(const ex& A_, const ex& B_, const exvector& vars);
extern ex chinrem_gcd(const ex& A, const ex& B);
virtual ~chinrem_gcd_failed() { }
};
-}
-
-#endif /* GINAC_CHINREM_GCD_H */
+} // namspace GiNaC
+#endif // ndef GINAC_CHINREM_GCD_H
-#include <iterator>
-#include <map>
-#include <algorithm>
-#include <stdexcept>
-#include <string>
+/** @file collect_vargs.cpp
+ *
+ * Utility functions. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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 "add.h"
#include "mul.h"
#include "operators.h"
#include "power.h"
#include "collect_vargs.h"
-#include <cln/integer.h>
#include "smod_helpers.h"
#include "debug.h"
-namespace GiNaC
-{
+#include <algorithm>
+#include <cln/integer.h>
+#include <iterator>
+#include <map>
+#include <stdexcept>
+#include <string>
+
+namespace GiNaC {
typedef std::map<exp_vector_t, ex> ex_collect_priv_t;
}
} // namespace GiNaC
-
-#ifndef GINAC_COLLECT_VARGS_HPP
-#define GINAC_COLLECT_VARGS_HPP
+/** @file collect_vargs.h
+ *
+ * Interface to utility functions. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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
+ */
+
+#ifndef GINAC_COLLECT_VARGS_H
+#define GINAC_COLLECT_VARGS_H
+
#include "ex.h"
+
#include <cln/integer.h>
+#include <utility> // for std::pair
#include <vector>
-#include <utility> // std::pair
-namespace GiNaC
-{
+namespace GiNaC {
typedef std::vector<int> exp_vector_t;
typedef std::vector<std::pair<exp_vector_t, ex> > ex_collect_t;
} // namespace GiNaC
-#endif /* GINAC_COLLECT_VARGS_HPP */
+#endif // ndef GINAC_COLLECT_VARGS_H
+/** @file cra_garner.cpp
+ *
+ * Garner's algorithm. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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 "cra_garner.h"
+#include "compiler.h"
+
#include <cln/integer.h>
#include <cln/modinteger.h>
-#include <vector>
#include <cstddef>
-#include "cra_garner.h"
-#include "compiler.h"
+#include <vector>
+
+namespace cln {
-namespace cln
-{
using std::vector;
using std::size_t;
}
} // namespace cln
-
+/** @file cra_garner.h
+ *
+ * Interface to Garner's algorithm. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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
+ */
+
#ifndef CL_INTEGER_CRA
#define CL_INTEGER_CRA
-#include <vector>
+
#include <cln/integer.h>
+#include <vector>
+
+namespace cln {
-namespace cln
-{
extern cl_I integer_cra(const std::vector<cl_I>& residues,
const std::vector<cl_I>& moduli);
-}
-#endif // CL_INTEGER_CRA
+} // namespace cln
+
+#endif // CL_INTEGER_CRA
-#ifndef GINAC_MOD_GCD_DEBUG_HPP
-#define GINAC_MOD_GCD_DEBUG_HPP
+/** @file debug.h
+ *
+ * Utility macros and functions for debugging. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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
+ */
+
+#ifndef GINAC_MOD_GCD_DEBUG_H
+#define GINAC_MOD_GCD_DEBUG_H
+
+#include "compiler.h"
+
#include <iostream>
-#include <string>
-#include <stdexcept>
#include <sstream>
-#include "compiler.h"
+#include <stdexcept>
+#include <string>
#define DEBUG_PREFIX __func__ << ':' << __LINE__ << ": "
#define EXCEPTION_PREFIX std::string(__func__) + std::string(": ") +
-#define Dout2(stream, msg) \
-do { \
- stream << DEBUG_PREFIX << msg << std::endl << std::flush; \
+#define Dout2(stream, msg) \
+do { \
+ stream << DEBUG_PREFIX << msg << std::endl << std::flush; \
} while (0)
#define Dout(msg) Dout2(std::cout, msg)
-#define bug3_on(condition, the_exception, msg) \
-do { \
- if (unlikely(condition)) { \
- std::ostringstream err_stream; \
- Dout2(err_stream, "BUG: " << msg); \
- throw the_exception(err_stream.str()); \
- } \
+#define bug3_on(condition, the_exception, msg) \
+do { \
+ if (unlikely(condition)) { \
+ std::ostringstream err_stream; \
+ Dout2(err_stream, "BUG: " << msg); \
+ throw the_exception(err_stream.str()); \
+ } \
} while (0)
#define bug_on(condition, msg) bug3_on(condition, std::logic_error, msg)
-#endif // GINAC_MOD_GCD_DEBUG_HPP
-
+#endif // ndef GINAC_MOD_GCD_DEBUG_H
+/** @file divide_in_z_p.cpp
+ *
+ * Implementation of polynomial division in Z/Zp. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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 "add.h"
#include "operators.h"
#include "power.h"
#include "smod_helpers.h"
-namespace GiNaC
-{
+namespace GiNaC {
+
/**
* Exact polynomial division of a, b \in Z_p[x_0, \ldots, x_n]
* It doesn't check whether the inputs are proper polynomials, so be careful
return false;
}
-}
+} // namespace GiNaC
+/** @file divide_in_z_p.h
+ *
+ * Interface to polynomial division in Z/Zp. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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
+ */
+
#ifndef GINAC_CHINREM_GCD_DIVIDE_IN_Z_P_H
#define GINAC_CHINREM_GCD_DIVIDE_IN_Z_P_H
#include "ex.h"
-namespace GiNaC
-{
+
+namespace GiNaC {
/**
* Exact polynomial division of a, b \in Z_p[x_0, \ldots, x_n]
} // namespace GiNaC
-#endif /* GINAC_CHINREM_GCD_DIVIDE_IN_Z_P_H */
-
+#endif // ndef GINAC_CHINREM_GCD_DIVIDE_IN_Z_P_H
+/** @file euclid_gcd_wrap.h
+ *
+ * Euclidean GCD and supporting functions. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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
+ */
+
#ifndef GINAC_PGCD_EUCLID_GCD_H
#define GINAC_PGCD_EUCLID_GCD_H
+
#include "upoly.h"
#include "gcd_euclid.h"
#include "smod_helpers.h"
#include "relational.h"
#include "debug.h"
-namespace GiNaC
-{
+namespace GiNaC {
static void ex2upoly(umodpoly& u, ex e, const ex& var, const long p)
{
} // namespace GiNaC
-#endif
+#endif // ndef GINAC_PGCD_EUCLID_GCD_H
+/** @file eval_point_finder.h
+ *
+ * Functions for finding an evaluation point. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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
+ */
+
#ifndef GINAC_PGCD_EVAL_POINT_FINDER_H
#define GINAC_PGCD_EVAL_POINT_FINDER_H
+
#include "operators.h"
+
#include <set>
-namespace GiNaC
-{
+namespace GiNaC {
/// Find a `good' evaluation point b \in Z_p for a pair of multivariate
/// polynomials A, B \in Z_p[x_n][x_0, \ldots, x_n]. Here `good' means
return false;
}
-}
-
-#endif /* GINAC_PGCD_EVAL_POINT_FINDER_H */
+} // namespace GiNaC
+#endif // ndef GINAC_PGCD_EVAL_POINT_FINDER_H
-#ifndef GINAC_EVAL_UPOLY_TCC
-#define GINAC_EVAL_UPOLY_TCC
+/** @file eval_uvar.h
+ *
+ * Numerical evaluation of univariate polynomials. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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
+ */
+
+#ifndef GINAC_EVAL_UPOLY_H
+#define GINAC_EVAL_UPOLY_H
+
#include "upoly.h"
#include "ring_traits.h"
-namespace GiNaC
-{
+namespace GiNaC {
/// Evaluate the polynomial using Horner rule.
/// TODO:
} // namespace GiNaC
-#endif // GINAC_EVAL_UPOLY_TCC
-
+#endif // ndef GINAC_EVAL_UPOLY_H
-#ifndef GINAC_GCD_EUCLID
-#define GINAC_GCD_EUCLID
+/** @file gcd_euclid.h
+ *
+ * GCD using Euclidean algorithm. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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
+ */
+
+#ifndef GINAC_GCD_EUCLID_H
+#define GINAC_GCD_EUCLID_H
+
#include "upoly.h"
#include "remainder.h"
#include "normalize.h"
#include "debug.h"
#include "upoly_io.h"
-namespace GiNaC
-{
+namespace GiNaC {
static bool
gcd_euclid(umodpoly& c, umodpoly /* passed by value */ a, umodpoly b)
} // namespace GiNaC
-#endif // GINAC_GCD_EUCLID
-
+#endif // ndef GINAC_GCD_EUCLID_H
+/** @file gcd_uvar.cpp
+ *
+ * Several GCD algorithms. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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 "upoly.h"
#include "sr_gcd_uvar.h"
#include "heur_gcd_uvar.h"
+
#include <stdexcept>
-namespace GiNaC
-{
+namespace GiNaC {
upoly sr_gcd(const upoly& a, const upoly& b)
{
}
-}
-
+} // namespace GiNaC
-#ifndef GINAC_UPOLY_HEUR_GCD
-#define GINAC_UPOLY_HEUR_GCD
+/** @file heur_gcd_uvar.h
+ *
+ * Heuristic GCD code. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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
+ */
+
+#ifndef GINAC_UPOLY_HEUR_GCD_H
+#define GINAC_UPOLY_HEUR_GCD_H
+
#include "upoly.h"
#include "ring_traits.h"
#include "normalize.h"
#include "remainder.h"
#include "eval_uvar.h"
#include "interpolate_padic_uvar.h"
+
#include <algorithm>
-namespace GiNaC
-{
+namespace GiNaC {
/// Compute GCD of primitive univariate polynomials.
template<typename T> static bool
} // namespace GiNaC
-#endif // GINAC_UPOLY_HEUR_GCD
-
+#endif // ndef GINAC_UPOLY_HEUR_GCD_H
-#ifndef GINAC_UPOLY_INTERPOLATE_PADIC_TCC
-#define GINAC_UPOLY_INTERPOLATE_PADIC_TCC
+/** @file interpolate_padic_uvar.h
+ *
+ * Utility function for interpolation. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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
+ */
+
+#ifndef GINAC_UPOLY_INTERPOLATE_PADIC_H
+#define GINAC_UPOLY_INTERPOLATE_PADIC_H
+
#include "ring_traits.h"
-namespace cln
-{
+namespace cln {
+
static inline cln::cl_I smod(const cln::cl_I& x, const cln::cl_I y)
{
cln::cl_I r = mod(x, y);
} // namespace cln
-namespace GiNaC
-{
+namespace GiNaC {
template<typename T> static void
interpolate(T& g, const typename T::value_type& gamma,
} // namespace GiNaC
-#endif // GINAC_UPOLY_INTERPOLATE_PADIC_TCC
-
+#endif // ndef GINAC_UPOLY_INTERPOLATE_PADIC_H
+/** @file mgcd.cpp
+ *
+ * Chinese remainder algorithm. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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 "operators.h"
#include "chinrem_gcd.h"
-#include <cln/integer.h>
#include "pgcd.h"
#include "collect_vargs.h"
#include "primes_factory.h"
#include "divide_in_z_p.h"
#include "poly_cra.h"
-namespace GiNaC
-{
+#include <cln/integer.h>
+
+namespace GiNaC {
static cln::cl_I extract_integer_content(ex& Apr, const ex& A)
{
}
} // namespace GiNaC
-
+/** @file mod_gcd.cpp
+ *
+ * Implementation of modular GCD. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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 "upoly.h"
#include "gcd_euclid.h"
#include "cra_garner.h"
-#include <cln/random.h>
+#include "debug.h"
+
#include <cln/numtheory.h>
+#include <cln/random.h>
#include <stdexcept>
-#include "debug.h"
-namespace GiNaC
-{
+namespace GiNaC {
+
/**
* @brief Remove the integer content from univariate polynomials A and B.
*
}
} // namespace GiNaC
-
-#ifndef GINAC_MOD_GCD_HPP
-#define GINAC_MOD_GCD_HPP
+/** @file mod_gcd.h
+ *
+ * Interface to modular GCD. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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
+ */
+
+#ifndef GINAC_MOD_GCD_H
+#define GINAC_MOD_GCD_H
+
#include "upoly.h"
-namespace GiNaC
-{
+namespace GiNaC {
+
extern void mod_gcd(upoly& result, upoly A, upoly B);
-}
-#endif // GINAC_MOD_GCD_HPP
+} // namespace GiNaC
+#endif // ndef GINAC_MOD_GCD_H
+/** @file newton_interpolate.h
+ *
+ * Functions for Newton interpolation. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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
+ */
+
#ifndef GINAC_PGCD_NEWTON_INTERPOLATE_H
#define GINAC_PGCD_NEWTON_INTERPOLATE_H
+
#include "ex.h"
#include "numeric.h"
#include "smod_helpers.h"
-namespace GiNaC
-{
+
+namespace GiNaC {
/**
* Newton interpolation -- incremental form.
return tmp;
}
-}
-#endif /* GINAC_PGCD_NEWTON_INTERPOLATE_H */
+} // namespace GiNaC
+
+#endif // ndef GINAC_PGCD_NEWTON_INTERPOLATE_H
-#ifndef GINAC_UPOLY_NORMALIZE_TCC
-#define GINAC_UPOLY_NORMALIZE_TCC
+/** @file normalize.h
+ *
+ * Functions to normalize polynomials in a field. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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
+ */
+
+#ifndef GINAC_UPOLY_NORMALIZE_H
+#define GINAC_UPOLY_NORMALIZE_H
+
#include "upoly.h"
#include "ring_traits.h"
#include "debug.h"
-namespace GiNaC
-{
+namespace GiNaC {
/// Make the univariate polynomial @a a \in F[x] unit normal.
/// F should be a field.
} // namespace GiNaC
-#endif // GINAC_UPOLY_NORMALIZE_TCC
-
+#endif // GINAC_UPOLY_NORMALIZE_H
-#include <algorithm>
-#include <cstddef>
+/** @file optimal_vars_finder.cpp
+ *
+ * Functions to optimize the choice of variable for multivariate GCD. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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 "optimal_vars_finder.h"
#include "add.h"
#include "mul.h"
#include "symbol.h"
#include "numeric.h"
-namespace GiNaC
-{
-namespace
-{
+#include <algorithm>
+#include <cstddef>
+
+namespace GiNaC {
+
+namespace {
// XXX: copy-pasted from normal.cpp.
/*
* Statistical information about symbols in polynomials
}
} // namespace GiNaC
-
+/** @file optimal_vars_finder.h
+ *
+ * Interface to a function that optimizes the choice of variable for GCD
+ * computations. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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
+ */
+
#ifndef GINAC_CHINREM_GCD_OPTIMAL_SYMBOL_FINDER_H
#define GINAC_CHINREM_GCD_OPTIMAL_SYMBOL_FINDER_H
-#include <vector>
+
#include "ex.h"
-namespace GiNaC
-{
+#include <vector>
+
+namespace GiNaC {
+
/**
* @brief Find the order of variables which is optimal for GCD computation.
*
* for GCD computation.
*/
extern exvector gcd_optimal_variables_order(const ex& A, const ex& B);
-}
-#endif /* GINAC_CHINREM_GCD_OPTIMAL_SYMBOL_FINDER_H */
+} // namespace GiNaC
+
+#endif // GINAC_CHINREM_GCD_OPTIMAL_SYMBOL_FINDER_H
+/** @file pgcd.cpp
+ *
+ * GCD for polynomials in prime field. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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 "pgcd.h"
#include "collect_vargs.h"
#include "smod_helpers.h"
#include "newton_interpolate.h"
#include "divide_in_z_p.h"
-namespace GiNaC
-{
+namespace GiNaC {
extern void
primpart_content(ex& pp, ex& c, ex e, const exvector& vars, const long p);
}
} // namespace GiNaC
-
+/** @file pgcd.h
+ *
+ * Interface to GCD functions for polynomials over prime fields. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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
+ */
+
#ifndef GINAC_CHINREM_GCD_PGCD_H
#define GINAC_CHINREM_GCD_PGCD_H
+
#include "ex.h"
-namespace GiNaC
-{
+namespace GiNaC {
/// Exception to be thrown when modular GCD algorithm fails
struct pgcd_failed
} // namespace GiNaC
-#endif
+#endif // ndef GINAC_CHINREM_GCD_PGCD_H
+/** @file poly_cra.h
+ *
+ * Chinese remainder algorithm. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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
+ */
+
#ifndef GINAC_POLY_CRA_H
#define GINAC_POLY_CRA_H
+
#include "ex.h"
-#include <cln/integer.h>
#include "smod_helpers.h"
-namespace GiNaC
-{
+#include <cln/integer.h>
+
+namespace GiNaC {
/**
* @brief Chinese reamainder algorithm for polynomials.
} // namespace GiNaC
-#endif /* GINAC_POLY_CRA_H */
-
+#endif // ndef GINAC_POLY_CRA_H
-#ifndef GINAC_POLYNOMIAL_PREM_TCC
-#define GINAC_POLYNOMIAL_PREM_TCC
+/** @file prem_uvar.h
+ *
+ * Function to calculate the pseudo-remainder. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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
+ */
+
+#ifndef GINAC_POLYNOMIAL_PREM_H
+#define GINAC_POLYNOMIAL_PREM_H
+
#include "upoly.h"
#include "debug.h"
#include "remainder.h"
-namespace GiNaC
-{
+namespace GiNaC {
/// Compute the pseudo-remainder of univariate polynomials @a a and @a b
/// Pseudo remainder \f$r(x)\f$ is defined as
return remainder_in_ring(r, a_, b);
}
-}
-
-#endif // GINAC_POLYNOMIAL_PREM_TCC
+} // namespace GiNaC
+#endif // GINAC_POLYNOMIAL_PREM_H
+/** @file primes_factory.h
+ *
+ * Factory for prime numbers. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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
+ */
+
#ifndef GINAC_CHINREM_GCD_PRIMES_FACTORY_H
#define GINAC_CHINREM_GCD_PRIMES_FACTORY_H
+
+#include "smod_helpers.h"
+#include "debug.h"
+
#include <cln/integer.h>
#include <cln/numtheory.h>
#include <limits>
-#include "smod_helpers.h"
-#include "debug.h"
-namespace GiNaC
-{
+namespace GiNaC {
/**
* Find a `big' prime p such that lc mod p != 0. Helper class used by modular
} // namespace GiNaC
-#endif /* GINAC_CHINREM_GCD_PRIMES_FACTORY_H */
-
+#endif // ndef GINAC_CHINREM_GCD_PRIMES_FACTORY_H
+/** @file primpart_content.cpp
+ *
+ * Function to find primitive part of a multivariate polynomial. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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 "ex.h"
#include "numeric.h"
#include "collect_vargs.h"
#include "divide_in_z_p.h"
#include "debug.h"
-namespace GiNaC
-{
+namespace GiNaC {
/**
* Compute the primitive part and the content of a modular multivariate
}
} // namespace GiNaC
-
-#ifndef GINAC_UPOLY_REMAINDER_TCC
-#define GINAC_UPOLY_REMAINDER_TCC
+/** @file remainder.h
+ *
+ * Functions calculating remainders. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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
+ */
+
+#ifndef GINAC_UPOLY_REMAINDER_H
+#define GINAC_UPOLY_REMAINDER_H
+
#include "upoly.h"
#include "ring_traits.h"
#include "upoly_io.h"
#include "debug.h"
-namespace GiNaC
-{
+namespace GiNaC {
+
/**
* @brief Polynomial remainder for univariate polynomials over fields
*
canonicalize(r);
return r.empty();
}
-} // namespace GiNaC
-#endif // GINAC_UPOLY_REMAINDER_TCC
+} // namespace GiNaC
+#endif // GINAC_UPOLY_REMAINDER_H
-#ifndef GINAC_RING_TRAITS_HPP
-#define GINAC_RING_TRAITS_HPP
+/** @file ring_traits.h
+ *
+ * Functions for polynomial ring arithmetic. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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
+ */
+
+#ifndef GINAC_RING_TRAITS_H
+#define GINAC_RING_TRAITS_H
+
#include <cln/integer.h>
#include <cln/modinteger.h>
-namespace cln
-{
+namespace cln {
+
static inline cln::cl_I div(const cln::cl_I& x, const cln::cl_I& y)
{
return cln::exquo(x, y);
} // namespace cln
-#endif // GINAC_RING_TRAITS_HPP
-
+#endif // GINAC_RING_TRAITS_H
+/** @file smod_helpers.h
+ *
+ * Utility functions for modular arithmetic. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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
+ */
+
#ifndef GINAC_POLYNOMIAL_SMOD_HELPERS_H
#define GINAC_POLYNOMIAL_SMOD_HELPERS_H
-#include <cln/integer.h>
-#include <cln/integer_io.h>
+
#include "ex.h"
#include "numeric.h"
#include "debug.h"
-namespace GiNaC
-{
+#include <cln/integer.h>
+#include <cln/integer_io.h>
+
+namespace GiNaC {
/// Z -> Z_p (in the symmetric representation)
static inline cln::cl_I smod(const cln::cl_I& a, long p)
-#ifndef GINAC_UPOLY_SR_GCD_TCC
-#define GINAC_UPOLY_SR_GCD_TCC
+/** @file sr_gcd_uvar.h
+ *
+ * GCD function for univariate polynomials using PRS method. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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
+ */
+
+#ifndef GINAC_UPOLY_SR_GCD_H
+#define GINAC_UPOLY_SR_GCD_H
+
#include "upoly.h"
#include "ring_traits.h"
#include "normalize.h"
#include "prem_uvar.h"
+
#include <limits>
-namespace GiNaC
-{
+namespace GiNaC {
/// Calculate GCD of two univariate polynomials @a a and @a b using
/// subresultant pseudo-remainder sequence method
} while (true);
}
-}
-
-#endif // GINAC_UPOLY_SR_GCD_TCC
+} // namespace GiNaC
+#endif // GINAC_UPOLY_SR_GCD_H
-#ifndef GINAC_NEW_UPOLY_HPP
-#define GINAC_NEW_UPOLY_HPP
-#include <vector>
-#include <cstddef>
+/** @file upoly.h
+ *
+ * Interface to polynomials with integer and modular coefficients. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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
+ */
+
+#ifndef GINAC_UPOLY_H
+#define GINAC_UPOLY_H
+
+#include "ring_traits.h"
+#include "debug.h"
+#include "compiler.h"
+
#include <cln/integer.h>
-#include <cln/modinteger.h>
#include <cln/integer_io.h>
-#include <stdexcept>
+#include <cln/modinteger.h>
+#include <cstddef>
#include <iterator>
#include <limits>
-#include "ring_traits.h"
-#include "debug.h"
-#include "compiler.h"
+#include <stdexcept>
+#include <vector>
-namespace GiNaC
-{
+namespace GiNaC {
typedef std::vector<cln::cl_I> upoly;
typedef std::vector<cln::cl_MI> umodpoly;
} // namespace GiNaC
-#endif // GINAC_NEW_UPOLY_HPP
-
+#endif // GINAC_UPOLY_H
-#include <iostream>
-#include <string>
+/** @file upoly_io.cpp
+ *
+ * Input/Output function for univariate polynomials. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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 "upoly.h"
#include "upoly_io.h"
+
#include <cln/integer_io.h>
+#include <iostream>
+#include <string>
+
+namespace GiNaC {
-namespace GiNaC
-{
using std::ostream;
using std::string;
}
}
-#define DEFINE_OPERATOR_OUT(type) \
-std::ostream& operator<<(std::ostream& os, const type& p) \
-{ \
- print(p, os); \
- return os; \
-} \
-void dbgprint(const type& p) \
-{ \
- print(p, std::cerr); \
+#define DEFINE_OPERATOR_OUT(type) \
+std::ostream& operator<<(std::ostream& os, const type& p) \
+{ \
+ print(p, os); \
+ return os; \
+} \
+void dbgprint(const type& p) \
+{ \
+ print(p, std::cerr); \
}
DEFINE_OPERATOR_OUT(upoly);
#undef DEFINE_OPERATOR_OUT
} // namespace GiNaC
-
-#ifndef GINAC_UPOLY_IO_HPP
-#define GINAC_UPOLY_IO_HPP
-#include <iostream>
+/** @file upoly_io.h
+ *
+ * Output operators for polynomials. */
+
+/*
+ * GiNaC Copyright (C) 1999-2009 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
+ */
+
+#ifndef GINAC_UPOLY_IO_H
+#define GINAC_UPOLY_IO_H
+
#include "upoly.h"
-namespace GiNaC
-{
+#include <ostream>
+
+namespace GiNaC {
+
extern std::ostream& operator<<(std::ostream&, const upoly& );
extern std::ostream& operator<<(std::ostream&, const umodpoly& );
-}
-#endif // GINAC_UPOLY_IO_HPP
+} // namespace GiNaC
+
+#endif // GINAC_UPOLY_IO_H
* Implementation of GiNaC's symbolic exponentiation (basis^exponent). */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <vector>
-#include <iostream>
-#include <stdexcept>
-#include <limits>
-
#include "power.h"
#include "expairseq.h"
#include "add.h"
#include "relational.h"
#include "compiler.h"
+#include <iostream>
+#include <limits>
+#include <stdexcept>
+#include <vector>
+
namespace GiNaC {
GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(power, basic,
* Interface to GiNaC's symbolic exponentiation (basis^exponent). */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_POWER_H__
-#define __GINAC_POWER_H__
+#ifndef GINAC_POWER_H
+#define GINAC_POWER_H
#include "basic.h"
#include "ex.h"
} // namespace GiNaC
-#endif // ndef __GINAC_POWER_H__
+#endif // ndef GINAC_POWER_H
* Implementation of helper classes for expression output. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-
#include "print.h"
+#include <iostream>
+
namespace GiNaC {
/** Next free ID for print_context types. */
* Definition of helper classes for expression output. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_PRINT_H__
-#define __GINAC_PRINT_H__
+#ifndef GINAC_PRINT_H
+#define GINAC_PRINT_H
+
+#include "class_info.h"
#include <iosfwd>
-#include <string>
#include <memory>
-
-#include "class_info.h"
+#include <string>
namespace GiNaC {
-
/** This class stores information about a registered print_context class. */
class print_context_options {
public:
} // namespace GiNaC
-#endif // ndef __GINAC_BASIC_H__
+#endif // ndef GINAC_BASIC_H
* methods for series expansion. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <numeric>
-#include <stdexcept>
-#include <limits>
-
#include "pseries.h"
#include "add.h"
#include "inifcns.h" // for Order function
#include "archive.h"
#include "utils.h"
+#include <limits>
+#include <numeric>
+#include <stdexcept>
+
namespace GiNaC {
GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(pseries, basic,
* Interface to class for extended truncated power series. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_SERIES_H__
-#define __GINAC_SERIES_H__
+#ifndef GINAC_SERIES_H
+#define GINAC_SERIES_H
#include "basic.h"
#include "expairseq.h"
} // namespace GiNaC
-#endif // ndef __GINAC_SERIES_H__
+#endif // ndef GINAC_SERIES_H
* Reference-counted pointer template. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_PTR_H__
-#define __GINAC_PTR_H__
+#ifndef GINAC_PTR_H
+#define GINAC_PTR_H
+
+#include "assertion.h"
#include <cstddef> // for size_t
#include <functional>
#include <iosfwd>
-#include "assertion.h"
-
namespace GiNaC {
-
/** Base class for reference-counted objects. */
class refcounted {
public:
} // namespace std
-#endif // ndef __GINAC_PTR_H__
+#endif // ndef GINAC_PTR_H
* GiNaC's class registrar (for class basic and all classes derived from it). */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <string>
+#include "registrar.h"
+
#include <map>
#include <stdexcept>
-
-#include "registrar.h"
+#include <string>
namespace GiNaC {
* GiNaC's class registrar (for class basic and all classes derived from it). */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_REGISTRAR_H__
-#define __GINAC_REGISTRAR_H__
-
-#include <string>
-#include <list>
-#include <vector>
-#include <typeinfo>
+#ifndef GINAC_REGISTRAR_H
+#define GINAC_REGISTRAR_H
#include "class_info.h"
#include "print.h"
+#include <list>
+#include <string>
+#include <typeinfo>
+#include <vector>
+
namespace GiNaC {
class ex;
} // namespace GiNaC
-#endif // ndef __GINAC_REGISTRAR_H__
+#endif // ndef GINAC_REGISTRAR_H
* Implementation of relations between expressions */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <stdexcept>
-
#include "relational.h"
#include "operators.h"
#include "numeric.h"
#include "archive.h"
#include "utils.h"
+#include <iostream>
+#include <stdexcept>
+
namespace GiNaC {
GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(relational, basic,
* Interface to relations between expressions. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_RELATIONAL_H__
-#define __GINAC_RELATIONAL_H__
+#ifndef GINAC_RELATIONAL_H
+#define GINAC_RELATIONAL_H
#include "basic.h"
#include "ex.h"
} // namespace GiNaC
-#endif // ndef __GINAC_RELATIONAL_H__
+#endif // ndef GINAC_RELATIONAL_H
* in GiNaC functions */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <stdexcept>
-
#include "function.h"
#include "utils.h"
#include "remember.h"
+#include <stdexcept>
+
namespace GiNaC {
//////////
* in GiNaC functions */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_REMEMBER_H__
-#define __GINAC_REMEMBER_H__
+#ifndef GINAC_REMEMBER_H
+#define GINAC_REMEMBER_H
#include <iosfwd>
-#include <vector>
#include <list>
+#include <vector>
namespace GiNaC {
} // namespace GiNaC
-#endif // ndef __GINAC_REMEMBER_H__
+#endif // ndef GINAC_REMEMBER_H
* Wrapper template for making GiNaC classes out of C++ structures. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_STRUCTURE_H__
-#define __GINAC_STRUCTURE_H__
-
-#include <functional>
+#ifndef GINAC_STRUCTURE_H
+#define GINAC_STRUCTURE_H
#include "ex.h"
#include "ncmul.h"
#include "operators.h"
#include "print.h"
-namespace GiNaC {
+#include <functional>
+namespace GiNaC {
/** Comparison policy: all structures of one type are equal */
template <class T>
template <class T, template <class> class CP>
registered_class_info structure<T, CP>::reg_info = registered_class_info(registered_class_options(structure::get_class_name(), "basic", typeid(structure<T, CP>)));
-
} // namespace GiNaC
-#endif // ndef __GINAC_STRUCTURE_H__
+#endif // ndef GINAC_STRUCTURE_H
* Implementation of GiNaC's symbolic objects. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <string>
-#include <stdexcept>
-#include <map>
-
#include "symbol.h"
#include "lst.h"
#include "archive.h"
#include "utils.h"
#include "inifcns.h"
+#include <map>
+#include <stdexcept>
+#include <string>
+
namespace GiNaC {
GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(symbol, basic,
* Interface to GiNaC's symbolic objects. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_SYMBOL_H__
-#define __GINAC_SYMBOL_H__
+#ifndef GINAC_SYMBOL_H
+#define GINAC_SYMBOL_H
-#include <string>
-#include <typeinfo>
#include "basic.h"
#include "ex.h"
#include "ptr.h"
#include "archive.h"
+#include <string>
+#include <typeinfo>
+
namespace GiNaC {
/** Basic CAS symbol. It has a name because it must know how to output itself.
} // namespace GiNaC
-#endif // ndef __GINAC_SYMBOL_H__
+#endif // ndef GINAC_SYMBOL_H
* Implementation of GiNaC's symmetry definitions. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <stdexcept>
-#include <functional>
-#include <limits>
-
#include "symmetry.h"
#include "lst.h"
#include "numeric.h" // for factorial()
#include "archive.h"
#include "utils.h"
+#include <functional>
+#include <iostream>
+#include <limits>
+#include <stdexcept>
+
namespace GiNaC {
GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(symmetry, basic,
* Interface to GiNaC's symmetry definitions. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_SYMMETRY_H__
-#define __GINAC_SYMMETRY_H__
-
-#include <set>
+#ifndef GINAC_SYMMETRY_H
+#define GINAC_SYMMETRY_H
#include "ex.h"
#include "archive.h"
-namespace GiNaC {
+#include <set>
+namespace GiNaC {
class sy_is_less;
class sy_swap;
} // namespace GiNaC
-#endif // ndef __GINAC_SYMMETRY_H__
+#endif // ndef GINAC_SYMMETRY_H
* Implementation of GiNaC's special tensors. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <stdexcept>
-#include <vector>
-
#include "tensor.h"
#include "idx.h"
#include "indexed.h"
#include "archive.h"
#include "utils.h"
+#include <iostream>
+#include <stdexcept>
+#include <vector>
+
namespace GiNaC {
GINAC_IMPLEMENT_REGISTERED_CLASS(tensor, basic)
* Interface to GiNaC's special tensors. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_TENSOR_H__
-#define __GINAC_TENSOR_H__
+#ifndef GINAC_TENSOR_H
+#define GINAC_TENSOR_H
#include "ex.h"
#include "archive.h"
namespace GiNaC {
-
/** This class holds one of GiNaC's predefined special tensors such as the
* delta and the metric tensors. They are represented without indices.
* To attach indices to them, wrap them in an object of class indexed. */
} // namespace GiNaC
-#endif // ndef __GINAC_TENSOR_H__
+#endif // ndef GINAC_TENSOR_H
* internal header file. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_TOSTRING_H__
-#define __GINAC_TOSTRING_H__
+#ifndef GINAC_TOSTRING_H
+#define GINAC_TOSTRING_H
#include <sstream>
} // namespace GiNaC
-#endif // ndef __GINAC_TOSTRING_H__
+#endif // ndef GINAC_TOSTRING_H
* but not of any interest to the user of the library. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* of any interest to the user of the library. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_UTILS_H__
-#define __GINAC_UTILS_H__
+#ifndef GINAC_UTILS_H
+#define GINAC_UTILS_H
+#include "assertion.h"
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#include <string>
#include <functional>
#ifdef HAVE_STDINT_H
#include <stdint.h> // for uintptr_t
#endif
-
-#include "assertion.h"
+#include <string>
namespace GiNaC {
} // namespace GiNaC
-
-#endif // ndef __GINAC_UTILS_H__
+#endif // ndef GINAC_UTILS_H
* Implementation of GiNaC's wildcard objects. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-
#include "wildcard.h"
#include "archive.h"
#include "utils.h"
+#include <iostream>
+
namespace GiNaC {
GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(wildcard, basic,
* Interface to GiNaC's wildcard objects. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_WILDCARD_H__
-#define __GINAC_WILDCARD_H__
+#ifndef GINAC_WILDCARD_H
+#define GINAC_WILDCARD_H
#include "ex.h"
#include "archive.h"
namespace GiNaC {
-
/** This class acts as a wildcard for subs(), match(), has() and find(). An
* integer label is used to identify different wildcards. */
class wildcard : public basic
} // namespace GiNaC
-#endif // ndef __GINAC_WILDCARD_H__
+#endif // ndef GINAC_WILDCARD_H
.PP
CLN \- A Class Library for Numbers, Bruno Haible
.SH COPYRIGHT
-Copyright \(co 1999-2008 Johannes Gutenberg Universit\(:at Mainz, Germany
+Copyright \(co 1999-2009 Johannes Gutenberg Universit\(:at 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
*
* Global definitions for ginsh.
*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* functions. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* This file must be processed with flex. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* This file must be processed with yacc/bison. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
void greeting(void)
{
cout << "ginsh - GiNaC Interactive Shell (" << PACKAGE << " V" << VERSION << ")" << endl;
- cout << " __, _______ Copyright (C) 1999-2008 Johannes Gutenberg University Mainz,\n"
+ cout << " __, _______ Copyright (C) 1999-2009 Johannes Gutenberg University Mainz,\n"
<< " (__) * | Germany. This is free software with ABSOLUTELY NO WARRANTY.\n"
<< " ._) i N a C | You are welcome to redistribute it under certain conditions.\n"
<< "<-------------' For details type `warranty;'.\n" << endl;
GiNaC Tutorial \- An open framework for symbolic computation within the
C++ programming language
.SH COPYRIGHT
-Copyright \(co 1999-2008 Johannes Gutenberg Universit\(:at Mainz, Germany
+Copyright \(co 1999-2009 Johannes Gutenberg Universit\(:at 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
* GiNaC archive file viewer. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "ginac.h"
+using namespace GiNaC;
+
#include <cstdlib>
-#include <iostream>
#include <fstream>
+#include <iostream>
#include <stdexcept>
-
-#include "ginac.h"
-
using namespace std;
-using namespace GiNaC;
int main(int argc, char **argv)
{