X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=check%2Fexam_inifcns.cpp;h=ba1ba9a6b26acd22044f0ef4e6a7086ea4c52d39;hp=7274baae518b5edcdd7487269d9d4908088dd826;hb=5146d1bd6eb0a93d6033c1a9b33b643c5faf15a6;hpb=6d225ee55693c0617d254e6fa283c00c71bd2919 diff --git a/check/exam_inifcns.cpp b/check/exam_inifcns.cpp index 7274baae..ba1ba9a6 100644 --- a/check/exam_inifcns.cpp +++ b/check/exam_inifcns.cpp @@ -4,7 +4,7 @@ * functions. */ /* - * GiNaC Copyright (C) 1999-2004 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2011 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 @@ -18,15 +18,20 @@ * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "exams.h" +#include "ginac.h" +using namespace GiNaC; + +#include +using namespace std; /* Assorted tests on other transcendental functions. */ static unsigned inifcns_consist_trans() { using GiNaC::asin; using GiNaC::acos; + using GiNaC::asinh; using GiNaC::acosh; using GiNaC::atanh; unsigned result = 0; symbol x("x"); @@ -120,6 +125,7 @@ static unsigned inifcns_consist_trans() * exists in closed form and check if it's ok. */ static unsigned inifcns_consist_gamma() { + using GiNaC::tgamma; unsigned result = 0; ex e; @@ -166,6 +172,7 @@ static unsigned inifcns_consist_gamma() static unsigned inifcns_consist_psi() { using GiNaC::log; + using GiNaC::tgamma; unsigned result = 0; symbol x; @@ -212,24 +219,36 @@ static unsigned inifcns_consist_zeta() return result; } +static unsigned inifcns_consist_various() +{ + unsigned result = 0; + symbol n; + ex e; + + if ( binomial(n, 0) != 1 ) { + clog << "ERROR: binomial(n,0) != 1" << endl; + ++result; + } + + return result; +} + unsigned exam_inifcns() { unsigned result = 0; cout << "examining consistency of symbolic functions" << flush; - clog << "----------consistency of symbolic functions:" << endl; result += inifcns_consist_trans(); cout << '.' << flush; result += inifcns_consist_gamma(); cout << '.' << flush; result += inifcns_consist_psi(); cout << '.' << flush; result += inifcns_consist_zeta(); cout << '.' << flush; - - if (!result) { - cout << " passed " << endl; - clog << "(no output)" << endl; - } else { - cout << " failed " << endl; - } + result += inifcns_consist_various(); cout << '.' << flush; return result; } + +int main(int argc, char** argv) +{ + return exam_inifcns(); +}