aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/main.h
diff options
context:
space:
mode:
Diffstat (limited to 'test/main.h')
-rw-r--r--test/main.h28
1 files changed, 15 insertions, 13 deletions
diff --git a/test/main.h b/test/main.h
index 05853481c..c5aa3c085 100644
--- a/test/main.h
+++ b/test/main.h
@@ -1,19 +1,19 @@
-// This file is part of Eigen, a lightweight C++ template library
-// for linear algebra. Eigen itself is part of the KDE project.
+// This file is part of gen, a lightweight C++ template library
+// for linear algebra. gen itself is part of the KDE project.
//
// Copyright (C) 2006-2007 Benoit Jacob <jacob@math.jussieu.fr>
//
-// Eigen is free software; you can redistribute it and/or modify it under the
+// gen is free software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the Free Software
// Foundation; either version 2 or (at your option) any later version.
//
-// Eigen is distributed in the hope that it will be useful, but WITHOUT ANY
+// gen is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along
-// with Eigen; if not, write to the Free Software Foundation, Inc., 51
+// with gen; if not, write to the Free Software Foundation, Inc., 51
// Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
//
// As a special exception, if other files instantiate templates or use macros
@@ -29,17 +29,19 @@
#include <QtTest/QtTest>
#include "../src/Core.h"
+USING_EIGEN_DATA_TYPES
+
#include <cstdlib>
#include <ctime>
using namespace std;
-class EigenTest : public QObject
+class genTest : public QObject
{
Q_OBJECT
public:
- EigenTest();
+ genTest();
private slots:
void testVectorOps();
@@ -47,7 +49,7 @@ class EigenTest : public QObject
void testMatrixManip();
};
-template<typename T> inline typename EiNumTraits<T>::Real TestEpsilon();
+template<typename T> inline typename Eigen::NumTraits<T>::Real TestEpsilon();
template<> inline int TestEpsilon<int>() { return 0; }
template<> inline float TestEpsilon<float>() { return 1e-2f; }
template<> inline double TestEpsilon<double>() { return 1e-4; }
@@ -57,21 +59,21 @@ template<> inline double TestEpsilon<std::complex<double> >() { return TestEpsil
template<typename T> bool TestNegligible(const T& a, const T& b)
{
- return(EiAbs(a) <= EiAbs(b) * TestEpsilon<T>());
+ return(Abs(a) <= Abs(b) * TestEpsilon<T>());
}
template<typename T> bool TestApprox(const T& a, const T& b)
{
- if(EiNumTraits<T>::IsFloat)
- return(EiAbs(a - b) <= std::min(EiAbs(a), EiAbs(b)) * TestEpsilon<T>());
+ if(Eigen::NumTraits<T>::IsFloat)
+ return(Abs(a - b) <= std::min(Abs(a), Abs(b)) * TestEpsilon<T>());
else
return(a == b);
}
template<typename T> bool TestLessThanOrApprox(const T& a, const T& b)
{
- if(EiNumTraits<T>::IsFloat)
- return(a < b || EiApprox(a, b));
+ if(Eigen::NumTraits<T>::IsFloat)
+ return(a < b || Approx(a, b));
else
return(a <= b);
}