- Added inclusion of <sstream> or <strstream> since <ginac/ginac.h> now
authorRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Fri, 11 May 2001 14:51:40 +0000 (14:51 +0000)
committerRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Fri, 11 May 2001 14:51:40 +0000 (14:51 +0000)
  does not do so any more.

check/check_lsolve.cpp

index 4ad320346df1dd126ddd4cc7e7f0c8eacd9dee3a..59264d9d1cb4cf23b173d438a72db6dca27529d5 100644 (file)
 
 #include "checks.h"
 
+#if defined(HAVE_SSTREAM)
+#  include <sstream>
+#else
+#  include <strstream>
+#endif
+
 static unsigned check_matrix_solve(unsigned m, unsigned n, unsigned p,
                                                                   unsigned degree)
 {
@@ -49,9 +55,15 @@ static unsigned check_matrix_solve(unsigned m, unsigned n, unsigned p,
        matrix X(n,p);
        for (unsigned i=0; i<n; ++i) {
                for (unsigned j=0; j<p; ++j) {
+#if defined(HAVE_SSTREAM)
+                       ostringstream buf;
+                       buf << "x" << i << j << ends;
+                       x.push_back(symbol(buf.str()));
+#else
                        char buf[4];
                        ostrstream(buf,sizeof(buf)) << i << j << ends;
                        x.push_back(symbol(string("x")+buf));
+#endif
                        X.set(i,j,x[p*i+j]);
                }
        }
@@ -101,10 +113,17 @@ static unsigned check_inifcns_lsolve(unsigned n)
                vector<symbol> a;
                vector<symbol> x;
                for (unsigned i=0; i<n; ++i) {
+#if defined(HAVE_SSTREAM)
+                       ostringstream buf;
+                       buf << i << ends;
+                       a.push_back(symbol(string("a")+buf.str()));
+                       x.push_back(symbol(string("x")+buf.str()));
+#else
                        char buf[3];
                        ostrstream(buf,sizeof(buf)) << i << ends;
                        a.push_back(symbol(string("a")+buf));
                        x.push_back(symbol(string("x")+buf));
+#endif
                }
                lst eqns;  // equation list
                lst vars;  // variable list