]> www.ginac.de Git - ginac.git/blobdiff - check/exam_matrices.cpp
Fix some apparent typos and misindentations.
[ginac.git] / check / exam_matrices.cpp
index 449b6d38a15b6f47c280d823156d507b77c4b434..3e1c25e5de5ae6af233f23272763860432758c2b 100644 (file)
@@ -3,7 +3,7 @@
  *  Here we examine manipulations on GiNaC's symbolic matrices. */
 
 /*
- *  GiNaC Copyright (C) 1999-2004 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2015 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
  *
  *  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 "ginac.h"
+using namespace GiNaC;
+
+#include <iostream>
 #include <stdexcept>
-#include "exams.h"
+using namespace std;
 
 static unsigned matrix_determinants()
 {
@@ -139,9 +143,9 @@ static unsigned matrix_invert2()
        ex det = m.determinant();
        
        if ((normal(m_i(0,0)*det) != d) ||
-               (normal(m_i(0,1)*det) != -b) ||
-               (normal(m_i(1,0)*det) != -c) ||
-               (normal(m_i(1,1)*det) != a)) {
+           (normal(m_i(0,1)*det) != -b) ||
+           (normal(m_i(1,0)*det) != -c) ||
+           (normal(m_i(1,1)*det) != a)) {
                clog << "inversion of 2x2 matrix " << m
                     << " erroneously returned " << m_i << endl;
                ++result;
@@ -337,7 +341,6 @@ unsigned exam_matrices()
        unsigned result = 0;
        
        cout << "examining symbolic matrix manipulations" << flush;
-       clog << "----------symbolic matrix manipulations:" << endl;
        
        result += matrix_determinants();  cout << '.' << flush;
        result += matrix_invert1();  cout << '.' << flush;
@@ -348,12 +351,10 @@ unsigned exam_matrices()
        result += matrix_rank();  cout << "." << flush;
        result += matrix_misc();  cout << '.' << flush;
        
-       if (!result) {
-               cout << " passed " << endl;
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed " << endl;
-       }
-       
        return result;
 }
+
+int main(int argc, char** argv)
+{
+       return exam_matrices();
+}