aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2007-10-11 20:14:01 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2007-10-11 20:14:01 +0000
commit61de15f3610d11e0bbd2eccc02c21e7abb343ac1 (patch)
treed33eb0fae1fdd6e938df60a068bc79c53b4d0197
parent3c98677376fb33f11fe2f786a49bc97b07743711 (diff)
Democracy 1 - 0 Dictatorship
After huge thread on eigen mailing list, it appears that i'm the only one in favor of prefix Ei. Everybody else prefers namespace Eigen like we did in Eigen 1. So, revert. Also add a macro USING_EIGEN_DATA_TYPES that application programmers can use to automatically do "using"on the Matrix class and its matrix/vector typedefs: using Eigen::Matrix; using Eigen::Matrix2d; using Eigen::Vector2d; ... (the list of typedefs is really long). thanks to the suffixes, the Vector typedefs aren't really polluting. CCMAIL:eigen@lists.tuxfamily.org P.S. Danny, please skip this one :) I know you already reported the namespace->prefix move, now that one would be too much noise :)
-rw-r--r--CMakeLists.txt2
-rw-r--r--doc/example.cpp10
-rw-r--r--doc/tutorial.cpp6
-rw-r--r--src/CMakeLists.txt4
-rw-r--r--src/Core.h9
-rw-r--r--src/Core/Block.h36
-rw-r--r--src/Core/CMakeLists.txt4
-rw-r--r--src/Core/Column.h32
-rw-r--r--src/Core/Conjugate.h34
-rw-r--r--src/Core/CopyHelper.h24
-rw-r--r--src/Core/Dot.h42
-rw-r--r--src/Core/Eval.h26
-rw-r--r--src/Core/Fuzzy.h22
-rw-r--r--src/Core/Matrix.h75
-rw-r--r--src/Core/MatrixOps.h98
-rw-r--r--src/Core/MatrixRef.h38
-rw-r--r--src/Core/MatrixStorage.h34
-rw-r--r--src/Core/Minor.h40
-rw-r--r--src/Core/Numeric.h72
-rw-r--r--src/Core/Object.h60
-rw-r--r--src/Core/Random.h28
-rw-r--r--src/Core/Row.h36
-rw-r--r--src/Core/ScalarOps.h48
-rw-r--r--src/Core/Trace.h24
-rw-r--r--src/Core/Transpose.h32
-rw-r--r--src/Core/Util.h66
-rw-r--r--test/CMakeLists.txt2
-rw-r--r--test/main.cpp14
-rw-r--r--test/main.h28
-rw-r--r--test/matrixmanip.cpp24
-rw-r--r--test/matrixops.cpp32
-rw-r--r--test/vectorops.cpp26
32 files changed, 531 insertions, 497 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 180453180..e499bdf92 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-project(Eigen)
+project(gen)
OPTION(BUILD_TESTS "Build tests" OFF)
OPTION(BUILD_EXAMPLES "Build examples" OFF)
diff --git a/doc/example.cpp b/doc/example.cpp
index 75d47f988..ca10d077a 100644
--- a/doc/example.cpp
+++ b/doc/example.cpp
@@ -1,23 +1,25 @@
#include "../src/Core.h"
+USING_EIGEN_DATA_TYPES
+
using namespace std;
template<typename Scalar, typename Derived>
-void foo(const EiObject<Scalar, Derived>& m)
+void foo(const Eigen::Object<Scalar, Derived>& m)
{
cout << "Here's m:" << endl << m << endl;
}
template<typename Scalar, typename Derived>
-EiScalarProduct<Derived>
-twice(const EiObject<Scalar, Derived>& m)
+Eigen::ScalarProduct<Derived>
+twice(const Eigen::Object<Scalar, Derived>& m)
{
return 2 * m;
}
int main(int, char**)
{
- EiMatrix2d m;
+ Matrix2d m;
m(0,0)= 1;
m(1,0)= 2;
m(0,1)= 3;
diff --git a/doc/tutorial.cpp b/doc/tutorial.cpp
index ab145bf3f..4400bd2d1 100644
--- a/doc/tutorial.cpp
+++ b/doc/tutorial.cpp
@@ -1,10 +1,12 @@
#include "../src/Core.h"
+USING_EIGEN_DATA_TYPES
+
using namespace std;
int main(int, char **)
{
- EiMatrix<double,2,2> m; // 2x2 fixed-size matrix with uninitialized entries
+ Matrix<double,2,2> m; // 2x2 fixed-size matrix with uninitialized entries
m(0,0) = 1;
m(0,1) = 2;
m(1,0) = 3;
@@ -12,7 +14,7 @@ int main(int, char **)
cout << "Here is a 2x2 matrix m:" << endl << m << endl;
cout << "Let us now build a 4x4 matrix m2 by assembling together four 2x2 blocks." << endl;
- EiMatrixXd m2(4,4); // dynamic matrix with initial size 4x4 and uninitialized entries
+ MatrixXd m2(4,4); // dynamic matrix with initial size 4x4 and uninitialized entries
// notice how we are mixing fixed-size and dynamic-size types.
cout << "In the top-left block, we put the matrix m shown above." << endl;
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 12c48c4a4..78a05eec6 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,4 +1,4 @@
-FILE(GLOB Eigen_SRCS "*.h")
+FILE(GLOB gen_SRCS "*.h")
SET(INCLUDE_INSTALL_DIR
"${CMAKE_INSTALL_PREFIX}/include/eigen2"
@@ -7,7 +7,7 @@ SET(INCLUDE_INSTALL_DIR
FORCE)
INSTALL(FILES
- ${Eigen_SRCS}
+ ${gen_SRCS}
DESTINATION ${INCLUDE_INSTALL_DIR}
)
diff --git a/src/Core.h b/src/Core.h
index 658f7fe08..2fd9423dd 100644
--- a/src/Core.h
+++ b/src/Core.h
@@ -1,3 +1,10 @@
+
+#include <iostream>
+#include <complex>
+#include <cassert>
+
+namespace Eigen {
+
#include "Core/Util.h"
#include "Core/Numeric.h"
#include "Core/Object.h"
@@ -14,3 +21,5 @@
#include "Core/Trace.h"
#include "Core/Dot.h"
#include "Core/Random.h"
+
+} // namespace Eigen
diff --git a/src/Core/Block.h b/src/Core/Block.h
index 90bb9ac8a..1ddd86540 100644
--- a/src/Core/Block.h
+++ b/src/Core/Block.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
@@ -26,18 +26,18 @@
#ifndef EI_BLOCK_H
#define EI_BLOCK_H
-template<typename MatrixType> class EiBlock
- : public EiObject<typename MatrixType::Scalar, EiBlock<MatrixType> >
+template<typename MatrixType> class Block
+ : public Object<typename MatrixType::Scalar, Block<MatrixType> >
{
public:
typedef typename MatrixType::Scalar Scalar;
typedef typename MatrixType::Ref MatRef;
- friend class EiObject<Scalar, EiBlock<MatrixType> >;
+ friend class Object<Scalar, Block<MatrixType> >;
- static const int RowsAtCompileTime = EiDynamic,
- ColsAtCompileTime = EiDynamic;
+ static const int RowsAtCompileTime = Dynamic,
+ ColsAtCompileTime = Dynamic;
- EiBlock(const MatRef& matrix,
+ Block(const MatRef& matrix,
int startRow, int endRow,
int startCol = 0, int endCol = 0)
: m_matrix(matrix), m_startRow(startRow), m_endRow(endRow),
@@ -47,15 +47,15 @@ template<typename MatrixType> class EiBlock
&& startCol >= 0 && startCol <= endCol && endCol < matrix.cols());
}
- EiBlock(const EiBlock& other)
+ Block(const Block& other)
: m_matrix(other.m_matrix), m_startRow(other.m_startRow), m_endRow(other.m_endRow),
m_startCol(other.m_startCol), m_endCol(other.m_endCol) {}
- EI_INHERIT_ASSIGNMENT_OPERATORS(EiBlock)
+ EI_INHERIT_ASSIGNMENT_OPERATORS(Block)
private:
- EiBlock& _ref() { return *this; }
- const EiBlock& _constRef() const { return *this; }
+ Block& _ref() { return *this; }
+ const Block& _constRef() const { return *this; }
int _rows() const { return m_endRow - m_startRow + 1; }
int _cols() const { return m_endCol - m_startCol + 1; }
@@ -75,10 +75,10 @@ template<typename MatrixType> class EiBlock
};
template<typename Scalar, typename Derived>
-EiBlock<Derived>
-EiObject<Scalar, Derived>::block(int startRow, int endRow, int startCol, int endCol)
+Block<Derived>
+Object<Scalar, Derived>::block(int startRow, int endRow, int startCol, int endCol)
{
- return EiBlock<Derived>(static_cast<Derived*>(this)->ref(), startRow, endRow, startCol, endCol);
+ return Block<Derived>(static_cast<Derived*>(this)->ref(), startRow, endRow, startCol, endCol);
}
#endif // EI_BLOCK_H
diff --git a/src/Core/CMakeLists.txt b/src/Core/CMakeLists.txt
index dc4473416..f5a6743ce 100644
--- a/src/Core/CMakeLists.txt
+++ b/src/Core/CMakeLists.txt
@@ -1,6 +1,6 @@
-FILE(GLOB Eigen_Core_SRCS "*.h")
+FILE(GLOB gen_Core_SRCS "*.h")
INSTALL(FILES
- ${Eigen_Core_SRCS}
+ ${gen_Core_SRCS}
DESTINATION ${INCLUDE_INSTALL_DIR}/Core
)
diff --git a/src/Core/Column.h b/src/Core/Column.h
index f83028ed0..bc669261a 100644
--- a/src/Core/Column.h
+++ b/src/Core/Column.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
@@ -26,31 +26,31 @@
#ifndef EI_COLUMN_H
#define EI_COLUMN_H
-template<typename MatrixType> class EiColumn
- : public EiObject<typename MatrixType::Scalar, EiColumn<MatrixType> >
+template<typename MatrixType> class Column
+ : public Object<typename MatrixType::Scalar, Column<MatrixType> >
{
public:
typedef typename MatrixType::Scalar Scalar;
typedef typename MatrixType::Ref MatRef;
- friend class EiObject<Scalar, EiColumn<MatrixType> >;
+ friend class Object<Scalar, Column<MatrixType> >;
static const int RowsAtCompileTime = MatrixType::RowsAtCompileTime,
ColsAtCompileTime = 1;
- EiColumn(const MatRef& matrix, int col)
+ Column(const MatRef& matrix, int col)
: m_matrix(matrix), m_col(col)
{
EI_CHECK_COL_RANGE(matrix, col);
}
- EiColumn(const EiColumn& other)
+ Column(const Column& other)
: m_matrix(other.m_matrix), m_col(other.m_col) {}
- EI_INHERIT_ASSIGNMENT_OPERATORS(EiColumn)
+ EI_INHERIT_ASSIGNMENT_OPERATORS(Column)
private:
- EiColumn& _ref() { return *this; }
- const EiColumn& _constRef() const { return *this; }
+ Column& _ref() { return *this; }
+ const Column& _constRef() const { return *this; }
int _rows() const { return m_matrix.rows(); }
int _cols() const { return 1; }
@@ -74,10 +74,10 @@ template<typename MatrixType> class EiColumn
};
template<typename Scalar, typename Derived>
-EiColumn<Derived>
-EiObject<Scalar, Derived>::col(int i)
+Column<Derived>
+Object<Scalar, Derived>::col(int i)
{
- return EiColumn<Derived>(static_cast<Derived*>(this)->ref(), i);
+ return Column<Derived>(static_cast<Derived*>(this)->ref(), i);
}
#endif // EI_COLUMN_H
diff --git a/src/Core/Conjugate.h b/src/Core/Conjugate.h
index 9ca055e92..6431558f4 100644
--- a/src/Core/Conjugate.h
+++ b/src/Core/Conjugate.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
@@ -26,33 +26,33 @@
#ifndef EI_CONJUGATE_H
#define EI_CONJUGATE_H
-template<typename MatrixType> class EiConjugate
- : public EiObject<typename MatrixType::Scalar, EiConjugate<MatrixType> >
+template<typename MatrixType> class Conjugate
+ : public Object<typename MatrixType::Scalar, Conjugate<MatrixType> >
{
public:
typedef typename MatrixType::Scalar Scalar;
typedef typename MatrixType::ConstRef MatRef;
- friend class EiObject<Scalar, EiConjugate<MatrixType> >;
+ friend class Object<Scalar, Conjugate<MatrixType> >;
static const int RowsAtCompileTime = MatrixType::RowsAtCompileTime,
ColsAtCompileTime = MatrixType::ColsAtCompileTime;
- EiConjugate(const MatRef& matrix) : m_matrix(matrix) {}
+ Conjugate(const MatRef& matrix) : m_matrix(matrix) {}
- EiConjugate(const EiConjugate& other)
+ Conjugate(const Conjugate& other)
: m_matrix(other.m_matrix) {}
- EI_INHERIT_ASSIGNMENT_OPERATORS(EiConjugate)
+ EI_INHERIT_ASSIGNMENT_OPERATORS(Conjugate)
private:
- EiConjugate& _ref() { return *this; }
- const EiConjugate& _constRef() const { return *this; }
+ Conjugate& _ref() { return *this; }
+ const Conjugate& _constRef() const { return *this; }
int _rows() const { return m_matrix.rows(); }
int _cols() const { return m_matrix.cols(); }
Scalar _read(int row, int col) const
{
- return EiConj(m_matrix.read(row, col));
+ return Conj(m_matrix.read(row, col));
}
protected:
@@ -60,10 +60,10 @@ template<typename MatrixType> class EiConjugate
};
template<typename Scalar, typename Derived>
-EiConjugate<Derived>
-EiObject<Scalar, Derived>::conjugate() const
+Conjugate<Derived>
+Object<Scalar, Derived>::conjugate() const
{
- return EiConjugate<Derived>(static_cast<const Derived*>(this)->constRef());
+ return Conjugate<Derived>(static_cast<const Derived*>(this)->constRef());
}
#endif // EI_CONJUGATE_H
diff --git a/src/Core/CopyHelper.h b/src/Core/CopyHelper.h
index ccd754c12..4bb6c31c7 100644
--- a/src/Core/CopyHelper.h
+++ b/src/Core/CopyHelper.h
@@ -1,20 +1,20 @@
-// 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) 2007 Michael Olbrich <michael.olbrich@gmx.net>
// 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
@@ -27,7 +27,7 @@
#ifndef EI_COPYHELPER_H
#define EI_COPYHELPER_H
-template<int UnrollCount, int Rows> struct EiCopyHelperUnroller
+template<int UnrollCount, int Rows> struct CopyHelperUnroller
{
static const int col = (UnrollCount-1) / Rows;
static const int row = (UnrollCount-1) % Rows;
@@ -35,12 +35,12 @@ template<int UnrollCount, int Rows> struct EiCopyHelperUnroller
template <typename Derived1, typename Derived2>
static void run(Derived1 &dst, const Derived2 &src)
{
- EiCopyHelperUnroller<UnrollCount-1, Rows>::run(dst, src);
+ CopyHelperUnroller<UnrollCount-1, Rows>::run(dst, src);
dst.write(row, col) = src.read(row, col);
}
};
-template<int Rows> struct EiCopyHelperUnroller<0, Rows>
+template<int Rows> struct CopyHelperUnroller<0, Rows>
{
template <typename Derived1, typename Derived2>
static void run(Derived1 &dst, const Derived2 &src)
@@ -49,7 +49,7 @@ template<int Rows> struct EiCopyHelperUnroller<0, Rows>
}
};
-template<int Rows> struct EiCopyHelperUnroller<EiDynamic, Rows>
+template<int Rows> struct CopyHelperUnroller<Dynamic, Rows>
{
template <typename Derived1, typename Derived2>
static void run(Derived1 &dst, const Derived2 &src)
@@ -61,10 +61,10 @@ template<int Rows> struct EiCopyHelperUnroller<EiDynamic, Rows>
template<typename Scalar, typename Derived>
template<typename OtherDerived>
-void EiObject<Scalar, Derived>::_copy_helper(const EiObject<Scalar, OtherDerived>& other)
+void Object<Scalar, Derived>::_copy_helper(const Object<Scalar, OtherDerived>& other)
{
- if(SizeAtCompileTime != EiDynamic && SizeAtCompileTime <= EI_LOOP_UNROLLING_LIMIT)
- EiCopyHelperUnroller<SizeAtCompileTime, RowsAtCompileTime>::run(*this, other);
+ if(SizeAtCompileTime != Dynamic && SizeAtCompileTime <= EI_LOOP_UNROLLING_LIMIT)
+ CopyHelperUnroller<SizeAtCompileTime, RowsAtCompileTime>::run(*this, other);
else
for(int i = 0; i < rows(); i++)
for(int j = 0; j < cols(); j++)
diff --git a/src/Core/Dot.h b/src/Core/Dot.h
index ea9653f8a..98adf3853 100644
--- a/src/Core/Dot.h
+++ b/src/Core/Dot.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
@@ -27,26 +27,26 @@
#define EI_DOT_H
template<int Index, int Size, typename Derived1, typename Derived2>
-struct EiDotUnroller
+struct DotUnroller
{
static void run(const Derived1 &v1, const Derived2& v2, typename Derived1::Scalar &dot)
{
- EiDotUnroller<Index-1, Size, Derived1, Derived2>::run(v1, v2, dot);
- dot += v1[Index] * EiConj(v2[Index]);
+ DotUnroller<Index-1, Size, Derived1, Derived2>::run(v1, v2, dot);
+ dot += v1[Index] * Conj(v2[Index]);
}
};
template<int Size, typename Derived1, typename Derived2>
-struct EiDotUnroller<0, Size, Derived1, Derived2>
+struct DotUnroller<0, Size, Derived1, Derived2>
{
static void run(const Derived1 &v1, const Derived2& v2, typename Derived1::Scalar &dot)
{
- dot = v1[0] * EiConj(v2[0]);
+ dot = v1[0] * Conj(v2[0]);
}
};
template<int Index, typename Derived1, typename Derived2>
-struct EiDotUnroller<Index, EiDynamic, Derived1, Derived2>
+struct DotUnroller<Index, Dynamic, Derived1, Derived2>
{
static void run(const Derived1 &v1, const Derived2& v2, typename Derived1::Scalar &dot)
{
@@ -58,37 +58,37 @@ struct EiDotUnroller<Index, EiDynamic, Derived1, Derived2>
template<typename Scalar, typename Derived>
template<typename OtherDerived>
-Scalar EiObject<Scalar, Derived>::dot(const OtherDerived& other) const
+Scalar Object<Scalar, Derived>::dot(const OtherDerived& other) const
{
assert(IsVector && OtherDerived::IsVector && size() == other.size());
Scalar res;
- if(SizeAtCompileTime != EiDynamic && SizeAtCompileTime <= 16)
- EiDotUnroller<SizeAtCompileTime-1, SizeAtCompileTime, Derived, OtherDerived>
+ if(SizeAtCompileTime != Dynamic && SizeAtCompileTime <= 16)
+ DotUnroller<SizeAtCompileTime-1, SizeAtCompileTime, Derived, OtherDerived>
::run(*static_cast<const Derived*>(this), other, res);
else
{
- res = (*this)[0] * EiConj(other[0]);
+ res = (*this)[0] * Conj(other[0]);
for(int i = 1; i < size(); i++)
- res += (*this)[i]* EiConj(other[i]);
+ res += (*this)[i]* Conj(other[i]);
}
return res;
}
template<typename Scalar, typename Derived>
-typename EiNumTraits<Scalar>::Real EiObject<Scalar, Derived>::norm2() const
+typename NumTraits<Scalar>::Real Object<Scalar, Derived>::norm2() const
{
assert(IsVector);
- return EiReal(dot(*this));
+ return Real(dot(*this));
}
template<typename Scalar, typename Derived>
-typename EiNumTraits<Scalar>::Real EiObject<Scalar, Derived>::norm() const
+typename NumTraits<Scalar>::Real Object<Scalar, Derived>::norm() const
{
- return EiSqrt(norm2());
+ return Sqrt(norm2());
}
template<typename Scalar, typename Derived>
-EiScalarProduct<Derived> EiObject<Scalar, Derived>::normalized() const
+ScalarProduct<Derived> Object<Scalar, Derived>::normalized() const
{
return (*this) / norm();
}
diff --git a/src/Core/Eval.h b/src/Core/Eval.h
index 4de32ebac..5551d8e21 100644
--- a/src/Core/Eval.h
+++ b/src/Core/Eval.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
@@ -26,26 +26,26 @@
#ifndef EI_EVAL_H
#define EI_EVAL_H
-template<typename Expression> class EiEval
- : public EiMatrix< typename Expression::Scalar,
+template<typename Expression> class Eval
+ : public Matrix< typename Expression::Scalar,
Expression::RowsAtCompileTime,
Expression::ColsAtCompileTime >
{
public:
typedef typename Expression::Scalar Scalar;
- typedef EiMatrix<Scalar, Expression::RowsAtCompileTime, Expression::ColsAtCompileTime> MatrixType;
+ typedef Matrix<Scalar, Expression::RowsAtCompileTime, Expression::ColsAtCompileTime> MatrixType;
typedef Expression Base;
- friend class EiObject<Scalar, Expression>;
+ friend class Object<Scalar, Expression>;
- EI_INHERIT_ASSIGNMENT_OPERATORS(EiEval)
+ EI_INHERIT_ASSIGNMENT_OPERATORS(Eval)
- EiEval(const Expression& expression) : MatrixType(expression) {}
+ Eval(const Expression& expression) : MatrixType(expression) {}
};
template<typename Scalar, typename Derived>
-EiEval<Derived> EiObject<Scalar, Derived>::eval() const
+Eval<Derived> Object<Scalar, Derived>::eval() const
{
- return EiEval<Derived>(*static_cast<const Derived*>(this));
+ return Eval<Derived>(*static_cast<const Derived*>(this));
}
#endif // EI_EVAL_H
diff --git a/src/Core/Fuzzy.h b/src/Core/Fuzzy.h
index 44b20615d..8730a073b 100644
--- a/src/Core/Fuzzy.h
+++ b/src/Core/Fuzzy.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
@@ -28,13 +28,13 @@
template<typename Scalar, typename Derived>
template<typename OtherDerived>
-bool EiObject<Scalar, Derived>::isApprox(const OtherDerived& other) const
+bool Object<Scalar, Derived>::isApprox(const OtherDerived& other) const
{
if(IsVector)
{
return((*this - other).norm2()
<= std::min(norm2(), other.norm2())
- * EiAbs2(EiNumTraits<Scalar>::epsilon()));
+ * Abs2(NumTraits<Scalar>::epsilon()));
}
else
{
@@ -46,11 +46,11 @@ bool EiObject<Scalar, Derived>::isApprox(const OtherDerived& other) const
}
template<typename Scalar, typename Derived>
-bool EiObject<Scalar, Derived>::isNegligble(const Scalar& other) const
+bool Object<Scalar, Derived>::isNegligble(const Scalar& other) const
{
if(IsVector)
{
- return(norm2() <= EiAbs2(other) * EiAbs2(EiNumTraits<Scalar>::epsilon()));
+ return(norm2() <= Abs2(other) * Abs2(NumTraits<Scalar>::epsilon()));
}
else
{
@@ -63,11 +63,11 @@ bool EiObject<Scalar, Derived>::isNegligble(const Scalar& other) const
template<typename Scalar, typename Derived>
template<typename OtherDerived>
-bool EiObject<Scalar, Derived>::isNegligble(const EiObject<Scalar, OtherDerived>& other) const
+bool Object<Scalar, Derived>::isNegligble(const Object<Scalar, OtherDerived>& other) const
{
if(IsVector)
{
- return(norm2() <= other.norm2() * EiAbs2(EiNumTraits<Scalar>::epsilon()));
+ return(norm2() <= other.norm2() * Abs2(NumTraits<Scalar>::epsilon()));
}
else
{
diff --git a/src/Core/Matrix.h b/src/Core/Matrix.h
index b4df04b11..a87de43ac 100644
--- a/src/Core/Matrix.h
+++ b/src/Core/Matrix.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
@@ -33,18 +33,18 @@
#include "MatrixStorage.h"
template<typename _Scalar, int _Rows, int _Cols>
-class EiMatrix : public EiObject<_Scalar, EiMatrix<_Scalar, _Rows, _Cols> >,
- public EiMatrixStorage<_Scalar, _Rows, _Cols>
+class Matrix : public Object<_Scalar, Matrix<_Scalar, _Rows, _Cols> >,
+ public MatrixStorage<_Scalar, _Rows, _Cols>
{
public:
- friend class EiObject<_Scalar, EiMatrix>;
- typedef EiObject<_Scalar, EiMatrix> Base;
- typedef EiMatrixStorage<_Scalar, _Rows, _Cols> Storage;
+ friend class Object<_Scalar, Matrix>;
+ typedef Object<_Scalar, Matrix> Base;
+ typedef MatrixStorage<_Scalar, _Rows, _Cols> Storage;
typedef _Scalar Scalar;
- typedef EiMatrixRef<EiMatrix> Ref;
- typedef EiMatrixConstRef<EiMatrix> ConstRef;
- friend class EiMatrixRef<EiMatrix>;
- friend class EiMatrixConstRef<EiMatrix>;
+ typedef MatrixRef<Matrix> Ref;
+ typedef MatrixConstRef<Matrix> ConstRef;
+ friend class MatrixRef<Matrix>;
+ friend class MatrixConstRef<Matrix>;
static const int RowsAtCompileTime = _Rows, ColsAtCompileTime = _Cols;
@@ -72,46 +72,46 @@ class EiMatrix : public EiObject<_Scalar, EiMatrix<_Scalar, _Rows, _Cols> >,
public:
template<typename OtherDerived>
- EiMatrix& operator=(const EiObject<Scalar, OtherDerived>& other)
+ Matrix& operator=(const Object<Scalar, OtherDerived>& other)
{
resize(other.rows(), other.cols());
return Base::operator=(other);
}
- EiMatrix& operator=(const EiMatrix& other)
+ Matrix& operator=(const Matrix& other)
{
resize(other.rows(), other.cols());
return Base::operator=(other);
}
- EI_INHERIT_ASSIGNMENT_OPERATOR(EiMatrix, +=)
- EI_INHERIT_ASSIGNMENT_OPERATOR(EiMatrix, -=)
- EI_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(EiMatrix, *=)
- EI_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(EiMatrix, /=)
+ EI_INHERIT_ASSIGNMENT_OPERATOR(Matrix, +=)
+ EI_INHERIT_ASSIGNMENT_OPERATOR(Matrix, -=)
+ EI_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(Matrix, *=)
+ EI_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(Matrix, /=)
- explicit EiMatrix(int rows = 1, int cols = 1) : Storage(rows, cols) {}
+ explicit Matrix(int rows = 1, int cols = 1) : Storage(rows, cols) {}
template<typename OtherDerived>
- EiMatrix(const EiObject<Scalar, OtherDerived>& other) : Storage(other.rows(), other.cols())
+ Matrix(const Object<Scalar, OtherDerived>& other) : Storage(other.rows(), other.cols())
{
*this = other;
}
- EiMatrix(const EiMatrix& other) : Storage(other.rows(), other.cols())
+ Matrix(const Matrix& other) : Storage(other.rows(), other.cols())
{
*this = other;
}
- ~EiMatrix() {}
+ ~Matrix() {}
};
#define EI_MAKE_TYPEDEFS(Type, TypeSuffix, Size, SizeSuffix) \
-typedef EiMatrix<Type, Size, Size> EiMatrix##SizeSuffix##TypeSuffix; \
-typedef EiMatrix<Type, Size, 1> EiVector##SizeSuffix##TypeSuffix; \
-typedef EiMatrix<Type, 1, Size> EiRowVector##SizeSuffix##TypeSuffix;
+typedef Matrix<Type, Size, Size> Matrix##SizeSuffix##TypeSuffix; \
+typedef Matrix<Type, Size, 1> Vector##SizeSuffix##TypeSuffix; \
+typedef Matrix<Type, 1, Size> RowVector##SizeSuffix##TypeSuffix;
#define EI_MAKE_TYPEDEFS_ALL_SIZES(Type, TypeSuffix) \
EI_MAKE_TYPEDEFS(Type, TypeSuffix, 2, 2) \
EI_MAKE_TYPEDEFS(Type, TypeSuffix, 3, 3) \
EI_MAKE_TYPEDEFS(Type, TypeSuffix, 4, 4) \
-EI_MAKE_TYPEDEFS(Type, TypeSuffix, EiDynamic, X)
+EI_MAKE_TYPEDEFS(Type, TypeSuffix, Dynamic, X)
EI_MAKE_TYPEDEFS_ALL_SIZES(int, i)
EI_MAKE_TYPEDEFS_ALL_SIZES(float, f)
@@ -123,6 +123,25 @@ EI_MAKE_TYPEDEFS_ALL_SIZES(std::complex<double>, cd)
#undef EI_MAKE_TYPEDEFS_ALL_SIZES
#undef EI_MAKE_TYPEDEFS
+#define EI_USING_MATRIX_TYPEDEFS_FOR_TYPE_AND_SIZE(Type, TypeSuffix, Size, SizeSuffix) \
+using Eigen::Matrix##SizeSuffix##TypeSuffix; \
+using Eigen::Vector##SizeSuffix##TypeSuffix; \
+using Eigen::RowVector##SizeSuffix##TypeSuffix;
+
+#define EI_USING_MATRIX_TYPEDEFS_FOR_TYPE(Type, TypeSuffix) \
+EI_USING_MATRIX_TYPEDEFS_FOR_TYPE_AND_SIZE(Type, TypeSuffix, 2, 2) \
+EI_USING_MATRIX_TYPEDEFS_FOR_TYPE_AND_SIZE(Type, TypeSuffix, 3, 3) \
+EI_USING_MATRIX_TYPEDEFS_FOR_TYPE_AND_SIZE(Type, TypeSuffix, 4, 4) \
+EI_USING_MATRIX_TYPEDEFS_FOR_TYPE_AND_SIZE(Type, TypeSuffix, Dynamic, X)
+
+#define EI_USING_MATRIX_TYPEDEFS \
+EI_USING_MATRIX_TYPEDEFS_FOR_TYPE(int, i) \
+EI_USING_MATRIX_TYPEDEFS_FOR_TYPE(float, f) \
+EI_USING_MATRIX_TYPEDEFS_FOR_TYPE(double, d) \
+EI_USING_MATRIX_TYPEDEFS_FOR_TYPE(std::complex<int>, ci) \
+EI_USING_MATRIX_TYPEDEFS_FOR_TYPE(std::complex<float>, cf) \
+EI_USING_MATRIX_TYPEDEFS_FOR_TYPE(std::complex<double>, cd)
+
#include "Eval.h"
#include "MatrixOps.h"
#include "ScalarOps.h"
diff --git a/src/Core/MatrixOps.h b/src/Core/MatrixOps.h
index 1449a3923..0861a2bff 100644
--- a/src/Core/MatrixOps.h
+++ b/src/Core/MatrixOps.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
@@ -26,33 +26,33 @@
#ifndef EI_MATRIXOPS_H
#define EI_MATRIXOPS_H
-template<typename Lhs, typename Rhs> class EiSum
- : public EiObject<typename Lhs::Scalar, EiSum<Lhs, Rhs> >
+template<typename Lhs, typename Rhs> class Sum
+ : public Object<typename Lhs::Scalar, Sum<Lhs, Rhs> >
{
public:
typedef typename Lhs::Scalar Scalar;
typedef typename Lhs::ConstRef LhsRef;
typedef typename Rhs::ConstRef RhsRef;
- friend class EiObject<Scalar, EiSum>;
+ friend class Object<Scalar, Sum>;
static const int RowsAtCompileTime = Lhs::RowsAtCompileTime,
ColsAtCompileTime = Rhs::ColsAtCompileTime;
- EiSum(const LhsRef& lhs, const RhsRef& rhs)
+ Sum(const LhsRef& lhs, const RhsRef& rhs)
: m_lhs(lhs), m_rhs(rhs)
{
assert(lhs.rows() == rhs.rows() && lhs.cols() == rhs.cols());
}
- EiSum(const EiSum& other)
+ Sum(const Sum& other)
: m_lhs(other.m_lhs), m_rhs(other.m_rhs) {}
- EI_INHERIT_ASSIGNMENT_OPERATORS(EiSum)
+ EI_INHERIT_ASSIGNMENT_OPERATORS(Sum)
private:
- const EiSum& _ref() const { return *this; }
- const EiSum& _constRef() const { return *this; }
+ const Sum& _ref() const { return *this; }
+ const Sum& _constRef() const { return *this; }
int _rows() const { return m_lhs.rows(); }
int _cols() const { return m_lhs.cols(); }
@@ -66,32 +66,32 @@ template<typename Lhs, typename Rhs> class EiSum
const RhsRef m_rhs;
};
-template<typename Lhs, typename Rhs> class EiDifference
- : public EiObject<typename Lhs::Scalar, EiDifference<Lhs, Rhs> >
+template<typename Lhs, typename Rhs> class Difference
+ : public Object<typename Lhs::Scalar, Difference<Lhs, Rhs> >
{
public:
typedef typename Lhs::Scalar Scalar;
typedef typename Lhs::ConstRef LhsRef;
typedef typename Rhs::ConstRef RhsRef;
- friend class EiObject<Scalar, EiDifference>;
+ friend class Object<Scalar, Difference>;
static const int RowsAtCompileTime = Lhs::RowsAtCompileTime,
ColsAtCompileTime = Rhs::ColsAtCompileTime;
- EiDifference(const LhsRef& lhs, const RhsRef& rhs)
+ Difference(const LhsRef& lhs, const RhsRef& rhs)
: m_lhs(lhs), m_rhs(rhs)
{
assert(lhs.rows() == rhs.rows() && lhs.cols() == rhs.cols());
}
- EiDifference(const EiDifference& other)
+ Difference(const Difference& other)
: m_lhs(other.m_lhs), m_rhs(other.m_rhs) {}
- EI_INHERIT_ASSIGNMENT_OPERATORS(EiDifference)
+ EI_INHERIT_ASSIGNMENT_OPERATORS(Difference)
private:
- const EiDifference& _ref() const { return *this; }
- const EiDifference& _constRef() const { return *this; }
+ const Difference& _ref() const { return *this; }
+ const Difference& _constRef() const { return *this; }
int _rows() const { return m_lhs.rows(); }
int _cols() const { return m_lhs.cols(); }
@@ -106,18 +106,18 @@ template<typename Lhs, typename Rhs> class EiDifference
};
template<int Index, int Size, typename Lhs, typename Rhs>
-struct EiMatrixProductUnroller
+struct MatrixProductUnroller
{
static void run(int row, int col, const Lhs& lhs, const Rhs& rhs,
typename Lhs::Scalar &res)
{
- EiMatrixProductUnroller<Index-1, Size, Lhs, Rhs>::run(row, col, lhs, rhs, res);
+ MatrixProductUnroller<Index-1, Size, Lhs, Rhs>::run(row, col, lhs, rhs, res);
res += lhs.read(row, Index) * rhs.read(Index, col);
}
};
template<int Size, typename Lhs, typename Rhs>
-struct EiMatrixProductUnroller<0, Size, Lhs, Rhs>
+struct MatrixProductUnroller<0, Size, Lhs, Rhs>
{
static void run(int row, int col, const Lhs& lhs, const Rhs& rhs,
typename Lhs::Scalar &res)
@@ -127,7 +127,7 @@ struct EiMatrixProductUnroller<0, Size, Lhs, Rhs>
};
template<int Index, typename Lhs, typename Rhs>
-struct EiMatrixProductUnroller<Index, EiDynamic, Lhs, Rhs>
+struct MatrixProductUnroller<Index, Dynamic, Lhs, Rhs>
{
static void run(int row, int col, const Lhs& lhs, const Rhs& rhs,
typename Lhs::Scalar &res)
@@ -140,40 +140,40 @@ struct EiMatrixProductUnroller<Index, EiDynamic, Lhs, Rhs>
}
};
-template<typename Lhs, typename Rhs> class EiMatrixProduct
- : public EiObject<typename Lhs::Scalar, EiMatrixProduct<Lhs, Rhs> >
+template<typename Lhs, typename Rhs> class MatrixProduct
+ : public Object<typename Lhs::Scalar, MatrixProduct<Lhs, Rhs> >
{
public:
typedef typename Lhs::Scalar Scalar;
typedef typename Lhs::ConstRef LhsRef;
typedef typename Rhs::ConstRef RhsRef;
- friend class EiObject<Scalar, EiMatrixProduct>;
+ friend class Object<Scalar, MatrixProduct>;
static const int RowsAtCompileTime = Lhs::RowsAtCompileTime,
ColsAtCompileTime = Rhs::ColsAtCompileTime;
- EiMatrixProduct(const LhsRef& lhs, const RhsRef& rhs)
+ MatrixProduct(const LhsRef& lhs, const RhsRef& rhs)
: m_lhs(lhs), m_rhs(rhs)
{
assert(lhs.cols() == rhs.rows());
}
- EiMatrixProduct(const EiMatrixProduct& other)
+ MatrixProduct(const MatrixProduct& other)
: m_lhs(other.m_lhs), m_rhs(other.m_rhs) {}
- EI_INHERIT_ASSIGNMENT_OPERATORS(EiMatrixProduct)
+ EI_INHERIT_ASSIGNMENT_OPERATORS(MatrixProduct)
private:
- const EiMatrixProduct& _ref() const { return *this; }
- const EiMatrixProduct& _constRef() const { return *this; }
+ const MatrixProduct& _ref() const { return *this; }
+ const MatrixProduct& _constRef() const { return *this; }
int _rows() const { return m_lhs.rows(); }
int _cols() const { return m_rhs.cols(); }
Scalar _read(int row, int col) const
{
Scalar res;
- if(Lhs::ColsAtCompileTime != EiDynamic && Lhs::ColsAtCompileTime <= 16)
- EiMatrixProductUnroller<Lhs::ColsAtCompileTime-1, Lhs::ColsAtCompileTime, LhsRef, RhsRef>
+ if(Lhs::ColsAtCompileTime != Dynamic && Lhs::ColsAtCompileTime <= 16)
+ MatrixProductUnroller<Lhs::ColsAtCompileTime-1, Lhs::ColsAtCompileTime, LhsRef, RhsRef>
::run(row, col, m_lhs, m_rhs, res);
else
{
@@ -190,30 +190,30 @@ template<typename Lhs, typename Rhs> class EiMatrixProduct
};
template<typename Scalar, typename Derived1, typename Derived2>
-EiSum<Derived1, Derived2>
-operator+(const EiObject<Scalar, Derived1> &mat1, const EiObject<Scalar, Derived2> &mat2)
+Sum<Derived1, Derived2>
+operator+(const Object<Scalar, Derived1> &mat1, const Object<Scalar, Derived2> &mat2)
{
- return EiSum<Derived1, Derived2>(mat1.constRef(), mat2.constRef());
+ return Sum<Derived1, Derived2>(mat1.constRef(), mat2.constRef());
}
template<typename Scalar, typename Derived1, typename Derived2>
-EiDifference<Derived1, Derived2>
-operator-(const EiObject<Scalar, Derived1> &mat1, const EiObject<Scalar, Derived2> &mat2)
+Difference<Derived1, Derived2>
+operator-(const Object<Scalar, Derived1> &mat1, const Object<Scalar, Derived2> &mat2)
{
- return EiDifference<Derived1, Derived2>(mat1.constRef(), mat2.constRef());
+ return Difference<Derived1, Derived2>(mat1.constRef(), mat2.constRef());
}
template<typename Scalar, typename Derived>
template<typename OtherDerived>
-EiMatrixProduct<Derived, OtherDerived>
-EiObject<Scalar, Derived>::lazyMul(const EiObject<Scalar, OtherDerived> &other) const
+MatrixProduct<Derived, OtherDerived>
+Object<Scalar, Derived>::lazyMul(const Object<Scalar, OtherDerived> &other) const
{
- return EiMatrixProduct<Derived, OtherDerived>(constRef(), other.constRef());
+ return MatrixProduct<Derived, OtherDerived>(constRef(), other.constRef());
}
template<typename Scalar, typename Derived1, typename Derived2>
-EiEval<EiMatrixProduct<Derived1, Derived2> >
-operator*(const EiObject<Scalar, Derived1> &mat1, const EiObject<Scalar, Derived2> &mat2)
+Eval<MatrixProduct<Derived1, Derived2> >
+operator*(const Object<Scalar, Derived1> &mat1, const Object<Scalar, Derived2> &mat2)
{
return mat1.lazyMul(mat2).eval();
}
@@ -221,7 +221,7 @@ operator*(const EiObject<Scalar, Derived1> &mat1, const EiObject<Scalar, Derived
template<typename Scalar, typename Derived>
template<typename OtherDerived>
Derived &
-EiObject<Scalar, Derived>::operator+=(const EiObject<Scalar, OtherDerived>& other)
+Object<Scalar, Derived>::operator+=(const Object<Scalar, OtherDerived>& other)
{
return *this = *this + other;
}
@@ -229,7 +229,7 @@ EiObject<Scalar, Derived>::operator+=(const EiObject<Scalar, OtherDerived>& othe
template<typename Scalar, typename Derived>
template<typename OtherDerived>
Derived &
-EiObject<Scalar, Derived>::operator-=(const EiObject<Scalar, OtherDerived> &other)
+Object<Scalar, Derived>::operator-=(const Object<Scalar, OtherDerived> &other)
{
return *this = *this - other;
}
@@ -237,7 +237,7 @@ EiObject<Scalar, Derived>::operator-=(const EiObject<Scalar, OtherDerived> &othe
template<typename Scalar, typename Derived>
template<typename OtherDerived>
Derived &
-EiObject<Scalar, Derived>::operator*=(const EiObject<Scalar, OtherDerived> &other)
+Object<Scalar, Derived>::operator*=(const Object<Scalar, OtherDerived> &other)
{
return *this = *this * other;
}
diff --git a/src/Core/MatrixRef.h b/src/Core/MatrixRef.h
index 7bf3ebe44..d3fdae581 100644
--- a/src/Core/MatrixRef.h
+++ b/src/Core/MatrixRef.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
@@ -26,18 +26,18 @@
#ifndef EI_MATRIXREF_H
#define EI_MATRIXREF_H
-template<typename MatrixType> class EiMatrixConstRef
- : public EiObject<typename MatrixType::Scalar, EiMatrixConstRef<MatrixType> >
+template<typename MatrixType> class MatrixConstRef
+ : public Object<typename MatrixType::Scalar, MatrixConstRef<MatrixType> >
{
public:
typedef typename MatrixType::Scalar Scalar;
- friend class EiObject<Scalar, EiMatrixConstRef>;
+ friend class Object<Scalar, MatrixConstRef>;
- EiMatrixConstRef(const MatrixType& matrix) : m_matrix(matrix) {}
- EiMatrixConstRef(const EiMatrixConstRef& other) : m_matrix(other.m_matrix) {}
- ~EiMatrixConstRef() {}
+ MatrixConstRef(const MatrixType& matrix) : m_matrix(matrix) {}
+ MatrixConstRef(const MatrixConstRef& other) : m_matrix(other.m_matrix) {}
+ ~MatrixConstRef() {}
- EI_INHERIT_ASSIGNMENT_OPERATORS(EiMatrixConstRef)
+ EI_INHERIT_ASSIGNMENT_OPERATORS(MatrixConstRef)
private:
int _rows() const { return m_matrix.rows(); }
@@ -51,18 +51,18 @@ template<typename MatrixType> class EiMatrixConstRef
const MatrixType& m_matrix;
};
-template<typename MatrixType> class EiMatrixRef
- : public EiObject<typename MatrixType::Scalar, EiMatrixRef<MatrixType> >
+template<typename MatrixType> class MatrixRef
+ : public Object<typename MatrixType::Scalar, MatrixRef<MatrixType> >
{
public:
typedef typename MatrixType::Scalar Scalar;
- friend class EiObject<Scalar, EiMatrixRef>;
+ friend class Object<Scalar, MatrixRef>;
- EiMatrixRef(MatrixType& matrix) : m_matrix(matrix) {}
- EiMatrixRef(const EiMatrixRef& other) : m_matrix(other.m_matrix) {}
- ~EiMatrixRef() {}
+ MatrixRef(MatrixType& matrix) : m_matrix(matrix) {}
+ MatrixRef(const MatrixRef& other) : m_matrix(other.m_matrix) {}
+ ~MatrixRef() {}
- EI_INHERIT_ASSIGNMENT_OPERATORS(EiMatrixRef)
+ EI_INHERIT_ASSIGNMENT_OPERATORS(MatrixRef)
private:
int _rows() const { return m_matrix.rows(); }
diff --git a/src/Core/MatrixStorage.h b/src/Core/MatrixStorage.h
index b3b3f9e06..1fbc96ebc 100644
--- a/src/Core/MatrixStorage.h
+++ b/src/Core/MatrixStorage.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,7 +29,7 @@
template<typename Scalar,
int RowsAtCompileTime,
int ColsAtCompileTime>
-class EiMatrixStorage
+class MatrixStorage
{
protected:
Scalar m_array[RowsAtCompileTime * ColsAtCompileTime];
@@ -44,18 +44,18 @@ class EiMatrixStorage
{ return ColsAtCompileTime; }
public:
- EiMatrixStorage(int rows, int cols)
+ MatrixStorage(int rows, int cols)
{
EI_UNUSED(rows);
EI_UNUSED(cols);
assert(RowsAtCompileTime > 0 && ColsAtCompileTime > 0);
}
- ~EiMatrixStorage() {};
+ ~MatrixStorage() {};
};
template<typename Scalar, int ColsAtCompileTime>
-class EiMatrixStorage<Scalar, EiDynamic, ColsAtCompileTime>
+class MatrixStorage<Scalar, Dynamic, ColsAtCompileTime>
{
protected:
int m_rows;
@@ -79,18 +79,18 @@ class EiMatrixStorage<Scalar, EiDynamic, ColsAtCompileTime>
{ return ColsAtCompileTime; }
public:
- EiMatrixStorage(int rows, int cols) : m_rows(rows)
+ MatrixStorage(int rows, int cols) : m_rows(rows)
{
assert(m_rows > 0 && cols == ColsAtCompileTime);
m_array = new Scalar[m_rows * ColsAtCompileTime];
}
- ~EiMatrixStorage()
+ ~MatrixStorage()
{ delete[] m_array; }
};
template<typename Scalar, int RowsAtCompileTime>
-class EiMatrixStorage<Scalar, RowsAtCompileTime, EiDynamic>
+class MatrixStorage<Scalar, RowsAtCompileTime, Dynamic>
{
protected:
int m_cols;
@@ -114,18 +114,18 @@ class EiMatrixStorage<Scalar, RowsAtCompileTime, EiDynamic>
{ return m_cols; }
public:
- EiMatrixStorage(int rows, int cols) : m_cols(cols)
+ MatrixStorage(int rows, int cols) : m_cols(cols)
{
assert(rows == RowsAtCompileTime && cols > 0);
m_array = new Scalar[m_cols * RowsAtCompileTime];
}
- ~EiMatrixStorage()
+ ~MatrixStorage()
{ delete[] m_array; }
};
template<typename Scalar>
-class EiMatrixStorage<Scalar, EiDynamic, EiDynamic>
+class MatrixStorage<Scalar, Dynamic, Dynamic>
{
protected:
int m_rows, m_cols;
@@ -150,13 +150,13 @@ class EiMatrixStorage<Scalar, EiDynamic, EiDynamic>
{ return m_cols; }
public:
- EiMatrixStorage(int rows, int cols) : m_rows(rows), m_cols(cols)
+ MatrixStorage(int rows, int cols) : m_rows(rows), m_cols(cols)
{
assert(m_rows > 0 && m_cols > 0);
m_array = new Scalar[m_rows * m_cols];
}
- ~EiMatrixStorage()
+ ~MatrixStorage()
{ delete[] m_array; }
};
diff --git a/src/Core/Minor.h b/src/Core/Minor.h
index 217ee9059..11ca541bc 100644
--- a/src/Core/Minor.h
+++ b/src/Core/Minor.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
@@ -26,35 +26,35 @@
#ifndef EI_MINOR_H
#define EI_MINOR_H
-template<typename MatrixType> class EiMinor
- : public EiObject<typename MatrixType::Scalar, EiMinor<MatrixType> >
+template<typename MatrixType> class Minor
+ : public Object<typename MatrixType::Scalar, Minor<MatrixType> >
{
public:
typedef typename MatrixType::Scalar Scalar;
typedef typename MatrixType::Ref MatRef;
- friend class EiObject<Scalar, EiMinor<MatrixType> >;
+ friend class Object<Scalar, Minor<MatrixType> >;
static const int
- RowsAtCompileTime = (MatrixType::RowsAtCompileTime != EiDynamic) ?
- MatrixType::RowsAtCompileTime - 1 : EiDynamic,
- ColsAtCompileTime = (MatrixType::ColsAtCompileTime != EiDynamic) ?
- MatrixType::ColsAtCompileTime - 1 : EiDynamic;
+ RowsAtCompileTime = (MatrixType::RowsAtCompileTime != Dynamic) ?
+ MatrixType::RowsAtCompileTime - 1 : Dynamic,
+ ColsAtCompileTime = (MatrixType::ColsAtCompileTime != Dynamic) ?
+ MatrixType::ColsAtCompileTime - 1 : Dynamic;
- EiMinor(const MatRef& matrix,
+ Minor(const MatRef& matrix,
int row, int col = 0)
: m_matrix(matrix), m_row(row), m_col(col)
{
EI_CHECK_RANGES(matrix, row, col);
}
- EiMinor(const EiMinor& other)
+ Minor(const Minor& other)
: m_matrix(other.m_matrix), m_row(other.m_row), m_col(other.m_col) {}
- EI_INHERIT_ASSIGNMENT_OPERATORS(EiMinor)
+ EI_INHERIT_ASSIGNMENT_OPERATORS(Minor)
private:
- EiMinor& _ref() { return *this; }
- const EiMinor& _constRef() const { return *this; }
+ Minor& _ref() { return *this; }
+ const Minor& _constRef() const { return *this; }
int _rows() const { return m_matrix.rows() - 1; }
int _cols() const { return m_matrix.cols() - 1; }
@@ -74,10 +74,10 @@ template<typename MatrixType> class EiMinor
};
template<typename Scalar, typename Derived>
-EiMinor<Derived>
-EiObject<Scalar, Derived>::minor(int row, int col)
+Minor<Derived>
+Object<Scalar, Derived>::minor(int row, int col)
{
- return EiMinor<Derived>(static_cast<Derived*>(this)->ref(), row, col);
+ return Minor<Derived>(static_cast<Derived*>(this)->ref(), row, col);
}
#endif // EI_MINOR_H
diff --git a/src/Core/Numeric.h b/src/Core/Numeric.h
index 23a6c03e6..264c7a549 100644
--- a/src/Core/Numeric.h
+++ b/src/Core/Numeric.h
@@ -1,20 +1,20 @@
-// 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
@@ -27,9 +27,9 @@
#ifndef EI_NUMERIC_H
#define EI_NUMERIC_H
-template<typename T> struct EiNumTraits;
+template<typename T> struct NumTraits;
-template<> struct EiNumTraits<int>
+template<> struct NumTraits<int>
{
typedef int Real;
typedef double FloatingPoint;
@@ -54,7 +54,7 @@ template<> struct EiNumTraits<int>
}
};
-template<> struct EiNumTraits<float>
+template<> struct NumTraits<float>
{
typedef float Real;
typedef float FloatingPoint;
@@ -76,7 +76,7 @@ template<> struct EiNumTraits<float>
}
};
-template<> struct EiNumTraits<double>
+template<> struct NumTraits<double>
{
typedef double Real;
typedef double FloatingPoint;
@@ -98,17 +98,17 @@ template<> struct EiNumTraits<double>
}
};
-template<typename _Real> struct EiNumTraits<std::complex<_Real> >
+template<typename _Real> struct NumTraits<std::complex<_Real> >
{
typedef _Real Real;
typedef std::complex<Real> Complex;
typedef std::complex<double> FloatingPoint;
- typedef typename EiNumTraits<Real>::FloatingPoint RealFloatingPoint;
+ typedef typename NumTraits<Real>::FloatingPoint RealFloatingPoint;
static const bool IsComplex = true;
- static const bool HasFloatingPoint = EiNumTraits<Real>::HasFloatingPoint;
+ static const bool HasFloatingPoint = NumTraits<Real>::HasFloatingPoint;
- static Real epsilon() { return EiNumTraits<Real>::epsilon(); }
+ static Real epsilon() { return NumTraits<Real>::epsilon(); }
static Real real(const Complex& x) { return std::real(x); }
static Real imag(const Complex& x) { return std::imag(x); }
static Complex conj(const Complex& x) { return std::conj(x); }
@@ -120,48 +120,48 @@ template<typename _Real> struct EiNumTraits<std::complex<_Real> >
{ return std::real(x) * std::real(x) + std::imag(x) * std::imag(x); }
static Complex rand()
{
- return Complex(EiNumTraits<Real>::rand(), EiNumTraits<Real>::rand());
+ return Complex(NumTraits<Real>::rand(), NumTraits<Real>::rand());
}
};
-template<typename T> typename EiNumTraits<T>::Real EiReal(const T& x)
-{ return EiNumTraits<T>::real(x); }
+template<typename T> typename NumTraits<T>::Real Real(const T& x)
+{ return NumTraits<T>::real(x); }
-template<typename T> typename EiNumTraits<T>::Real EiImag(const T& x)
-{ return EiNumTraits<T>::imag(x); }
+template<typename T> typename NumTraits<T>::Real Imag(const T& x)
+{ return NumTraits<T>::imag(x); }
-template<typename T> T EiConj(const T& x)
-{ return EiNumTraits<T>::conj(x); }
+template<typename T> T Conj(const T& x)
+{ return NumTraits<T>::conj(x); }
-template<typename T> typename EiNumTraits<T>::FloatingPoint EiSqrt(const T& x)
-{ return EiNumTraits<T>::sqrt(x); }
+template<typename T> typename NumTraits<T>::FloatingPoint Sqrt(const T& x)
+{ return NumTraits<T>::sqrt(x); }
-template<typename T> typename EiNumTraits<T>::RealFloatingPoint EiAbs(const T& x)
-{ return EiNumTraits<T>::abs(x); }
+template<typename T> typename NumTraits<T>::RealFloatingPoint Abs(const T& x)
+{ return NumTraits<T>::abs(x); }
-template<typename T> typename EiNumTraits<T>::Real EiAbs2(const T& x)
-{ return EiNumTraits<T>::abs2(x); }
+template<typename T> typename NumTraits<T>::Real Abs2(const T& x)
+{ return NumTraits<T>::abs2(x); }
-template<typename T> T EiRand()
-{ return EiNumTraits<T>::rand(); }
+template<typename T> T Rand()
+{ return NumTraits<T>::rand(); }
-template<typename T> bool EiNegligible(const T& a, const T& b)
+template<typename T> bool Negligible(const T& a, const T& b)
{
- return(EiAbs(a) <= EiAbs(b) * EiNumTraits<T>::epsilon());
+ return(Abs(a) <= Abs(b) * NumTraits<T>::epsilon());
}
-template<typename T> bool EiApprox(const T& a, const T& b)
+template<typename T> bool Approx(const T& a, const T& b)
{
- if(EiNumTraits<T>::IsFloat)
- return(EiAbs(a - b) <= std::min(EiAbs(a), EiAbs(b)) * EiNumTraits<T>::epsilon());
+ if(NumTraits<T>::IsFloat)
+ return(Abs(a - b) <= std::min(Abs(a), Abs(b)) * NumTraits<T>::epsilon());
else
return(a == b);
}
-template<typename T> bool EiLessThanOrApprox(const T& a, const T& b)
+template<typename T> bool LessThanOrApprox(const T& a, const T& b)
{
- if(EiNumTraits<T>::IsFloat)
- return(a < b || EiApprox(a, b));
+ if(NumTraits<T>::IsFloat)
+ return(a < b || Approx(a, b));
else
return(a <= b);
}
diff --git a/src/Core/Object.h b/src/Core/Object.h
index d1a310a20..f8d1cb174 100644
--- a/src/Core/Object.h
+++ b/src/Core/Object.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
@@ -26,23 +26,23 @@
#ifndef EI_OBJECT_H
#define EI_OBJECT_H
-template<typename Scalar, typename Derived> class EiObject
+template<typename Scalar, typename Derived> class Object
{
static const int RowsAtCompileTime = Derived::RowsAtCompileTime,
ColsAtCompileTime = Derived::ColsAtCompileTime;
template<typename OtherDerived>
- void _copy_helper(const EiObject<Scalar, OtherDerived>& other);
+ void _copy_helper(const Object<Scalar, OtherDerived>& other);
public:
static const int SizeAtCompileTime
- = RowsAtCompileTime == EiDynamic || ColsAtCompileTime == EiDynamic
- ? EiDynamic : RowsAtCompileTime * ColsAtCompileTime;
+ = RowsAtCompileTime == Dynamic || ColsAtCompileTime == Dynamic
+ ? Dynamic : RowsAtCompileTime * ColsAtCompileTime;
static const bool IsVector = RowsAtCompileTime == 1 || ColsAtCompileTime == 1;
- typedef typename EiForwardDecl<Derived>::Ref Ref;
- typedef typename EiForwardDecl<Derived>::ConstRef ConstRef;
- typedef typename EiNumTraits<Scalar>::Real RealScalar;
+ typedef typename ForwardDecl<Derived>::Ref Ref;
+ typedef typename ForwardDecl<Derived>::ConstRef ConstRef;
+ typedef typename NumTraits<Scalar>::Real RealScalar;
int rows() const { return static_cast<const Derived *>(this)->_rows(); }
int cols() const { return static_cast<const Derived *>(this)->_cols(); }
@@ -65,7 +65,7 @@ template<typename Scalar, typename Derived> class EiObject
}
template<typename OtherDerived>
- Derived& operator=(const EiObject<Scalar, OtherDerived>& other)
+ Derived& operator=(const Object<Scalar, OtherDerived>& other)
{
assert(rows() == other.rows() && cols() == other.cols());
_copy_helper(other);
@@ -74,20 +74,20 @@ template<typename Scalar, typename Derived> class EiObject
//special case of the above template operator=. Strangely, g++ 4.1 failed to use
//that template when OtherDerived == Derived
- Derived& operator=(const EiObject& other)
+ Derived& operator=(const Object& other)
{
assert(rows() == other.rows() && cols() == other.cols());
_copy_helper(other);
return *static_cast<Derived*>(this);
}
- EiRow<Derived> row(int i);
- EiColumn<Derived> col(int i);
- EiMinor<Derived> minor(int row, int col);
- EiBlock<Derived> block(int startRow, int endRow, int startCol, int endCol);
- EiTranspose<Derived> transpose();
- EiConjugate<Derived> conjugate() const;
- EiTranspose<EiConjugate<Derived> > adjoint() const { return conjugate().transpose(); }
+ Row<Derived> row(int i);
+ Column<Derived> col(int i);
+ Minor<Derived> minor(int row, int col);
+ Block<Derived> block(int startRow, int endRow, int startCol, int endCol);
+ Transpose<Derived> transpose();
+ Conjugate<Derived> conjugate() const;
+ Transpose<Conjugate<Derived> > adjoint() const { return conjugate().transpose(); }
Scalar trace() const;
template<typename OtherDerived>
@@ -95,9 +95,9 @@ template<typename Scalar, typename Derived> class EiObject
RealScalar norm2() const;
RealScalar norm() const;
- EiScalarProduct<Derived> normalized() const;
+ ScalarProduct<Derived> normalized() const;
- static EiEval<EiRandom<Derived> >
+ static Eval<Random<Derived> >
random(int rows = RowsAtCompileTime, int cols = ColsAtCompileTime);
template<typename OtherDerived>
@@ -106,15 +106,15 @@ template<typename Scalar, typename Derived> class EiObject
bool isNegligible(const OtherDerived& other) const;
template<typename OtherDerived>
- EiMatrixProduct<Derived, OtherDerived>
- lazyMul(const EiObject<Scalar, OtherDerived>& other) const EI_ALWAYS_INLINE;
+ MatrixProduct<Derived, OtherDerived>
+ lazyMul(const Object<Scalar, OtherDerived>& other) const EI_ALWAYS_INLINE;
template<typename OtherDerived>
- Derived& operator+=(const EiObject<Scalar, OtherDerived>& other);
+ Derived& operator+=(const Object<Scalar, OtherDerived>& other);
template<typename OtherDerived>
- Derived& operator-=(const EiObject<Scalar, OtherDerived>& other);
+ Derived& operator-=(const Object<Scalar, OtherDerived>& other);
template<typename OtherDerived>
- Derived& operator*=(const EiObject<Scalar, OtherDerived>& other);
+ Derived& operator*=(const Object<Scalar, OtherDerived>& other);
Derived& operator*=(const int& other);
Derived& operator*=(const float& other);
@@ -150,13 +150,13 @@ template<typename Scalar, typename Derived> class EiObject
else return write(index, 0);
}
- EiEval<Derived> eval() const EI_ALWAYS_INLINE;
+ Eval<Derived> eval() const EI_ALWAYS_INLINE;
};
template<typename Scalar, typename Derived>
std::ostream & operator <<
( std::ostream & s,
- const EiObject<Scalar, Derived> & m )
+ const Object<Scalar, Derived> & m )
{
for( int i = 0; i < m.rows(); i++ )
{
diff --git a/src/Core/Random.h b/src/Core/Random.h
index 70485028f..ff3f8b418 100644
--- a/src/Core/Random.h
+++ b/src/Core/Random.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
@@ -26,24 +26,24 @@
#ifndef EI_RANDOM_H
#define EI_RANDOM_H
-template<typename MatrixType> class EiRandom
- : public EiObject<typename MatrixType::Scalar, EiRandom<MatrixType> >
+template<typename MatrixType> class Random
+ : public Object<typename MatrixType::Scalar, Random<MatrixType> >
{
public:
typedef typename MatrixType::Scalar Scalar;
- friend class EiObject<Scalar, EiRandom<MatrixType> >;
+ friend class Object<Scalar, Random<MatrixType> >;
static const int RowsAtCompileTime = MatrixType::RowsAtCompileTime,
ColsAtCompileTime = MatrixType::ColsAtCompileTime;
- EiRandom(int rows, int cols) : m_rows(rows), m_cols(cols)
+ Random(int rows, int cols) : m_rows(rows), m_cols(cols)
{
assert(rows > 0 && cols > 0);
}
private:
- EiRandom& _ref() { return *this; }
- const EiRandom& _constRef() const { return *this; }
+ Random& _ref() { return *this; }
+ const Random& _constRef() const { return *this; }
int _rows() const { return m_rows; }
int _cols() const { return m_cols; }
@@ -51,7 +51,7 @@ template<typename MatrixType> class EiRandom
{
EI_UNUSED(row);
EI_UNUSED(col);
- return EiRand<Scalar>();
+ return Rand<Scalar>();
}
protected:
@@ -59,9 +59,9 @@ template<typename MatrixType> class EiRandom
};
template<typename Scalar, typename Derived>
-EiEval<EiRandom<Derived> > EiObject<Scalar, Derived>::random(int rows, int cols)
+Eval<Random<Derived> > Object<Scalar, Derived>::random(int rows, int cols)
{
- return EiRandom<Derived>(rows, cols).eval();
+ return Random<Derived>(rows, cols).eval();
}
#endif // EI_RANDOM_H
diff --git a/src/Core/Row.h b/src/Core/Row.h
index 39efc0b2b..1fe1cf7ca 100644
--- a/src/Core/Row.h
+++ b/src/Core/Row.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
@@ -26,37 +26,37 @@
#ifndef EI_ROW_H
#define EI_ROW_H
-template<typename MatrixType> class EiRow
- : public EiObject<typename MatrixType::Scalar, EiRow<MatrixType> >
+template<typename MatrixType> class Row
+ : public Object<typename MatrixType::Scalar, Row<MatrixType> >
{
public:
typedef typename MatrixType::Scalar Scalar;
typedef typename MatrixType::Ref MatRef;
- friend class EiObject<Scalar, EiRow<MatrixType> >;
+ friend class Object<Scalar, Row<MatrixType> >;
static const int RowsAtCompileTime = 1,
ColsAtCompileTime = MatrixType::ColsAtCompileTime;
- EiRow(const MatRef& matrix, int row)
+ Row(const MatRef& matrix, int row)
: m_matrix(matrix), m_row(row)
{
EI_CHECK_ROW_RANGE(matrix, row);
}
- EiRow(const EiRow& other)
+ Row(const Row& other)
: m_matrix(other.m_matrix), m_row(other.m_row) {}
template<typename OtherDerived>
- EiRow& operator=(const EiObject<Scalar, OtherDerived>& other)
+ Row& operator=(const Object<Scalar, OtherDerived>& other)
{
- return EiObject<Scalar, EiRow<MatrixType> >::operator=(other);
+ return Object<Scalar, Row<MatrixType> >::operator=(other);
}
- EI_INHERIT_ASSIGNMENT_OPERATORS(EiRow)
+ EI_INHERIT_ASSIGNMENT_OPERATORS(Row)
private:
- EiRow& _ref() { return *this; }
- const EiRow& _constRef() const { return *this; }
+ Row& _ref() { return *this; }
+ const Row& _constRef() const { return *this; }
int _rows() const { return 1; }
int _cols() const { return m_matrix.cols(); }
@@ -79,10 +79,10 @@ template<typename MatrixType> class EiRow
};
template<typename Scalar, typename Derived>
-EiRow<Derived>
-EiObject<Scalar, Derived>::row(int i)
+Row<Derived>
+Object<Scalar, Derived>::row(int i)
{
- return EiRow<Derived>(static_cast<Derived*>(this)->ref(), i);
+ return Row<Derived>(static_cast<Derived*>(this)->ref(), i);
}
#endif // EI_ROW_H
diff --git a/src/Core/ScalarOps.h b/src/Core/ScalarOps.h
index c058978e6..dc0709687 100644
--- a/src/Core/ScalarOps.h
+++ b/src/Core/ScalarOps.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
@@ -26,28 +26,28 @@
#ifndef EI_SCALAROPS_H
#define EI_SCALAROPS_H
-template<typename MatrixType> class EiScalarProduct
- : public EiObject<typename MatrixType::Scalar, EiScalarProduct<MatrixType> >
+template<typename MatrixType> class ScalarProduct
+ : public Object<typename MatrixType::Scalar, ScalarProduct<MatrixType> >
{
public:
typedef typename MatrixType::Scalar Scalar;
typedef typename MatrixType::ConstRef MatRef;
- friend class EiObject<typename MatrixType::Scalar, EiScalarProduct<MatrixType> >;
+ friend class Object<typename MatrixType::Scalar, ScalarProduct<MatrixType> >;
static const int RowsAtCompileTime = MatrixType::RowsAtCompileTime,
ColsAtCompileTime = MatrixType::ColsAtCompileTime;
- EiScalarProduct(const MatRef& matrix, Scalar scalar)
+ ScalarProduct(const MatRef& matrix, Scalar scalar)
: m_matrix(matrix), m_scalar(scalar) {}
- EiScalarProduct(const EiScalarProduct& other)
+ ScalarProduct(const ScalarProduct& other)
: m_matrix(other.m_matrix), m_scalar(other.m_scalar) {}
- EI_INHERIT_ASSIGNMENT_OPERATORS(EiScalarProduct)
+ EI_INHERIT_ASSIGNMENT_OPERATORS(ScalarProduct)
private:
- const EiScalarProduct& _ref() const { return *this; }
- const EiScalarProduct& _constRef() const { return *this; }
+ const ScalarProduct& _ref() const { return *this; }
+ const ScalarProduct& _constRef() const { return *this; }
int _rows() const { return m_matrix.rows(); }
int _cols() const { return m_matrix.cols(); }
@@ -63,40 +63,40 @@ template<typename MatrixType> class EiScalarProduct
#define EI_MAKE_SCALAR_OPS(OtherScalar) \
template<typename Scalar, typename Derived> \
-EiScalarProduct<Derived> \
-operator*(const EiObject<Scalar, Derived>& matrix, \
+ScalarProduct<Derived> \
+operator*(const Object<Scalar, Derived>& matrix, \
OtherScalar scalar) \
{ \
- return EiScalarProduct<Derived>(matrix.constRef(), scalar); \
+ return ScalarProduct<Derived>(matrix.constRef(), scalar); \
} \
\
template<typename Scalar, typename Derived> \
-EiScalarProduct<Derived> \
+ScalarProduct<Derived> \
operator*(OtherScalar scalar, \
- const EiObject<Scalar, Derived>& matrix) \
+ const Object<Scalar, Derived>& matrix) \
{ \
- return EiScalarProduct<Derived>(matrix.constRef(), scalar); \
+ return ScalarProduct<Derived>(matrix.constRef(), scalar); \
} \
\
template<typename Scalar, typename Derived> \
-EiScalarProduct<Derived> \
-operator/(const EiObject<Scalar, Derived>& matrix, \
+ScalarProduct<Derived> \
+operator/(const Object<Scalar, Derived>& matrix, \
OtherScalar scalar) \
{ \
- assert(EiNumTraits<Scalar>::HasFloatingPoint); \
+ assert(NumTraits<Scalar>::HasFloatingPoint); \
return matrix * (static_cast<Scalar>(1) / scalar); \
} \
\
template<typename Scalar, typename Derived> \
Derived & \
-EiObject<Scalar, Derived>::operator*=(const OtherScalar &other) \
+Object<Scalar, Derived>::operator*=(const OtherScalar &other) \
{ \
return *this = *this * other; \
} \
\
template<typename Scalar, typename Derived> \
Derived & \
-EiObject<Scalar, Derived>::operator/=(const OtherScalar &other) \
+Object<Scalar, Derived>::operator/=(const OtherScalar &other) \
{ \
return *this = *this / other; \
}
diff --git a/src/Core/Trace.h b/src/Core/Trace.h
index 80c5dbed1..41394cffa 100644
--- a/src/Core/Trace.h
+++ b/src/Core/Trace.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
@@ -26,16 +26,16 @@
#ifndef EI_TRACE_H
#define EI_TRACE_H
-template<int Index, int Rows, typename Derived> struct EiTraceUnroller
+template<int Index, int Rows, typename Derived> struct TraceUnroller
{
static void run(const Derived &mat, typename Derived::Scalar &trace)
{
- EiTraceUnroller<Index-1, Rows, Derived>::run(mat, trace);
+ TraceUnroller<Index-1, Rows, Derived>::run(mat, trace);
trace += mat(Index, Index);
}
};
-template<int Rows, typename Derived> struct EiTraceUnroller<0, Rows, Derived>
+template<int Rows, typename Derived> struct TraceUnroller<0, Rows, Derived>
{
static void run(const Derived &mat, typename Derived::Scalar &trace)
{
@@ -43,7 +43,7 @@ template<int Rows, typename Derived> struct EiTraceUnroller<0, Rows, Derived>
}
};
-template<int Index, typename Derived> struct EiTraceUnroller<Index, EiDynamic, Derived>
+template<int Index, typename Derived> struct TraceUnroller<Index, Dynamic, Derived>
{
static void run(const Derived &mat, typename Derived::Scalar &trace)
{
@@ -53,12 +53,12 @@ template<int Index, typename Derived> struct EiTraceUnroller<Index, EiDynamic, D
};
template<typename Scalar, typename Derived>
-Scalar EiObject<Scalar, Derived>::trace() const
+Scalar Object<Scalar, Derived>::trace() const
{
assert(rows() == cols());
Scalar res;
- if(RowsAtCompileTime != EiDynamic && RowsAtCompileTime <= 16)
- EiTraceUnroller<RowsAtCompileTime-1, RowsAtCompileTime, Derived>
+ if(RowsAtCompileTime != Dynamic && RowsAtCompileTime <= 16)
+ TraceUnroller<RowsAtCompileTime-1, RowsAtCompileTime, Derived>
::run(*static_cast<const Derived*>(this), res);
else
{
diff --git a/src/Core/Transpose.h b/src/Core/Transpose.h
index 90a9b727c..81f1090dd 100644
--- a/src/Core/Transpose.h
+++ b/src/Core/Transpose.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
@@ -26,27 +26,27 @@
#ifndef EI_TRANSPOSE_H
#define EI_TRANSPOSE_H
-template<typename MatrixType> class EiTranspose
- : public EiObject<typename MatrixType::Scalar, EiTranspose<MatrixType> >
+template<typename MatrixType> class Transpose
+ : public Object<typename MatrixType::Scalar, Transpose<MatrixType> >
{
public:
typedef typename MatrixType::Scalar Scalar;
typedef typename MatrixType::Ref MatRef;
- friend class EiObject<Scalar, EiTranspose<MatrixType> >;
+ friend class Object<Scalar, Transpose<MatrixType> >;
static const int RowsAtCompileTime = MatrixType::ColsAtCompileTime,
ColsAtCompileTime = MatrixType::RowsAtCompileTime;
- EiTranspose(const MatRef& matrix) : m_matrix(matrix) {}
+ Transpose(const MatRef& matrix) : m_matrix(matrix) {}
- EiTranspose(const EiTranspose& other)
+ Transpose(const Transpose& other)
: m_matrix(other.m_matrix) {}
- EI_INHERIT_ASSIGNMENT_OPERATORS(EiTranspose)
+ EI_INHERIT_ASSIGNMENT_OPERATORS(Transpose)
private:
- EiTranspose& _ref() { return *this; }
- const EiTranspose& _constRef() const { return *this; }
+ Transpose& _ref() { return *this; }
+ const Transpose& _constRef() const { return *this; }
int _rows() const { return m_matrix.cols(); }
int _cols() const { return m_matrix.rows(); }
@@ -65,10 +65,10 @@ template<typename MatrixType> class EiTranspose
};
template<typename Scalar, typename Derived>
-EiTranspose<Derived>
-EiObject<Scalar, Derived>::transpose()
+Transpose<Derived>
+Object<Scalar, Derived>::transpose()
{
- return EiTranspose<Derived>(static_cast<Derived*>(this)->ref());
+ return Transpose<Derived>(static_cast<Derived*>(this)->ref());
}
#endif // EI_TRANSPOSE_H
diff --git a/src/Core/Util.h b/src/Core/Util.h
index 460eecb1a..6871758c2 100644
--- a/src/Core/Util.h
+++ b/src/Core/Util.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
@@ -26,12 +26,12 @@
#ifndef EI_UTIL_H
#define EI_UTIL_H
-#include <iostream>
-#include <complex>
-#include <cassert>
-
#undef minor
+#define USING_EIGEN_DATA_TYPES \
+EI_USING_MATRIX_TYPEDEFS \
+using Eigen::Matrix;
+
#define EI_UNUSED(x) (void)x
#define EI_CHECK_RANGES(matrix, row, col) \
assert(row >= 0 && row < (matrix).rows() && col >= 0 && col < (matrix).cols())
@@ -41,36 +41,36 @@
assert(col >= 0 && col < (matrix).cols())
//forward declarations
-template<typename _Scalar, int _Rows, int _Cols> class EiMatrix;
-template<typename MatrixType> class EiMatrixRef;
-template<typename MatrixType> class EiMatrixConstRef;
-template<typename MatrixType> class EiRow;
-template<typename MatrixType> class EiColumn;
-template<typename MatrixType> class EiMinor;
-template<typename MatrixType> class EiBlock;
-template<typename MatrixType> class EiTranspose;
-template<typename MatrixType> class EiConjugate;
-template<typename Lhs, typename Rhs> class EiSum;
-template<typename Lhs, typename Rhs> class EiDifference;
-template<typename Lhs, typename Rhs> class EiMatrixProduct;
-template<typename MatrixType> class EiScalarProduct;
-template<typename MatrixType> class EiRandom;
-template<typename ExpressionType> class EiEval;
+template<typename _Scalar, int _Rows, int _Cols> class Matrix;
+template<typename MatrixType> class MatrixRef;
+template<typename MatrixType> class MatrixConstRef;
+template<typename MatrixType> class Row;
+template<typename MatrixType> class Column;
+template<typename MatrixType> class Minor;
+template<typename MatrixType> class Block;
+template<typename MatrixType> class Transpose;
+template<typename MatrixType> class Conjugate;
+template<typename Lhs, typename Rhs> class Sum;
+template<typename Lhs, typename Rhs> class Difference;
+template<typename Lhs, typename Rhs> class MatrixProduct;
+template<typename MatrixType> class ScalarProduct;
+template<typename MatrixType> class Random;
+template<typename ExpressionType> class Eval;
-template<typename T> struct EiForwardDecl
+template<typename T> struct ForwardDecl
{
typedef T Ref;
typedef T ConstRef;
};
template<typename _Scalar, int _Rows, int _Cols>
-struct EiForwardDecl<EiMatrix<_Scalar, _Rows, _Cols> >
+struct ForwardDecl<Matrix<_Scalar, _Rows, _Cols> >
{
- typedef EiMatrixRef<EiMatrix<_Scalar, _Rows, _Cols> > Ref;
- typedef EiMatrixConstRef<EiMatrix<_Scalar, _Rows, _Cols> > ConstRef;
+ typedef MatrixRef<Matrix<_Scalar, _Rows, _Cols> > Ref;
+ typedef MatrixConstRef<Matrix<_Scalar, _Rows, _Cols> > ConstRef;
};
-const int EiDynamic = -1;
+const int Dynamic = -1;
#define EI_LOOP_UNROLLING_LIMIT 25
@@ -86,20 +86,20 @@ const int EiDynamic = -1;
#define EI_INHERIT_ASSIGNMENT_OPERATOR(Derived, Op) \
template<typename OtherScalar, typename OtherDerived> \
-Derived& operator Op(const EiObject<OtherScalar, OtherDerived>& other) \
+Derived& operator Op(const Object<OtherScalar, OtherDerived>& other) \
{ \
- return EiObject<Scalar, Derived>::operator Op(other); \
+ return Object<Scalar, Derived>::operator Op(other); \
} \
Derived& operator Op(const Derived& other) \
{ \
- return EiObject<Scalar, Derived>::operator Op(other); \
+ return Object<Scalar, Derived>::operator Op(other); \
}
#define EI_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(Derived, Op) \
template<typename Other> \
Derived& operator Op(const Other& scalar) \
{ \
- return EiObject<Scalar, Derived>::operator Op(scalar); \
+ return Object<Scalar, Derived>::operator Op(scalar); \
}
#define EI_INHERIT_ASSIGNMENT_OPERATORS(Derived) \
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 352daa291..58a088eb3 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -15,6 +15,6 @@ QT4_AUTOMOC(${test_SRCS})
ADD_EXECUTABLE(test ${test_SRCS})
TARGET_LINK_LIBRARIES(test ${QT_QTCORE_LIBRARY} ${QT_QTTEST_LIBRARY})
-ADD_TEST(Eigen test)
+ADD_TEST(gen test)
ENDIF(BUILD_TESTS)
diff --git a/test/main.cpp b/test/main.cpp
index f5c758961..fa0348002 100644
--- a/test/main.cpp
+++ b/test/main.cpp
@@ -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
@@ -25,7 +25,7 @@
#include "main.h"
-EigenTest::EigenTest()
+genTest::genTest()
{
unsigned int t = (unsigned int) time( NULL );
qDebug() << "Initializing random number generator with seed"
@@ -33,5 +33,5 @@ EigenTest::EigenTest()
srand(t);
}
-QTEST_APPLESS_MAIN( EigenTest )
+QTEST_APPLESS_MAIN( genTest )
#include "main.moc"
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);
}
diff --git a/test/matrixmanip.cpp b/test/matrixmanip.cpp
index dd1887c87..c8863d183 100644
--- a/test/matrixmanip.cpp
+++ b/test/matrixmanip.cpp
@@ -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
@@ -42,12 +42,12 @@ template<typename MatrixType> void matrixManip(const MatrixType& m)
a.minor(i, j) -= a.block(1, rows-1, 1, cols-1).eval();
}
-void EigenTest::testMatrixManip()
+void genTest::testMatrixManip()
{
- matrixManip(EiMatrix<int, 2, 3>());
- matrixManip(EiMatrix<double, 3, 3>());
- matrixManip(EiMatrix<complex<float>, 4,3>());
- matrixManip(EiMatrixXi(2, 2));
- matrixManip(EiMatrixXd(3, 5));
- matrixManip(EiMatrixXcf(4, 4));
+ matrixManip(Matrix<int, 2, 3>());
+ matrixManip(Matrix<double, 3, 3>());
+ matrixManip(Matrix<complex<float>, 4,3>());
+ matrixManip(MatrixXi(2, 2));
+ matrixManip(MatrixXd(3, 5));
+ matrixManip(MatrixXcf(4, 4));
}
diff --git a/test/matrixops.cpp b/test/matrixops.cpp
index 8dc1aad83..100dbeffb 100644
--- a/test/matrixops.cpp
+++ b/test/matrixops.cpp
@@ -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
@@ -59,16 +59,16 @@ template<typename MatrixType1,
QVERIFY( (d * e).rows() == rows1 && (d * e).cols() == cols2 );
}
-void EigenTest::testMatrixOps()
+void genTest::testMatrixOps()
{
- matrixOps(EiMatrix<float, 1, 1>(), EiMatrix<float, 1, 1>());
- matrixOps(EiMatrix<int, 2, 3>(), EiMatrix<int, 3, 1>());
- matrixOps(EiMatrix<double, 3, 3>(), EiMatrix<double, 3, 3>());
- matrixOps(EiMatrix<complex<float>, 4,3>(), EiMatrix<complex<float>, 3,4>());
- matrixOps(EiMatrixXf(1, 1), EiMatrixXf(1, 3));
- matrixOps(EiMatrixXi(2, 2), EiMatrixXi(2, 2));
- matrixOps(EiMatrixXd(3, 5), EiMatrixXd(5, 1));
- matrixOps(EiMatrixXcf(4, 4), EiMatrixXcf(4, 4));
- matrixOps(EiMatrixXd(3, 5), EiMatrix<double, 5, 1>());
- matrixOps(EiMatrix4cf(), EiMatrixXcf(4, 4));
+ matrixOps(Matrix<float, 1, 1>(), Matrix<float, 1, 1>());
+ matrixOps(Matrix<int, 2, 3>(), Matrix<int, 3, 1>());
+ matrixOps(Matrix<double, 3, 3>(), Matrix<double, 3, 3>());
+ matrixOps(Matrix<complex<float>, 4,3>(), Matrix<complex<float>, 3,4>());
+ matrixOps(MatrixXf(1, 1), MatrixXf(1, 3));
+ matrixOps(MatrixXi(2, 2), MatrixXi(2, 2));
+ matrixOps(MatrixXd(3, 5), MatrixXd(5, 1));
+ matrixOps(MatrixXcf(4, 4), MatrixXcf(4, 4));
+ matrixOps(MatrixXd(3, 5), Matrix<double, 5, 1>());
+ matrixOps(Matrix4cf(), MatrixXcf(4, 4));
}
diff --git a/test/vectorops.cpp b/test/vectorops.cpp
index 659e9b5c8..87195ac36 100644
--- a/test/vectorops.cpp
+++ b/test/vectorops.cpp
@@ -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
@@ -50,13 +50,13 @@ template<typename VectorType> void vectorOps(const VectorType& v)
a += (a + a).eval();
}
-void EigenTest::testVectorOps()
+void genTest::testVectorOps()
{
- vectorOps(EiVector2i());
- vectorOps(EiVector3d());
- vectorOps(EiVector4cf());
- vectorOps(EiVectorXf(1));
- vectorOps(EiVectorXi(2));
- vectorOps(EiVectorXd(3));
- vectorOps(EiVectorXcf(4));
+ vectorOps(Vector2i());
+ vectorOps(Vector3d());
+ vectorOps(Vector4cf());
+ vectorOps(VectorXf(1));
+ vectorOps(VectorXi(2));
+ vectorOps(VectorXd(3));
+ vectorOps(VectorXcf(4));
}