From 39f1776bde27b159814148a54483b6b2bdf51aa8 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Tue, 27 Nov 2007 13:57:51 +0000 Subject: [PATCH] rename Object -> MatrixBase --- doc/example.cpp | 4 ++-- src/Core.h | 2 +- src/Core/Block.h | 8 ++++---- src/Core/Cast.h | 6 +++--- src/Core/Column.h | 8 ++++---- src/Core/Conjugate.h | 6 +++--- src/Core/CopyHelper.h | 2 +- src/Core/Difference.h | 8 ++++---- src/Core/Dot.h | 8 ++++---- src/Core/Eval.h | 4 ++-- src/Core/FromArray.h | 6 +++--- src/Core/Fuzzy.h | 8 ++++---- src/Core/Identity.h | 6 +++--- src/Core/Matrix.h | 10 +++++----- src/Core/{Object.h => MatrixBase.h} | 23 ++++++++++++----------- src/Core/MatrixRef.h | 4 ++-- src/Core/Minor.h | 8 ++++---- src/Core/Opposite.h | 6 +++--- src/Core/Product.h | 10 +++++----- src/Core/Random.h | 6 +++--- src/Core/Row.h | 12 ++++++------ src/Core/ScalarMultiple.h | 14 +++++++------- src/Core/Sum.h | 8 ++++---- src/Core/Trace.h | 2 +- src/Core/Transpose.h | 8 ++++---- src/Core/Util.h | 8 ++++---- src/Core/Zero.h | 6 +++--- test/basicstuff.cpp | 2 +- 28 files changed, 102 insertions(+), 101 deletions(-) rename src/Core/{Object.h => MatrixBase.h} (90%) diff --git a/doc/example.cpp b/doc/example.cpp index 5384c2e4f..f54819f5f 100644 --- a/doc/example.cpp +++ b/doc/example.cpp @@ -5,14 +5,14 @@ USING_EIGEN_DATA_TYPES using namespace std; template -void foo(const Eigen::Object& m) +void foo(const Eigen::MatrixBase& m) { cout << "Here's m:" << endl << m << endl; } template Eigen::ScalarMultiple -twice(const Eigen::Object& m) +twice(const Eigen::MatrixBase& m) { return 2 * m; } 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 class Block - : public Object > + : public MatrixBase > { public: typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::Ref MatRef; - friend class Object >; + friend class MatrixBase >; static const int RowsAtCompileTime = Dynamic, ColsAtCompileTime = Dynamic; @@ -75,9 +75,9 @@ template class Block template Block -Object::block(int startRow, int endRow, int startCol, int endCol) const +MatrixBase::block(int startRow, int endRow, int startCol, int endCol) const { - return Block(static_cast(const_cast(this))->ref(), + return Block(static_cast(const_cast(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 class Cast - : public Object > + : public MatrixBase > { public: typedef NewScalar Scalar; typedef typename MatrixType::Ref MatRef; - friend class Object >; + friend class MatrixBase >; static const int RowsAtCompileTime = MatrixType::RowsAtCompileTime, ColsAtCompileTime = MatrixType::ColsAtCompileTime; @@ -62,7 +62,7 @@ template class Cast template template Cast -Object::cast() const +MatrixBase::cast() const { return Cast(static_cast(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 class Column - : public Object > + : public MatrixBase > { public: typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::Ref MatRef; - friend class Object >; + friend class MatrixBase >; static const int RowsAtCompileTime = MatrixType::RowsAtCompileTime, ColsAtCompileTime = 1; @@ -74,9 +74,9 @@ template class Column template Column -Object::col(int i) const +MatrixBase::col(int i) const { - return Column(static_cast(const_cast(this))->ref(), i); + return Column(static_cast(const_cast(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 class Conjugate - : public Object > + : public MatrixBase > { public: typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::Ref MatRef; - friend class Object >; + friend class MatrixBase >; static const int RowsAtCompileTime = MatrixType::RowsAtCompileTime, ColsAtCompileTime = MatrixType::ColsAtCompileTime; @@ -61,7 +61,7 @@ template class Conjugate template Conjugate -Object::conjugate() const +MatrixBase::conjugate() const { return Conjugate(static_cast(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 struct CopyHelperUnroller template template -void Object::_copy_helper(const Object& other) +void MatrixBase::_copy_helper(const MatrixBase& other) { if(SizeAtCompileTime != Dynamic && SizeAtCompileTime <= EIGEN_LOOP_UNROLLING_LIMIT) CopyHelperUnroller::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 class Difference - : public Object > + : public MatrixBase > { public: typedef typename Lhs::Scalar Scalar; typedef typename Lhs::Ref LhsRef; typedef typename Rhs::Ref RhsRef; - friend class Object; + friend class MatrixBase; static const int RowsAtCompileTime = Lhs::RowsAtCompileTime, ColsAtCompileTime = Rhs::ColsAtCompileTime; @@ -67,7 +67,7 @@ template class Difference template Difference -operator-(const Object &mat1, const Object &mat2) +operator-(const MatrixBase &mat1, const MatrixBase &mat2) { return Difference(mat1.ref(), mat2.ref()); } @@ -75,7 +75,7 @@ operator-(const Object &mat1, const Object & template template Derived & -Object::operator-=(const Object &other) +MatrixBase::operator-=(const MatrixBase &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 template template -Scalar Object::dot(const OtherDerived& other) const +Scalar MatrixBase::dot(const OtherDerived& other) const { assert(IsVector && OtherDerived::IsVector && size() == other.size()); Scalar res; @@ -75,19 +75,19 @@ Scalar Object::dot(const OtherDerived& other) const } template -typename NumTraits::Real Object::norm2() const +typename NumTraits::Real MatrixBase::norm2() const { return NumTraits::real(dot(*this)); } template -typename NumTraits::Real Object::norm() const +typename NumTraits::Real MatrixBase::norm() const { return std::sqrt(norm2()); } template -ScalarMultiple Object::normalized() const +ScalarMultiple MatrixBase::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 class Eval typedef typename Expression::Scalar Scalar; typedef Matrix MatrixType; typedef Expression Base; - friend class Object; + friend class MatrixBase; EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Eval) @@ -43,7 +43,7 @@ template class Eval }; template -Eval Object::eval() const +Eval MatrixBase::eval() const { return Eval(*static_cast(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 class FromArray - : public Object > + : public MatrixBase > { public: typedef typename MatrixType::Scalar Scalar; - friend class Object >; + friend class MatrixBase >; static const int RowsAtCompileTime = MatrixType::RowsAtCompileTime, ColsAtCompileTime = MatrixType::ColsAtCompileTime; @@ -65,7 +65,7 @@ template class FromArray }; template -FromArray Object::fromArray(const Scalar* array, int rows, int cols) +FromArray MatrixBase::fromArray(const Scalar* array, int rows, int cols) { return FromArray(rows, cols, const_cast(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 template -bool Object::isApprox( +bool MatrixBase::isApprox( const OtherDerived& other, const typename NumTraits::Real& prec ) const @@ -49,7 +49,7 @@ bool Object::isApprox( } template -bool Object::isMuchSmallerThan( +bool MatrixBase::isMuchSmallerThan( const Scalar& other, const typename NumTraits::Real& prec ) const @@ -69,8 +69,8 @@ bool Object::isMuchSmallerThan( template template -bool Object::isMuchSmallerThan( - const Object& other, +bool MatrixBase::isMuchSmallerThan( + const MatrixBase& other, const typename NumTraits::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 class Identity - : public Object > + : public MatrixBase > { public: typedef typename MatrixType::Scalar Scalar; - friend class Object >; + friend class MatrixBase >; static const int RowsAtCompileTime = MatrixType::RowsAtCompileTime, ColsAtCompileTime = MatrixType::ColsAtCompileTime; @@ -61,7 +61,7 @@ template class Identity }; template -Identity Object::identity(int rows) +Identity MatrixBase::identity(int rows) { return Identity(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 -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 Ref; @@ -63,7 +63,7 @@ class Matrix : public Object<_Scalar, Matrix<_Scalar, _Rows, _Cols> >, public: template - Matrix& operator=(const Object& other) + Matrix& operator=(const MatrixBase& 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 - Matrix(const Object& other) + Matrix(const MatrixBase& other) : Storage(other.rows(), other.cols()) { *this = other; diff --git a/src/Core/Object.h b/src/Core/MatrixBase.h similarity index 90% rename from src/Core/Object.h rename to 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 class Object +template class MatrixBase { static const int RowsAtCompileTime = Derived::RowsAtCompileTime, ColsAtCompileTime = Derived::ColsAtCompileTime; template - void _copy_helper(const Object& other); + void _copy_helper(const MatrixBase& other); template bool _isApprox_helper( @@ -45,9 +45,10 @@ template class Object ) const; template bool _isMuchSmallerThan_helper( - const Object& other, + const MatrixBase& other, const typename NumTraits::Real& prec = NumTraits::precision() ) const; + public: static const int SizeAtCompileTime = RowsAtCompileTime == Dynamic || ColsAtCompileTime == Dynamic @@ -75,7 +76,7 @@ template class Object } template - Derived& operator=(const Object& other) + Derived& operator=(const MatrixBase& other) { assert(rows() == other.rows() && cols() == other.cols()); _copy_helper(other); @@ -84,7 +85,7 @@ template 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 class Object ) const; template bool isMuchSmallerThan( - const Object& other, + const MatrixBase& other, const typename NumTraits::Real& prec = NumTraits::precision() ) const; template Product - lazyProduct(const Object& other) const EIGEN_ALWAYS_INLINE; + lazyProduct(const MatrixBase& other) const EIGEN_ALWAYS_INLINE; Opposite operator-() const; template - Derived& operator+=(const Object& other); + Derived& operator+=(const MatrixBase& other); template - Derived& operator-=(const Object& other); + Derived& operator-=(const MatrixBase& other); template - Derived& operator*=(const Object& other); + Derived& operator*=(const MatrixBase& other); Derived& operator*=(const int& other); Derived& operator*=(const float& other); @@ -183,7 +184,7 @@ template class Object template std::ostream & operator << ( std::ostream & s, - const Object & m ) + const MatrixBase & 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 class MatrixRef - : public Object > + : public MatrixBase > { public: typedef typename MatrixType::Scalar Scalar; - friend class Object; + friend class MatrixBase; MatrixRef(const MatrixType& matrix) : m_matrix(*const_cast(&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 class Minor - : public Object > + : public MatrixBase > { public: typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::Ref MatRef; - friend class Object >; + friend class MatrixBase >; static const int RowsAtCompileTime = (MatrixType::RowsAtCompileTime != Dynamic) ? @@ -75,9 +75,9 @@ template class Minor template Minor -Object::minor(int row, int col) const +MatrixBase::minor(int row, int col) const { - return Minor(static_cast(const_cast(this))->ref(), row, col); + return Minor(static_cast(const_cast(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 class Opposite - : public Object > + : public MatrixBase > { public: typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::Ref MatRef; - friend class Object >; + friend class MatrixBase >; static const int RowsAtCompileTime = MatrixType::RowsAtCompileTime, ColsAtCompileTime = MatrixType::ColsAtCompileTime; @@ -61,7 +61,7 @@ template class Opposite template Opposite -Object::operator-() const +MatrixBase::operator-() const { return Opposite(static_cast(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 }; template class Product - : public Object > + : public MatrixBase > { public: typedef typename Lhs::Scalar Scalar; typedef typename Lhs::Ref LhsRef; typedef typename Rhs::Ref RhsRef; - friend class Object; + friend class MatrixBase; static const int RowsAtCompileTime = Lhs::RowsAtCompileTime, ColsAtCompileTime = Rhs::ColsAtCompileTime; @@ -113,14 +113,14 @@ template class Product template template Product -Object::lazyProduct(const Object &other) const +MatrixBase::lazyProduct(const MatrixBase &other) const { return Product(ref(), other.ref()); } template Eval > -operator*(const Object &mat1, const Object &mat2) +operator*(const MatrixBase &mat1, const MatrixBase &mat2) { return mat1.lazyProduct(mat2).eval(); } @@ -128,7 +128,7 @@ operator*(const Object &mat1, const Object & template template Derived & -Object::operator*=(const Object &other) +MatrixBase::operator*=(const MatrixBase &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 class Random - : public Object > + : public MatrixBase > { public: typedef typename MatrixType::Scalar Scalar; - friend class Object >; + friend class MatrixBase >; static const int RowsAtCompileTime = MatrixType::RowsAtCompileTime, ColsAtCompileTime = MatrixType::ColsAtCompileTime; @@ -61,7 +61,7 @@ template class Random }; template -Eval > Object::random(int rows, int cols) +Eval > MatrixBase::random(int rows, int cols) { return Random(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 class Row - : public Object > + : public MatrixBase > { public: typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::Ref MatRef; - friend class Object >; + friend class MatrixBase >; static const int RowsAtCompileTime = 1, ColsAtCompileTime = MatrixType::ColsAtCompileTime; @@ -47,9 +47,9 @@ template class Row : m_matrix(other.m_matrix), m_row(other.m_row) {} template - Row& operator=(const Object& other) + Row& operator=(const MatrixBase& other) { - return Object >::operator=(other); + return MatrixBase >::operator=(other); } EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Row) @@ -79,9 +79,9 @@ template class Row template Row -Object::row(int i) const +MatrixBase::row(int i) const { - return Row(static_cast(const_cast(this))->ref(), i); + return Row(static_cast(const_cast(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 class ScalarMultiple - : public Object > + : public MatrixBase > { public: typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::Ref MatRef; - friend class Object >; + friend class MatrixBase >; static const int RowsAtCompileTime = MatrixType::RowsAtCompileTime, ColsAtCompileTime = MatrixType::ColsAtCompileTime; @@ -64,7 +64,7 @@ template class ScalarMultiple #define EIGEN_MAKE_SCALAR_OPS(OtherScalar) \ template \ ScalarMultiple \ -operator*(const Object& matrix, \ +operator*(const MatrixBase& matrix, \ OtherScalar scalar) \ { \ return ScalarMultiple(matrix.ref(), scalar); \ @@ -73,14 +73,14 @@ operator*(const Object& matrix, \ template \ ScalarMultiple \ operator*(OtherScalar scalar, \ - const Object& matrix) \ + const MatrixBase& matrix) \ { \ return ScalarMultiple(matrix.ref(), scalar); \ } \ \ template \ ScalarMultiple \ -operator/(const Object& matrix, \ +operator/(const MatrixBase& matrix, \ OtherScalar scalar) \ { \ assert(NumTraits::HasFloatingPoint); \ @@ -89,14 +89,14 @@ operator/(const Object& matrix, \ \ template \ Derived & \ -Object::operator*=(const OtherScalar &other) \ +MatrixBase::operator*=(const OtherScalar &other) \ { \ return *this = *this * other; \ } \ \ template \ Derived & \ -Object::operator/=(const OtherScalar &other) \ +MatrixBase::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 class Sum - : public Object > + : public MatrixBase > { public: typedef typename Lhs::Scalar Scalar; typedef typename Lhs::Ref LhsRef; typedef typename Rhs::Ref RhsRef; - friend class Object; + friend class MatrixBase; static const int RowsAtCompileTime = Lhs::RowsAtCompileTime, ColsAtCompileTime = Rhs::ColsAtCompileTime; @@ -67,7 +67,7 @@ template class Sum template Sum -operator+(const Object &mat1, const Object &mat2) +operator+(const MatrixBase &mat1, const MatrixBase &mat2) { return Sum(mat1.ref(), mat2.ref()); } @@ -75,7 +75,7 @@ operator+(const Object &mat1, const Object & template template Derived & -Object::operator+=(const Object& other) +MatrixBase::operator+=(const MatrixBase& 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 struct TraceUnroller -Scalar Object::trace() const +Scalar MatrixBase::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 class Transpose - : public Object > + : public MatrixBase > { public: typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::Ref MatRef; - friend class Object >; + friend class MatrixBase >; static const int RowsAtCompileTime = MatrixType::ColsAtCompileTime, ColsAtCompileTime = MatrixType::RowsAtCompileTime; @@ -65,9 +65,9 @@ template class Transpose template Transpose -Object::transpose() const +MatrixBase::transpose() const { - return Transpose(static_cast(const_cast(this))->ref()); + return Transpose(static_cast(const_cast(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 \ -Derived& operator Op(const Object& other) \ +Derived& operator Op(const MatrixBase& other) \ { \ - return Object::operator Op(other); \ + return MatrixBase::operator Op(other); \ } \ Derived& operator Op(const Derived& other) \ { \ - return Object::operator Op(other); \ + return MatrixBase::operator Op(other); \ } #define EIGEN_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(Derived, Op) \ template \ Derived& operator Op(const Other& scalar) \ { \ - return Object::operator Op(scalar); \ + return MatrixBase::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 class Zero - : public Object > + : public MatrixBase > { public: typedef typename MatrixType::Scalar Scalar; - friend class Object >; + friend class MatrixBase >; static const int RowsAtCompileTime = MatrixType::RowsAtCompileTime, ColsAtCompileTime = MatrixType::ColsAtCompileTime; @@ -61,7 +61,7 @@ template class Zero }; template -Zero Object::zero(int rows, int cols) +Zero MatrixBase::zero(int rows, int cols) { return Zero(rows, cols); } diff --git a/test/basicstuff.cpp b/test/basicstuff.cpp index 2bb939570..08e75db06 100644 --- a/test/basicstuff.cpp +++ b/test/basicstuff.cpp @@ -33,7 +33,7 @@ template void basicStuff(const MatrixType& m) Opposite.h Product.h ScalarMultiple.h FromArray.h 2) Implicitly (the core stuff): - Object.h Matrix.h MatrixStorage.h CopyHelper.h MatrixRef.h + MatrixBase.h Matrix.h MatrixStorage.h CopyHelper.h MatrixRef.h NumTraits.h Util.h */