]> www.ginac.de Git - ginac.git/commitdiff
- exam_mansamples.cpp, exam_paranoia.cpp: fixes and extensions.
authorRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Thu, 22 Jun 2000 00:08:50 +0000 (00:08 +0000)
committerRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Thu, 22 Jun 2000 00:08:50 +0000 (00:08 +0000)
- ginaccint.bin.cpp: extended "silent" behaviour.

cint/exam_mansamples.cpp
cint/exam_paranoia.cpp
cint/ginaccint.bin.cpp

index d26ad3545c6236ce6c0b5c97ef24e8c6c60fbc19..6703571ba2be7dacf71cbe6546ce226c71c3ade9 100755 (executable)
@@ -5,11 +5,26 @@ symbol x("x"), y("y"), z("z");
     ex a = pow(x,2)-x-2;
     ex b = pow(x+1,2);
     ex s = a/b;
     ex a = pow(x,2)-x-2;
     ex b = pow(x+1,2);
     ex s = a/b;
-    if (!(s.diff(x)-2*pow(1+x,-3)*(-2-x+pow(x,2))-(-1+2*x)*pow(1+x,-2)).is_zero()) {
+    if (!(s.diff(x)+2/pow(1+x,3)*(-2-x+pow(x,2))-(-1+2*x)/pow(1+x,2)).is_zero()) {
         ++result;
     }
     if (!(s.normal()-(-2+x)/(1+x)).is_zero()) {
         ++result;
     }
 }
         ++result;
     }
     if (!(s.normal()-(-2+x)/(1+x)).is_zero()) {
         ++result;
     }
 }
+//GiNaC-cint.function
+ex EulerNumber(unsigned n)
+{
+    symbol xi;
+    const ex generator = pow(cosh(xi),-1);
+    return generator.diff(xi,n).subs(xi==0);
+}
+if (EulerNumber(42) != ex(numeric("-10364622733519612119397957304745185976310201"))) {
+    ++result;
+}
+ex f = expand((x*y*z-1)*(x*y*z+3));
+ex g = expand((x*y*z-1)*(x*y*z-3));
+if (gcd(f, g) != x*y*z-1) {
+    ++result;
+}
 exit(result);
 exit(result);
index 4fc7b98162785f923e0b177acb832789abadb154..d227545dcee27a9b272d5ed651171e13d9c0d535 100755 (executable)
@@ -16,7 +16,7 @@ int result = 0;
 {
     symbol x;
     ex a = x;
 {
     symbol x;
     ex a = x;
-    if (bool(a != a)) {
+    if (a != a) {
         ++result;
     }
 }
         ++result;
     }
 }
index db27e2b8adfe0b5f8604d360075509b5fbce7672..de396e60ecdb14454a1ddf37ee7be947a1b7742b 100644 (file)
@@ -3,8 +3,8 @@
 
 #include "G__ci.h"   /* G__atpause is defined in G__ci.h */
 
 
 #include "G__ci.h"   /* G__atpause is defined in G__ci.h */
 
-#if (!defined(G__CINTVERSION)) || (G__CINTVERSION < 501438)
-#error You need at least cint 5.14.38 to compile GiNaC-cint. Download it via http from root.cern.ch/root/Cint.html or via ftp from ftpthep.physik.uni-mainz.de/pub/cint
+#if (!defined(G__CINTVERSION)) || (G__CINTVERSION < 501439)
+#error You need at least cint 5.14.39 to compile GiNaC-cint. Download it via http from root.cern.ch/root/Cint.html or via ftp from ftpthep.physik.uni-mainz.de/pub/cint
 #endif // (!defined(G__CINTVERSION)) || (G__CINTVERSION < 501438)
 
 #include <iostream>
 #endif // (!defined(G__CINTVERSION)) || (G__CINTVERSION < 501438)
 
 #include <iostream>
@@ -86,7 +86,8 @@ G__value exec_tempfile(string const & command)
 char * process_permanentfile(string const & command)
 {
     char *tmpfilename = tempnam(NULL,"ginac");
 char * process_permanentfile(string const & command)
 {
     char *tmpfilename = tempnam(NULL,"ginac");
-    cout << "creating file " << tmpfilename << endl;
+    if (!silent)
+        cout << "creating file " << tmpfilename << endl;
     ofstream fout;
     fout.open(tmpfilename);
     fout << command << endl;
     ofstream fout;
     fout.open(tmpfilename);
     fout << command << endl;
@@ -170,7 +171,7 @@ void greeting(void)
          << " (__) *       | Germany.  Cint C/C++ interpreter: (C) 1995-2000 Masaharu\n"
          << "  ._) i N a C | Goto and Agilent Technologies, Japan.  This is free software\n"
          << "<-------------' with ABSOLUTELY NO WARRANTY.  For details, type `.warranty'\n"
          << " (__) *       | Germany.  Cint C/C++ interpreter: (C) 1995-2000 Masaharu\n"
          << "  ._) i N a C | Goto and Agilent Technologies, Japan.  This is free software\n"
          << "<-------------' with ABSOLUTELY NO WARRANTY.  For details, type `.warranty'\n"
-         << "Type .help for help.\n\n";
+         << "Type `.help' for help.\n\n";
     return;
 }
 
     return;
 }
 
@@ -313,7 +314,8 @@ string preprocess(char const * const line, bool & comment, bool & single_quote,
 void cleanup(void)
 {
     for (cplist::iterator it=filenames.begin(); it!=filenames.end(); ++it) {
 void cleanup(void)
 {
     for (cplist::iterator it=filenames.begin(); it!=filenames.end(); ++it) {
-        cout << "removing file " << *it << endl;
+        if (!silent)
+            cout << "removing file " << *it << endl;
         remove(*it);
         free(*it);
     }
         remove(*it);
         free(*it);
     }
@@ -470,7 +472,8 @@ bool readlines(istream * is,
             (is_command(command,preprocessed,"q"))) {
             quit = true;
         } else if (is_command(command,preprocessed,"function")) {
             (is_command(command,preprocessed,"q"))) {
             quit = true;
         } else if (is_command(command,preprocessed,"function")) {
-            cout << "next expression can be a function definition" << endl;
+            if (!silent)
+                cout << "next expression can be a function definition" << endl;
             next_command_is_function = true;
         } else if (is_command(command,preprocessed,"cint")) {
             cout << endl << "switching to cint interactive mode" << endl;
             next_command_is_function = true;
         } else if (is_command(command,preprocessed,"cint")) {
             cout << endl << "switching to cint interactive mode" << endl;