X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?a=blobdiff_plain;f=check%2Fcheck_inifcns.cpp;h=178ab80c97aca247332f1a0417eee5b8d81b3f50;hb=7769ce49235ed6510785baa0a29801e3a59b563e;hp=b5945d2e15cca0124fded728120d6cebee96965a;hpb=383d5eb3b0f0506810d9105a268f939125bfc347;p=ginac.git diff --git a/check/check_inifcns.cpp b/check/check_inifcns.cpp index b5945d2e..178ab80c 100644 --- a/check/check_inifcns.cpp +++ b/check/check_inifcns.cpp @@ -4,7 +4,7 @@ * functions. */ /* - * GiNaC Copyright (C) 1999-2001 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2010 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,13 +18,18 @@ * * 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 "checks.h" +#include "ginac.h" +using namespace GiNaC; + +#include // for rand() +#include +using namespace std; /* Some tests on the sine trigonometric function. */ -static unsigned inifcns_check_sin(void) +static unsigned inifcns_check_sin() { unsigned result = 0; bool errorflag = false; @@ -79,7 +84,7 @@ static unsigned inifcns_check_sin(void) } /* Simple tests on the cosine trigonometric function. */ -static unsigned inifcns_check_cos(void) +static unsigned inifcns_check_cos() { unsigned result = 0; bool errorflag; @@ -133,7 +138,7 @@ static unsigned inifcns_check_cos(void) } /* Simple tests on the tangent trigonometric function. */ -static unsigned inifcns_check_tan(void) +static unsigned inifcns_check_tan() { unsigned result = 0; bool errorflag; @@ -162,7 +167,7 @@ static unsigned inifcns_check_tan(void) } /* Simple tests on the dilogarithm function. */ -static unsigned inifcns_check_Li2(void) +static unsigned inifcns_check_Li2() { // NOTE: this can safely be removed once CLN supports dilogarithms and // checks them itself. @@ -178,7 +183,7 @@ static unsigned inifcns_check_Li2(void) argument = numeric(20.0*rand()/(RAND_MAX+1.0)-10.0) + numeric(20.0*rand()/(RAND_MAX+1.0)-10.0)*I; if (abs(Li2(pow(argument,2))-2*Li2(argument)-2*Li2(-argument)) > epsilon) { - cout << "Li2(z) at z==" << argument + clog << "Li2(z) at z==" << argument << " failed to satisfy Li2(z^2)==2*(Li2(z)+Li2(-z))" << endl; errorflag = true; } @@ -190,24 +195,21 @@ static unsigned inifcns_check_Li2(void) return result; } -unsigned check_inifcns(void) +unsigned check_inifcns() { unsigned result = 0; cout << "checking consistency of symbolic functions" << flush; - clog << "---------consistency of symbolic functions:" << endl; result += inifcns_check_sin(); cout << '.' << flush; result += inifcns_check_cos(); cout << '.' << flush; result += inifcns_check_tan(); cout << '.' << flush; result += inifcns_check_Li2(); cout << '.' << flush; - if (!result) { - cout << " passed " << endl; - clog << "(no output)" << endl; - } else { - cout << " failed " << endl; - } - return result; } + +int main(int argc, char** argv) +{ + return check_inifcns(); +}