diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Core.h | 2 | ||||
-rw-r--r-- | src/Core/Block.h | 8 | ||||
-rw-r--r-- | src/Core/Cast.h | 6 | ||||
-rw-r--r-- | src/Core/Column.h | 8 | ||||
-rw-r--r-- | src/Core/Conjugate.h | 6 | ||||
-rw-r--r-- | src/Core/CopyHelper.h | 2 | ||||
-rw-r--r-- | src/Core/Difference.h | 8 | ||||
-rw-r--r-- | src/Core/Dot.h | 8 | ||||
-rw-r--r-- | src/Core/Eval.h | 4 | ||||
-rw-r--r-- | src/Core/FromArray.h | 6 | ||||
-rw-r--r-- | src/Core/Fuzzy.h | 8 | ||||
-rw-r--r-- | src/Core/Identity.h | 6 | ||||
-rw-r--r-- | src/Core/Matrix.h | 10 | ||||
-rw-r--r-- | src/Core/MatrixBase.h (renamed from src/Core/Object.h) | 23 | ||||
-rw-r--r-- | src/Core/MatrixRef.h | 4 | ||||
-rw-r--r-- | src/Core/Minor.h | 8 | ||||
-rw-r--r-- | src/Core/Opposite.h | 6 | ||||
-rw-r--r-- | src/Core/Product.h | 10 | ||||
-rw-r--r-- | src/Core/Random.h | 6 | ||||
-rw-r--r-- | src/Core/Row.h | 12 | ||||
-rw-r--r-- | src/Core/ScalarMultiple.h | 14 | ||||
-rw-r--r-- | src/Core/Sum.h | 8 | ||||
-rw-r--r-- | src/Core/Trace.h | 2 | ||||
-rw-r--r-- | src/Core/Transpose.h | 8 | ||||
-rw-r--r-- | src/Core/Util.h | 8 | ||||
-rw-r--r-- | src/Core/Zero.h | 6 |
26 files changed, 99 insertions, 98 deletions
diff --git a/src/Core.h b/src/Core.h index 0a10e2a14..820ab6573 100644 --- a/src/Core.h +++ b/src/Core.h @@ -6,7 +6,7 @@ namespace Eigen { #include "Core/Util.h" #include "Core/NumTraits.h" -#include "Core/Object.h" +#include "Core/MatrixBase.h" #include "Core/CopyHelper.h" #include "Core/MatrixRef.h" #include "Core/MatrixStorage.h" diff --git a/src/Core/Block.h b/src/Core/Block.h index 05b78644d..5432ff28d 100644 --- a/src/Core/Block.h +++ b/src/Core/Block.h @@ -27,12 +27,12 @@ #define EIGEN_BLOCK_H template<typename MatrixType> class Block - : public Object<typename MatrixType::Scalar, Block<MatrixType> > + : public MatrixBase<typename MatrixType::Scalar, Block<MatrixType> > { public: typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::Ref MatRef; - friend class Object<Scalar, Block<MatrixType> >; + friend class MatrixBase<Scalar, Block<MatrixType> >; static const int RowsAtCompileTime = Dynamic, ColsAtCompileTime = Dynamic; @@ -75,9 +75,9 @@ template<typename MatrixType> class Block template<typename Scalar, typename Derived> Block<Derived> -Object<Scalar, Derived>::block(int startRow, int endRow, int startCol, int endCol) const +MatrixBase<Scalar, Derived>::block(int startRow, int endRow, int startCol, int endCol) const { - return Block<Derived>(static_cast<Derived*>(const_cast<Object*>(this))->ref(), + return Block<Derived>(static_cast<Derived*>(const_cast<MatrixBase*>(this))->ref(), startRow, endRow, startCol, endCol); } diff --git a/src/Core/Cast.h b/src/Core/Cast.h index 0b8bdd6c5..f386326a0 100644 --- a/src/Core/Cast.h +++ b/src/Core/Cast.h @@ -27,12 +27,12 @@ #define EIGEN_CAST_H template<typename NewScalar, typename MatrixType> class Cast - : public Object<NewScalar, Cast<NewScalar, MatrixType> > + : public MatrixBase<NewScalar, Cast<NewScalar, MatrixType> > { public: typedef NewScalar Scalar; typedef typename MatrixType::Ref MatRef; - friend class Object<Scalar, Cast<Scalar, MatrixType> >; + friend class MatrixBase<Scalar, Cast<Scalar, MatrixType> >; static const int RowsAtCompileTime = MatrixType::RowsAtCompileTime, ColsAtCompileTime = MatrixType::ColsAtCompileTime; @@ -62,7 +62,7 @@ template<typename NewScalar, typename MatrixType> class Cast template<typename Scalar, typename Derived> template<typename NewScalar> Cast<NewScalar, Derived> -Object<Scalar, Derived>::cast() const +MatrixBase<Scalar, Derived>::cast() const { return Cast<NewScalar, Derived>(static_cast<const Derived*>(this)->ref()); } diff --git a/src/Core/Column.h b/src/Core/Column.h index f0309cd13..4ca353540 100644 --- a/src/Core/Column.h +++ b/src/Core/Column.h @@ -27,12 +27,12 @@ #define EIGEN_COLUMN_H template<typename MatrixType> class Column - : public Object<typename MatrixType::Scalar, Column<MatrixType> > + : public MatrixBase<typename MatrixType::Scalar, Column<MatrixType> > { public: typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::Ref MatRef; - friend class Object<Scalar, Column<MatrixType> >; + friend class MatrixBase<Scalar, Column<MatrixType> >; static const int RowsAtCompileTime = MatrixType::RowsAtCompileTime, ColsAtCompileTime = 1; @@ -74,9 +74,9 @@ template<typename MatrixType> class Column template<typename Scalar, typename Derived> Column<Derived> -Object<Scalar, Derived>::col(int i) const +MatrixBase<Scalar, Derived>::col(int i) const { - return Column<Derived>(static_cast<Derived*>(const_cast<Object*>(this))->ref(), i); + return Column<Derived>(static_cast<Derived*>(const_cast<MatrixBase*>(this))->ref(), i); } #endif // EIGEN_COLUMN_H diff --git a/src/Core/Conjugate.h b/src/Core/Conjugate.h index b185e2ee3..1d763ed1b 100644 --- a/src/Core/Conjugate.h +++ b/src/Core/Conjugate.h @@ -27,12 +27,12 @@ #define EIGEN_CONJUGATE_H template<typename MatrixType> class Conjugate - : public Object<typename MatrixType::Scalar, Conjugate<MatrixType> > + : public MatrixBase<typename MatrixType::Scalar, Conjugate<MatrixType> > { public: typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::Ref MatRef; - friend class Object<Scalar, Conjugate<MatrixType> >; + friend class MatrixBase<Scalar, Conjugate<MatrixType> >; static const int RowsAtCompileTime = MatrixType::RowsAtCompileTime, ColsAtCompileTime = MatrixType::ColsAtCompileTime; @@ -61,7 +61,7 @@ template<typename MatrixType> class Conjugate template<typename Scalar, typename Derived> Conjugate<Derived> -Object<Scalar, Derived>::conjugate() const +MatrixBase<Scalar, Derived>::conjugate() const { return Conjugate<Derived>(static_cast<const Derived*>(this)->ref()); } diff --git a/src/Core/CopyHelper.h b/src/Core/CopyHelper.h index 55bfdf2f9..72229eac4 100644 --- a/src/Core/CopyHelper.h +++ b/src/Core/CopyHelper.h @@ -61,7 +61,7 @@ template<int Rows> struct CopyHelperUnroller<Dynamic, Rows> template<typename Scalar, typename Derived> template<typename OtherDerived> -void Object<Scalar, Derived>::_copy_helper(const Object<Scalar, OtherDerived>& other) +void MatrixBase<Scalar, Derived>::_copy_helper(const MatrixBase<Scalar, OtherDerived>& other) { if(SizeAtCompileTime != Dynamic && SizeAtCompileTime <= EIGEN_LOOP_UNROLLING_LIMIT) CopyHelperUnroller<SizeAtCompileTime, RowsAtCompileTime>::run(*this, other); diff --git a/src/Core/Difference.h b/src/Core/Difference.h index 2c93ed9ae..cb065682b 100644 --- a/src/Core/Difference.h +++ b/src/Core/Difference.h @@ -27,13 +27,13 @@ #define EIGEN_DIFFERENCE_H template<typename Lhs, typename Rhs> class Difference - : public Object<typename Lhs::Scalar, Difference<Lhs, Rhs> > + : public MatrixBase<typename Lhs::Scalar, Difference<Lhs, Rhs> > { public: typedef typename Lhs::Scalar Scalar; typedef typename Lhs::Ref LhsRef; typedef typename Rhs::Ref RhsRef; - friend class Object<Scalar, Difference>; + friend class MatrixBase<Scalar, Difference>; static const int RowsAtCompileTime = Lhs::RowsAtCompileTime, ColsAtCompileTime = Rhs::ColsAtCompileTime; @@ -67,7 +67,7 @@ template<typename Lhs, typename Rhs> class Difference template<typename Scalar, typename Derived1, typename Derived2> Difference<Derived1, Derived2> -operator-(const Object<Scalar, Derived1> &mat1, const Object<Scalar, Derived2> &mat2) +operator-(const MatrixBase<Scalar, Derived1> &mat1, const MatrixBase<Scalar, Derived2> &mat2) { return Difference<Derived1, Derived2>(mat1.ref(), mat2.ref()); } @@ -75,7 +75,7 @@ operator-(const Object<Scalar, Derived1> &mat1, const Object<Scalar, Derived2> & template<typename Scalar, typename Derived> template<typename OtherDerived> Derived & -Object<Scalar, Derived>::operator-=(const Object<Scalar, OtherDerived> &other) +MatrixBase<Scalar, Derived>::operator-=(const MatrixBase<Scalar, OtherDerived> &other) { return *this = *this - other; } diff --git a/src/Core/Dot.h b/src/Core/Dot.h index 53342d572..4667d8129 100644 --- a/src/Core/Dot.h +++ b/src/Core/Dot.h @@ -58,7 +58,7 @@ struct DotUnroller<Index, Dynamic, Derived1, Derived2> template<typename Scalar, typename Derived> template<typename OtherDerived> -Scalar Object<Scalar, Derived>::dot(const OtherDerived& other) const +Scalar MatrixBase<Scalar, Derived>::dot(const OtherDerived& other) const { assert(IsVector && OtherDerived::IsVector && size() == other.size()); Scalar res; @@ -75,19 +75,19 @@ Scalar Object<Scalar, Derived>::dot(const OtherDerived& other) const } template<typename Scalar, typename Derived> -typename NumTraits<Scalar>::Real Object<Scalar, Derived>::norm2() const +typename NumTraits<Scalar>::Real MatrixBase<Scalar, Derived>::norm2() const { return NumTraits<Scalar>::real(dot(*this)); } template<typename Scalar, typename Derived> -typename NumTraits<Scalar>::Real Object<Scalar, Derived>::norm() const +typename NumTraits<Scalar>::Real MatrixBase<Scalar, Derived>::norm() const { return std::sqrt(norm2()); } template<typename Scalar, typename Derived> -ScalarMultiple<Derived> Object<Scalar, Derived>::normalized() const +ScalarMultiple<Derived> MatrixBase<Scalar, Derived>::normalized() const { return (*this) / norm(); } diff --git a/src/Core/Eval.h b/src/Core/Eval.h index d5bc8e457..48787476a 100644 --- a/src/Core/Eval.h +++ b/src/Core/Eval.h @@ -35,7 +35,7 @@ template<typename Expression> class Eval typedef typename Expression::Scalar Scalar; typedef Matrix<Scalar, Expression::RowsAtCompileTime, Expression::ColsAtCompileTime> MatrixType; typedef Expression Base; - friend class Object<Scalar, Expression>; + friend class MatrixBase<Scalar, Expression>; EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Eval) @@ -43,7 +43,7 @@ template<typename Expression> class Eval }; template<typename Scalar, typename Derived> -Eval<Derived> Object<Scalar, Derived>::eval() const +Eval<Derived> MatrixBase<Scalar, Derived>::eval() const { return Eval<Derived>(*static_cast<const Derived*>(this)); } diff --git a/src/Core/FromArray.h b/src/Core/FromArray.h index a8d0eda5b..681d3e7ed 100644 --- a/src/Core/FromArray.h +++ b/src/Core/FromArray.h @@ -27,11 +27,11 @@ #define EIGEN_FROMARRAY_H template<typename MatrixType> class FromArray - : public Object<typename MatrixType::Scalar, FromArray<MatrixType> > + : public MatrixBase<typename MatrixType::Scalar, FromArray<MatrixType> > { public: typedef typename MatrixType::Scalar Scalar; - friend class Object<Scalar, FromArray<MatrixType> >; + friend class MatrixBase<Scalar, FromArray<MatrixType> >; static const int RowsAtCompileTime = MatrixType::RowsAtCompileTime, ColsAtCompileTime = MatrixType::ColsAtCompileTime; @@ -65,7 +65,7 @@ template<typename MatrixType> class FromArray }; template<typename Scalar, typename Derived> -FromArray<Derived> Object<Scalar, Derived>::fromArray(const Scalar* array, int rows, int cols) +FromArray<Derived> MatrixBase<Scalar, Derived>::fromArray(const Scalar* array, int rows, int cols) { return FromArray<Derived>(rows, cols, const_cast<Scalar*>(array)); } diff --git a/src/Core/Fuzzy.h b/src/Core/Fuzzy.h index 823ea71f1..1939217bf 100644 --- a/src/Core/Fuzzy.h +++ b/src/Core/Fuzzy.h @@ -28,7 +28,7 @@ template<typename Scalar, typename Derived> template<typename OtherDerived> -bool Object<Scalar, Derived>::isApprox( +bool MatrixBase<Scalar, Derived>::isApprox( const OtherDerived& other, const typename NumTraits<Scalar>::Real& prec ) const @@ -49,7 +49,7 @@ bool Object<Scalar, Derived>::isApprox( } template<typename Scalar, typename Derived> -bool Object<Scalar, Derived>::isMuchSmallerThan( +bool MatrixBase<Scalar, Derived>::isMuchSmallerThan( const Scalar& other, const typename NumTraits<Scalar>::Real& prec ) const @@ -69,8 +69,8 @@ bool Object<Scalar, Derived>::isMuchSmallerThan( template<typename Scalar, typename Derived> template<typename OtherDerived> -bool Object<Scalar, Derived>::isMuchSmallerThan( - const Object<Scalar, OtherDerived>& other, +bool MatrixBase<Scalar, Derived>::isMuchSmallerThan( + const MatrixBase<Scalar, OtherDerived>& other, const typename NumTraits<Scalar>::Real& prec ) const { diff --git a/src/Core/Identity.h b/src/Core/Identity.h index 99186dc3a..16670dcf9 100644 --- a/src/Core/Identity.h +++ b/src/Core/Identity.h @@ -27,11 +27,11 @@ #define EIGEN_IDENTITY_H template<typename MatrixType> class Identity - : public Object<typename MatrixType::Scalar, Identity<MatrixType> > + : public MatrixBase<typename MatrixType::Scalar, Identity<MatrixType> > { public: typedef typename MatrixType::Scalar Scalar; - friend class Object<Scalar, Identity<MatrixType> >; + friend class MatrixBase<Scalar, Identity<MatrixType> >; static const int RowsAtCompileTime = MatrixType::RowsAtCompileTime, ColsAtCompileTime = MatrixType::ColsAtCompileTime; @@ -61,7 +61,7 @@ template<typename MatrixType> class Identity }; template<typename Scalar, typename Derived> -Identity<Derived> Object<Scalar, Derived>::identity(int rows) +Identity<Derived> MatrixBase<Scalar, Derived>::identity(int rows) { return Identity<Derived>(rows); } diff --git a/src/Core/Matrix.h b/src/Core/Matrix.h index c703e5b2b..9e7fd8467 100644 --- a/src/Core/Matrix.h +++ b/src/Core/Matrix.h @@ -27,12 +27,12 @@ #define EIGEN_MATRIX_H template<typename _Scalar, int _Rows, int _Cols> -class Matrix : public Object<_Scalar, Matrix<_Scalar, _Rows, _Cols> >, +class Matrix : public MatrixBase<_Scalar, Matrix<_Scalar, _Rows, _Cols> >, public MatrixStorage<_Scalar, _Rows, _Cols> { public: - friend class Object<_Scalar, Matrix>; - typedef Object<_Scalar, Matrix> Base; + friend class MatrixBase<_Scalar, Matrix>; + typedef MatrixBase<_Scalar, Matrix> Base; typedef MatrixStorage<_Scalar, _Rows, _Cols> Storage; typedef _Scalar Scalar; typedef MatrixRef<Matrix> Ref; @@ -63,7 +63,7 @@ class Matrix : public Object<_Scalar, Matrix<_Scalar, _Rows, _Cols> >, public: template<typename OtherDerived> - Matrix& operator=(const Object<Scalar, OtherDerived>& other) + Matrix& operator=(const MatrixBase<Scalar, OtherDerived>& other) { resize(other.rows(), other.cols()); return Base::operator=(other); @@ -84,7 +84,7 @@ class Matrix : public Object<_Scalar, Matrix<_Scalar, _Rows, _Cols> >, explicit Matrix(int dim) : Storage(dim) {} explicit Matrix(int rows, int cols) : Storage(rows, cols) {} template<typename OtherDerived> - Matrix(const Object<Scalar, OtherDerived>& other) + Matrix(const MatrixBase<Scalar, OtherDerived>& other) : Storage(other.rows(), other.cols()) { *this = other; diff --git a/src/Core/Object.h b/src/Core/MatrixBase.h index 9425f0050..7928b8578 100644 --- a/src/Core/Object.h +++ b/src/Core/MatrixBase.h @@ -26,13 +26,13 @@ #ifndef EIGEN_OBJECT_H #define EIGEN_OBJECT_H -template<typename Scalar, typename Derived> class Object +template<typename Scalar, typename Derived> class MatrixBase { static const int RowsAtCompileTime = Derived::RowsAtCompileTime, ColsAtCompileTime = Derived::ColsAtCompileTime; template<typename OtherDerived> - void _copy_helper(const Object<Scalar, OtherDerived>& other); + void _copy_helper(const MatrixBase<Scalar, OtherDerived>& other); template<typename OtherDerived> bool _isApprox_helper( @@ -45,9 +45,10 @@ template<typename Scalar, typename Derived> class Object ) const; template<typename OtherDerived> bool _isMuchSmallerThan_helper( - const Object<Scalar, OtherDerived>& other, + const MatrixBase<Scalar, OtherDerived>& other, const typename NumTraits<Scalar>::Real& prec = NumTraits<Scalar>::precision() ) const; + public: static const int SizeAtCompileTime = RowsAtCompileTime == Dynamic || ColsAtCompileTime == Dynamic @@ -75,7 +76,7 @@ template<typename Scalar, typename Derived> class Object } template<typename OtherDerived> - Derived& operator=(const Object<Scalar, OtherDerived>& other) + Derived& operator=(const MatrixBase<Scalar, OtherDerived>& other) { assert(rows() == other.rows() && cols() == other.cols()); _copy_helper(other); @@ -84,7 +85,7 @@ template<typename Scalar, typename Derived> class Object //special case of the above template operator=. Strangely, g++ 4.1 failed to use //that template when OtherDerived == Derived - Derived& operator=(const Object& other) + Derived& operator=(const MatrixBase& other) { assert(rows() == other.rows() && cols() == other.cols()); _copy_helper(other); @@ -128,22 +129,22 @@ template<typename Scalar, typename Derived> class Object ) const; template<typename OtherDerived> bool isMuchSmallerThan( - const Object<Scalar, OtherDerived>& other, + const MatrixBase<Scalar, OtherDerived>& other, const typename NumTraits<Scalar>::Real& prec = NumTraits<Scalar>::precision() ) const; template<typename OtherDerived> Product<Derived, OtherDerived> - lazyProduct(const Object<Scalar, OtherDerived>& other) const EIGEN_ALWAYS_INLINE; + lazyProduct(const MatrixBase<Scalar, OtherDerived>& other) const EIGEN_ALWAYS_INLINE; Opposite<Derived> operator-() const; template<typename OtherDerived> - Derived& operator+=(const Object<Scalar, OtherDerived>& other); + Derived& operator+=(const MatrixBase<Scalar, OtherDerived>& other); template<typename OtherDerived> - Derived& operator-=(const Object<Scalar, OtherDerived>& other); + Derived& operator-=(const MatrixBase<Scalar, OtherDerived>& other); template<typename OtherDerived> - Derived& operator*=(const Object<Scalar, OtherDerived>& other); + Derived& operator*=(const MatrixBase<Scalar, OtherDerived>& other); Derived& operator*=(const int& other); Derived& operator*=(const float& other); @@ -183,7 +184,7 @@ template<typename Scalar, typename Derived> class Object template<typename Scalar, typename Derived> std::ostream & operator << ( std::ostream & s, - const Object<Scalar, Derived> & m ) + const MatrixBase<Scalar, Derived> & m ) { for( int i = 0; i < m.rows(); i++ ) { diff --git a/src/Core/MatrixRef.h b/src/Core/MatrixRef.h index c2558cd49..1298162a7 100644 --- a/src/Core/MatrixRef.h +++ b/src/Core/MatrixRef.h @@ -27,11 +27,11 @@ #define EIGEN_MATRIXREF_H template<typename MatrixType> class MatrixRef - : public Object<typename MatrixType::Scalar, MatrixRef<MatrixType> > + : public MatrixBase<typename MatrixType::Scalar, MatrixRef<MatrixType> > { public: typedef typename MatrixType::Scalar Scalar; - friend class Object<Scalar, MatrixRef>; + friend class MatrixBase<Scalar, MatrixRef>; MatrixRef(const MatrixType& matrix) : m_matrix(*const_cast<MatrixType*>(&matrix)) {} MatrixRef(const MatrixRef& other) : m_matrix(other.m_matrix) {} diff --git a/src/Core/Minor.h b/src/Core/Minor.h index d52862968..f39913d57 100644 --- a/src/Core/Minor.h +++ b/src/Core/Minor.h @@ -27,12 +27,12 @@ #define EIGEN_MINOR_H template<typename MatrixType> class Minor - : public Object<typename MatrixType::Scalar, Minor<MatrixType> > + : public MatrixBase<typename MatrixType::Scalar, Minor<MatrixType> > { public: typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::Ref MatRef; - friend class Object<Scalar, Minor<MatrixType> >; + friend class MatrixBase<Scalar, Minor<MatrixType> >; static const int RowsAtCompileTime = (MatrixType::RowsAtCompileTime != Dynamic) ? @@ -75,9 +75,9 @@ template<typename MatrixType> class Minor template<typename Scalar, typename Derived> Minor<Derived> -Object<Scalar, Derived>::minor(int row, int col) const +MatrixBase<Scalar, Derived>::minor(int row, int col) const { - return Minor<Derived>(static_cast<Derived*>(const_cast<Object*>(this))->ref(), row, col); + return Minor<Derived>(static_cast<Derived*>(const_cast<MatrixBase*>(this))->ref(), row, col); } #endif // EIGEN_MINOR_H diff --git a/src/Core/Opposite.h b/src/Core/Opposite.h index 744ccb840..b84c1d9cb 100644 --- a/src/Core/Opposite.h +++ b/src/Core/Opposite.h @@ -27,12 +27,12 @@ #define EIGEN_OPPOSITE_H template<typename MatrixType> class Opposite - : public Object<typename MatrixType::Scalar, Opposite<MatrixType> > + : public MatrixBase<typename MatrixType::Scalar, Opposite<MatrixType> > { public: typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::Ref MatRef; - friend class Object<Scalar, Opposite<MatrixType> >; + friend class MatrixBase<Scalar, Opposite<MatrixType> >; static const int RowsAtCompileTime = MatrixType::RowsAtCompileTime, ColsAtCompileTime = MatrixType::ColsAtCompileTime; @@ -61,7 +61,7 @@ template<typename MatrixType> class Opposite template<typename Scalar, typename Derived> Opposite<Derived> -Object<Scalar, Derived>::operator-() const +MatrixBase<Scalar, Derived>::operator-() const { return Opposite<Derived>(static_cast<const Derived*>(this)->ref()); } diff --git a/src/Core/Product.h b/src/Core/Product.h index 4705d347d..d1d434c9b 100644 --- a/src/Core/Product.h +++ b/src/Core/Product.h @@ -62,13 +62,13 @@ struct ProductUnroller<Index, Dynamic, Lhs, Rhs> }; template<typename Lhs, typename Rhs> class Product - : public Object<typename Lhs::Scalar, Product<Lhs, Rhs> > + : public MatrixBase<typename Lhs::Scalar, Product<Lhs, Rhs> > { public: typedef typename Lhs::Scalar Scalar; typedef typename Lhs::Ref LhsRef; typedef typename Rhs::Ref RhsRef; - friend class Object<Scalar, Product>; + friend class MatrixBase<Scalar, Product>; static const int RowsAtCompileTime = Lhs::RowsAtCompileTime, ColsAtCompileTime = Rhs::ColsAtCompileTime; @@ -113,14 +113,14 @@ template<typename Lhs, typename Rhs> class Product template<typename Scalar, typename Derived> template<typename OtherDerived> Product<Derived, OtherDerived> -Object<Scalar, Derived>::lazyProduct(const Object<Scalar, OtherDerived> &other) const +MatrixBase<Scalar, Derived>::lazyProduct(const MatrixBase<Scalar, OtherDerived> &other) const { return Product<Derived, OtherDerived>(ref(), other.ref()); } template<typename Scalar, typename Derived1, typename Derived2> Eval<Product<Derived1, Derived2> > -operator*(const Object<Scalar, Derived1> &mat1, const Object<Scalar, Derived2> &mat2) +operator*(const MatrixBase<Scalar, Derived1> &mat1, const MatrixBase<Scalar, Derived2> &mat2) { return mat1.lazyProduct(mat2).eval(); } @@ -128,7 +128,7 @@ operator*(const Object<Scalar, Derived1> &mat1, const Object<Scalar, Derived2> & template<typename Scalar, typename Derived> template<typename OtherDerived> Derived & -Object<Scalar, Derived>::operator*=(const Object<Scalar, OtherDerived> &other) +MatrixBase<Scalar, Derived>::operator*=(const MatrixBase<Scalar, OtherDerived> &other) { return *this = *this * other; } diff --git a/src/Core/Random.h b/src/Core/Random.h index c30749b95..ba61306ab 100644 --- a/src/Core/Random.h +++ b/src/Core/Random.h @@ -27,11 +27,11 @@ #define EIGEN_RANDOM_H template<typename MatrixType> class Random - : public Object<typename MatrixType::Scalar, Random<MatrixType> > + : public MatrixBase<typename MatrixType::Scalar, Random<MatrixType> > { public: typedef typename MatrixType::Scalar Scalar; - friend class Object<Scalar, Random<MatrixType> >; + friend class MatrixBase<Scalar, Random<MatrixType> >; static const int RowsAtCompileTime = MatrixType::RowsAtCompileTime, ColsAtCompileTime = MatrixType::ColsAtCompileTime; @@ -61,7 +61,7 @@ template<typename MatrixType> class Random }; template<typename Scalar, typename Derived> -Eval<Random<Derived> > Object<Scalar, Derived>::random(int rows, int cols) +Eval<Random<Derived> > MatrixBase<Scalar, Derived>::random(int rows, int cols) { return Random<Derived>(rows, cols).eval(); } diff --git a/src/Core/Row.h b/src/Core/Row.h index 92597cd96..89a0dfb25 100644 --- a/src/Core/Row.h +++ b/src/Core/Row.h @@ -27,12 +27,12 @@ #define EIGEN_ROW_H template<typename MatrixType> class Row - : public Object<typename MatrixType::Scalar, Row<MatrixType> > + : public MatrixBase<typename MatrixType::Scalar, Row<MatrixType> > { public: typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::Ref MatRef; - friend class Object<Scalar, Row<MatrixType> >; + friend class MatrixBase<Scalar, Row<MatrixType> >; static const int RowsAtCompileTime = 1, ColsAtCompileTime = MatrixType::ColsAtCompileTime; @@ -47,9 +47,9 @@ template<typename MatrixType> class Row : m_matrix(other.m_matrix), m_row(other.m_row) {} template<typename OtherDerived> - Row& operator=(const Object<Scalar, OtherDerived>& other) + Row& operator=(const MatrixBase<Scalar, OtherDerived>& other) { - return Object<Scalar, Row<MatrixType> >::operator=(other); + return MatrixBase<Scalar, Row<MatrixType> >::operator=(other); } EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Row) @@ -79,9 +79,9 @@ template<typename MatrixType> class Row template<typename Scalar, typename Derived> Row<Derived> -Object<Scalar, Derived>::row(int i) const +MatrixBase<Scalar, Derived>::row(int i) const { - return Row<Derived>(static_cast<Derived*>(const_cast<Object*>(this))->ref(), i); + return Row<Derived>(static_cast<Derived*>(const_cast<MatrixBase*>(this))->ref(), i); } #endif // EIGEN_ROW_H diff --git a/src/Core/ScalarMultiple.h b/src/Core/ScalarMultiple.h index f6a5ea6c5..1798f06fe 100644 --- a/src/Core/ScalarMultiple.h +++ b/src/Core/ScalarMultiple.h @@ -27,12 +27,12 @@ #define EIGEN_SCALARMULTIPLE_H template<typename MatrixType> class ScalarMultiple - : public Object<typename MatrixType::Scalar, ScalarMultiple<MatrixType> > + : public MatrixBase<typename MatrixType::Scalar, ScalarMultiple<MatrixType> > { public: typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::Ref MatRef; - friend class Object<typename MatrixType::Scalar, ScalarMultiple<MatrixType> >; + friend class MatrixBase<typename MatrixType::Scalar, ScalarMultiple<MatrixType> >; static const int RowsAtCompileTime = MatrixType::RowsAtCompileTime, ColsAtCompileTime = MatrixType::ColsAtCompileTime; @@ -64,7 +64,7 @@ template<typename MatrixType> class ScalarMultiple #define EIGEN_MAKE_SCALAR_OPS(OtherScalar) \ template<typename Scalar, typename Derived> \ ScalarMultiple<Derived> \ -operator*(const Object<Scalar, Derived>& matrix, \ +operator*(const MatrixBase<Scalar, Derived>& matrix, \ OtherScalar scalar) \ { \ return ScalarMultiple<Derived>(matrix.ref(), scalar); \ @@ -73,14 +73,14 @@ operator*(const Object<Scalar, Derived>& matrix, \ template<typename Scalar, typename Derived> \ ScalarMultiple<Derived> \ operator*(OtherScalar scalar, \ - const Object<Scalar, Derived>& matrix) \ + const MatrixBase<Scalar, Derived>& matrix) \ { \ return ScalarMultiple<Derived>(matrix.ref(), scalar); \ } \ \ template<typename Scalar, typename Derived> \ ScalarMultiple<Derived> \ -operator/(const Object<Scalar, Derived>& matrix, \ +operator/(const MatrixBase<Scalar, Derived>& matrix, \ OtherScalar scalar) \ { \ assert(NumTraits<Scalar>::HasFloatingPoint); \ @@ -89,14 +89,14 @@ operator/(const Object<Scalar, Derived>& matrix, \ \ template<typename Scalar, typename Derived> \ Derived & \ -Object<Scalar, Derived>::operator*=(const OtherScalar &other) \ +MatrixBase<Scalar, Derived>::operator*=(const OtherScalar &other) \ { \ return *this = *this * other; \ } \ \ template<typename Scalar, typename Derived> \ Derived & \ -Object<Scalar, Derived>::operator/=(const OtherScalar &other) \ +MatrixBase<Scalar, Derived>::operator/=(const OtherScalar &other) \ { \ return *this = *this / other; \ } diff --git a/src/Core/Sum.h b/src/Core/Sum.h index cfbf20ee3..752ae9abb 100644 --- a/src/Core/Sum.h +++ b/src/Core/Sum.h @@ -27,13 +27,13 @@ #define EIGEN_SUM_H template<typename Lhs, typename Rhs> class Sum - : public Object<typename Lhs::Scalar, Sum<Lhs, Rhs> > + : public MatrixBase<typename Lhs::Scalar, Sum<Lhs, Rhs> > { public: typedef typename Lhs::Scalar Scalar; typedef typename Lhs::Ref LhsRef; typedef typename Rhs::Ref RhsRef; - friend class Object<Scalar, Sum>; + friend class MatrixBase<Scalar, Sum>; static const int RowsAtCompileTime = Lhs::RowsAtCompileTime, ColsAtCompileTime = Rhs::ColsAtCompileTime; @@ -67,7 +67,7 @@ template<typename Lhs, typename Rhs> class Sum template<typename Scalar, typename Derived1, typename Derived2> Sum<Derived1, Derived2> -operator+(const Object<Scalar, Derived1> &mat1, const Object<Scalar, Derived2> &mat2) +operator+(const MatrixBase<Scalar, Derived1> &mat1, const MatrixBase<Scalar, Derived2> &mat2) { return Sum<Derived1, Derived2>(mat1.ref(), mat2.ref()); } @@ -75,7 +75,7 @@ operator+(const Object<Scalar, Derived1> &mat1, const Object<Scalar, Derived2> & template<typename Scalar, typename Derived> template<typename OtherDerived> Derived & -Object<Scalar, Derived>::operator+=(const Object<Scalar, OtherDerived>& other) +MatrixBase<Scalar, Derived>::operator+=(const MatrixBase<Scalar, OtherDerived>& other) { return *this = *this + other; } diff --git a/src/Core/Trace.h b/src/Core/Trace.h index 9990ec3c7..86241da7c 100644 --- a/src/Core/Trace.h +++ b/src/Core/Trace.h @@ -53,7 +53,7 @@ template<int Index, typename Derived> struct TraceUnroller<Index, Dynamic, Deriv }; template<typename Scalar, typename Derived> -Scalar Object<Scalar, Derived>::trace() const +Scalar MatrixBase<Scalar, Derived>::trace() const { assert(rows() == cols()); Scalar res; diff --git a/src/Core/Transpose.h b/src/Core/Transpose.h index e1930f081..8141e60b1 100644 --- a/src/Core/Transpose.h +++ b/src/Core/Transpose.h @@ -27,12 +27,12 @@ #define EIGEN_TRANSPOSE_H template<typename MatrixType> class Transpose - : public Object<typename MatrixType::Scalar, Transpose<MatrixType> > + : public MatrixBase<typename MatrixType::Scalar, Transpose<MatrixType> > { public: typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::Ref MatRef; - friend class Object<Scalar, Transpose<MatrixType> >; + friend class MatrixBase<Scalar, Transpose<MatrixType> >; static const int RowsAtCompileTime = MatrixType::ColsAtCompileTime, ColsAtCompileTime = MatrixType::RowsAtCompileTime; @@ -65,9 +65,9 @@ template<typename MatrixType> class Transpose template<typename Scalar, typename Derived> Transpose<Derived> -Object<Scalar, Derived>::transpose() const +MatrixBase<Scalar, Derived>::transpose() const { - return Transpose<Derived>(static_cast<Derived*>(const_cast<Object*>(this))->ref()); + return Transpose<Derived>(static_cast<Derived*>(const_cast<MatrixBase*>(this))->ref()); } #endif // EIGEN_TRANSPOSE_H diff --git a/src/Core/Util.h b/src/Core/Util.h index 1eafe4514..f9cab96da 100644 --- a/src/Core/Util.h +++ b/src/Core/Util.h @@ -88,20 +88,20 @@ const int Dynamic = -1; #define EIGEN_INHERIT_ASSIGNMENT_OPERATOR(Derived, Op) \ template<typename OtherScalar, typename OtherDerived> \ -Derived& operator Op(const Object<OtherScalar, OtherDerived>& other) \ +Derived& operator Op(const MatrixBase<OtherScalar, OtherDerived>& other) \ { \ - return Object<Scalar, Derived>::operator Op(other); \ + return MatrixBase<Scalar, Derived>::operator Op(other); \ } \ Derived& operator Op(const Derived& other) \ { \ - return Object<Scalar, Derived>::operator Op(other); \ + return MatrixBase<Scalar, Derived>::operator Op(other); \ } #define EIGEN_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(Derived, Op) \ template<typename Other> \ Derived& operator Op(const Other& scalar) \ { \ - return Object<Scalar, Derived>::operator Op(scalar); \ + return MatrixBase<Scalar, Derived>::operator Op(scalar); \ } #define EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Derived) \ diff --git a/src/Core/Zero.h b/src/Core/Zero.h index 1d64730da..12168a4ba 100644 --- a/src/Core/Zero.h +++ b/src/Core/Zero.h @@ -27,11 +27,11 @@ #define EIGEN_ZERO_H template<typename MatrixType> class Zero - : public Object<typename MatrixType::Scalar, Zero<MatrixType> > + : public MatrixBase<typename MatrixType::Scalar, Zero<MatrixType> > { public: typedef typename MatrixType::Scalar Scalar; - friend class Object<Scalar, Zero<MatrixType> >; + friend class MatrixBase<Scalar, Zero<MatrixType> >; static const int RowsAtCompileTime = MatrixType::RowsAtCompileTime, ColsAtCompileTime = MatrixType::ColsAtCompileTime; @@ -61,7 +61,7 @@ template<typename MatrixType> class Zero }; template<typename Scalar, typename Derived> -Zero<Derived> Object<Scalar, Derived>::zero(int rows, int cols) +Zero<Derived> MatrixBase<Scalar, Derived>::zero(int rows, int cols) { return Zero<Derived>(rows, cols); } |