]> www.ginac.de Git - ginac.git/blobdiff - check/time_dennyfliegner.cpp
use "rpmbuild" instead of "rpm"
[ginac.git] / check / time_dennyfliegner.cpp
index e20fdded252f9c1d917f7c8bec1ca219fbbf5578..ea3b7be5abe9b812175a596ee8fbfccc16b23b77 100644 (file)
@@ -7,7 +7,7 @@
  *  after which e should be just a1^2. */
 
 /*
- *  GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2003 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
@@ -31,15 +31,14 @@ static unsigned expand_subs(unsigned size)
        unsigned result = 0;
        // create a vector of size symbols named "a0", "a1", ...
        vector<symbol> a;
+       ex e;
        for (unsigned i=0; i<size; ++i) {
-               char buf[4];
-               ostrstream(buf,sizeof(buf)) << i << ends;
-               a.push_back(symbol(string("a")+buf));
+               ostringstream buf;
+               buf << "a" << i << ends;
+               a.push_back(symbol(buf.str()));
+               e += a[i];
        }
-       ex e, aux;
-       
-       for (unsigned i=0; i<size; ++i)
-               e = e + a[i];
+       ex aux;
        
        // prepare aux so it will swallow anything but a1^2:
        aux = -e + a[0] + a[1];
@@ -47,7 +46,7 @@ static unsigned expand_subs(unsigned size)
        
        if (e != pow(a[1],2)) {
                clog << "Denny Fliegner's quick consistency check erroneously returned "
-                        << e << "." << endl;
+                    << e << "." << endl;
                ++result;
        }