diff --git a/Eigen/Core b/Eigen/Core index e4dcfc96e..7fc048729 100644 --- a/Eigen/Core +++ b/Eigen/Core @@ -4,14 +4,6 @@ #include #include -#if ((defined __GNUC__) && ( (__GNUC__==3) || (__GNUC__==4) && __GNUC_MINOR__==0)) -/* This very ugly hack to fix a bug of gcc <4.1 with the Curiously recurring template pattern and friend class. - Note that gcc-4.0.1 is still the default compiler on MACOSX Leopard. -*/ -#define private public -#warning "Your compiler (gcc<4.1) has issue with friend and CRT, all private members of Eigen's classes are made public" -#endif - namespace Eigen { #include "src/Core/Util.h" @@ -50,6 +42,3 @@ namespace Eigen { } // namespace Eigen -#if ((defined __GNUC__) && (__GNUC_MINOR__==0)) -#undef private -#endif diff --git a/Eigen/src/Core/Block.h b/Eigen/src/Core/Block.h index 288a8782a..5c1827c43 100644 --- a/Eigen/src/Core/Block.h +++ b/Eigen/src/Core/Block.h @@ -6,12 +6,12 @@ // // Eigen is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either +// License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // // Alternatively, 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 of +// published by the Free Software Foundation; either version 2 of // the License, or (at your option) any later version. // // Eigen is distributed in the hope that it will be useful, but WITHOUT ANY @@ -65,6 +65,7 @@ template; + friend class MatrixBase::Traits; typedef MatrixBase Base; /** Fixed-size constructor diff --git a/Eigen/src/Core/Cast.h b/Eigen/src/Core/Cast.h index 42c0a7f0f..cc67ce5d8 100644 --- a/Eigen/src/Core/Cast.h +++ b/Eigen/src/Core/Cast.h @@ -5,12 +5,12 @@ // // Eigen is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either +// License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // // Alternatively, 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 of +// published by the Free Software Foundation; either version 2 of // the License, or (at your option) any later version. // // Eigen is distributed in the hope that it will be useful, but WITHOUT ANY @@ -18,7 +18,7 @@ // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the // GNU General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public +// You should have received a copy of the GNU Lesser General Public // License and a copy of the GNU General Public License along with // Eigen. If not, see . @@ -52,10 +52,11 @@ template class Cast : NoOperatorEquals, typedef NewScalar Scalar; typedef typename MatrixType::Ref MatRef; friend class MatrixBase; + friend class MatrixBase::Traits; typedef MatrixBase Base; - + Cast(const MatRef& matrix) : m_matrix(matrix) {} - + private: enum { RowsAtCompileTime = MatrixType::Traits::RowsAtCompileTime, @@ -66,12 +67,12 @@ template class Cast : NoOperatorEquals, const Cast& _ref() const { return *this; } int _rows() const { return m_matrix.rows(); } int _cols() const { return m_matrix.cols(); } - + NewScalar _coeff(int row, int col) const { return static_cast(m_matrix.coeff(row, col)); } - + protected: const MatRef m_matrix; }; diff --git a/Eigen/src/Core/Column.h b/Eigen/src/Core/Column.h index 37d959743..bece3caa7 100644 --- a/Eigen/src/Core/Column.h +++ b/Eigen/src/Core/Column.h @@ -5,12 +5,12 @@ // // Eigen is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either +// License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // // Alternatively, 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 of +// published by the Free Software Foundation; either version 2 of // the License, or (at your option) any later version. // // Eigen is distributed in the hope that it will be useful, but WITHOUT ANY @@ -18,7 +18,7 @@ // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the // GNU General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public +// You should have received a copy of the GNU Lesser General Public // License and a copy of the GNU General Public License along with // Eigen. If not, see . @@ -52,16 +52,17 @@ template class Column typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::Ref MatRef; friend class MatrixBase; + friend class MatrixBase::Traits; typedef MatrixBase Base; - + Column(const MatRef& matrix, int col) : m_matrix(matrix), m_col(col) { assert(col >= 0 && col < matrix.cols()); } - + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Column) - + private: enum { RowsAtCompileTime = MatrixType::Traits::RowsAtCompileTime, @@ -69,21 +70,21 @@ template class Column MaxRowsAtCompileTime = MatrixType::Traits::MaxRowsAtCompileTime, MaxColsAtCompileTime = 1 }; - + const Column& _ref() const { return *this; } int _rows() const { return m_matrix.rows(); } int _cols() const { return 1; } - + Scalar& _coeffRef(int row, int) { return m_matrix.coeffRef(row, m_col); } - + Scalar _coeff(int row, int) const { return m_matrix.coeff(row, m_col); } - + protected: MatRef m_matrix; const int m_col; diff --git a/Eigen/src/Core/CwiseBinaryOp.h b/Eigen/src/Core/CwiseBinaryOp.h index b06163c39..571c0ebad 100644 --- a/Eigen/src/Core/CwiseBinaryOp.h +++ b/Eigen/src/Core/CwiseBinaryOp.h @@ -6,12 +6,12 @@ // // Eigen is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either +// License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // // Alternatively, 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 of +// published by the Free Software Foundation; either version 2 of // the License, or (at your option) any later version. // // Eigen is distributed in the hope that it will be useful, but WITHOUT ANY @@ -44,7 +44,7 @@ * Here is an example illustrating this: * \include class_CwiseBinaryOp.cpp * - * \sa class CwiseProductOp, class CwiseQuotientOp + * \sa class ScalarProductOp, class ScalarQuotientOp */ template class CwiseBinaryOp : NoOperatorEquals, @@ -55,6 +55,7 @@ class CwiseBinaryOp : NoOperatorEquals, typedef typename Lhs::Ref LhsRef; typedef typename Rhs::Ref RhsRef; friend class MatrixBase; + friend class MatrixBase::Traits; typedef MatrixBase Base; CwiseBinaryOp(const LhsRef& lhs, const RhsRef& rhs) @@ -79,7 +80,7 @@ class CwiseBinaryOp : NoOperatorEquals, { return BinaryOp::template op(m_lhs.coeff(row, col), m_rhs.coeff(row, col)); } - + protected: const LhsRef m_lhs; const RhsRef m_rhs; @@ -105,7 +106,7 @@ struct CwiseDifferenceOp { * * \sa class CwiseBinaryOp, MatrixBase::cwiseProduct() */ -struct CwiseProductOp { +struct ScalarProductOp { template static Scalar op(const Scalar& a, const Scalar& b) { return a * b; } }; @@ -113,7 +114,7 @@ struct CwiseProductOp { * * \sa class CwiseBinaryOp, MatrixBase::cwiseQuotient() */ -struct CwiseQuotientOp { +struct ScalarQuotientOp { template static Scalar op(const Scalar& a, const Scalar& b) { return a / b; } }; @@ -175,10 +176,10 @@ MatrixBase::operator+=(const MatrixBase& */ template template -const CwiseBinaryOp +const CwiseBinaryOp MatrixBase::cwiseProduct(const MatrixBase &other) const { - return CwiseBinaryOp(ref(), other.ref()); + return CwiseBinaryOp(ref(), other.ref()); } @@ -188,10 +189,10 @@ MatrixBase::cwiseProduct(const MatrixBase */ template template -const CwiseBinaryOp +const CwiseBinaryOp MatrixBase::cwiseQuotient(const MatrixBase &other) const { - return CwiseBinaryOp(ref(), other.ref()); + return CwiseBinaryOp(ref(), other.ref()); } @@ -220,7 +221,7 @@ cwise(const MatrixBase &mat1, const MatrixBase void foo(const MatrixType& m1, const MatrixType& m2) { - * m1.template cwise(m2); + * m1.template cwise(m2); * } * \endcode * diff --git a/Eigen/src/Core/CwiseUnaryOp.h b/Eigen/src/Core/CwiseUnaryOp.h index 27e8c288f..e3eb9090f 100644 --- a/Eigen/src/Core/CwiseUnaryOp.h +++ b/Eigen/src/Core/CwiseUnaryOp.h @@ -47,6 +47,7 @@ class CwiseUnaryOp : NoOperatorEquals, typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::Ref MatRef; friend class MatrixBase; + friend class MatrixBase::Traits; typedef MatrixBase Base; CwiseUnaryOp(const MatRef& mat) : m_matrix(mat) {} @@ -76,7 +77,7 @@ class CwiseUnaryOp : NoOperatorEquals, * * \sa class CwiseUnaryOp, MatrixBase::operator- */ -struct CwiseOppositeOp { +struct ScalarOppositeOp { template static Scalar op(const Scalar& a) { return -a; } }; @@ -84,7 +85,7 @@ struct CwiseOppositeOp { * * \sa class CwiseUnaryOp, MatrixBase::cwiseAbs */ -struct CwiseAbsOp { +struct ScalarAbsOp { template static Scalar op(const Scalar& a) { return ei_abs(a); } }; @@ -92,19 +93,19 @@ struct CwiseAbsOp { /** \returns an expression of the opposite of \c *this */ template -const CwiseUnaryOp +const CwiseUnaryOp MatrixBase::operator-() const { - return CwiseUnaryOp(ref()); + return CwiseUnaryOp(ref()); } /** \returns an expression of the opposite of \c *this */ template -const CwiseUnaryOp +const CwiseUnaryOp MatrixBase::cwiseAbs() const { - return CwiseUnaryOp(ref()); + return CwiseUnaryOp(ref()); } @@ -133,7 +134,7 @@ cwise(const MatrixBase &mat) * the keyword template as to be used if the matrix type is also a template parameter: * \code * template void foo(const MatrixType& m) { - * m.template cwise(); + * m.template cwise(); * } * \endcode * @@ -152,7 +153,7 @@ MatrixBase::cwise() const * * \sa class CwiseUnaryOp, MatrixBase::conjugate() */ -struct ConjugateOp { +struct ScalarConjugateOp { template static Scalar op(const Scalar& a) { return ei_conj(a); } }; @@ -160,10 +161,10 @@ struct ConjugateOp { * * \sa adjoint(), class Conjugate */ template -const CwiseUnaryOp +const CwiseUnaryOp MatrixBase::conjugate() const { - return CwiseUnaryOp(ref()); + return CwiseUnaryOp(ref()); } diff --git a/Eigen/src/Core/DiagonalCoeffs.h b/Eigen/src/Core/DiagonalCoeffs.h index 9baee22b6..291bfe472 100644 --- a/Eigen/src/Core/DiagonalCoeffs.h +++ b/Eigen/src/Core/DiagonalCoeffs.h @@ -5,12 +5,12 @@ // // Eigen is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either +// License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // // Alternatively, 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 of +// published by the Free Software Foundation; either version 2 of // the License, or (at your option) any later version. // // Eigen is distributed in the hope that it will be useful, but WITHOUT ANY @@ -18,7 +18,7 @@ // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the // GNU General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public +// You should have received a copy of the GNU Lesser General Public // License and a copy of the GNU General Public License along with // Eigen. If not, see . @@ -44,12 +44,13 @@ template class DiagonalCoeffs typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::Ref MatRef; friend class MatrixBase; + friend class MatrixBase::Traits; typedef MatrixBase Base; DiagonalCoeffs(const MatRef& matrix) : m_matrix(matrix) {} - + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(DiagonalCoeffs) - + private: enum { RowsAtCompileTime = MatrixType::Traits::SizeAtCompileTime == Dynamic ? Dynamic @@ -65,17 +66,17 @@ template class DiagonalCoeffs const DiagonalCoeffs& _ref() const { return *this; } int _rows() const { return std::min(m_matrix.rows(), m_matrix.cols()); } int _cols() const { return 1; } - + Scalar& _coeffRef(int row, int) { return m_matrix.coeffRef(row, row); } - + Scalar _coeff(int row, int) const { return m_matrix.coeff(row, row); } - + protected: MatRef m_matrix; }; diff --git a/Eigen/src/Core/DiagonalMatrix.h b/Eigen/src/Core/DiagonalMatrix.h index 11106ea75..6cfd910c6 100644 --- a/Eigen/src/Core/DiagonalMatrix.h +++ b/Eigen/src/Core/DiagonalMatrix.h @@ -5,12 +5,12 @@ // // Eigen is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either +// License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // // Alternatively, 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 of +// published by the Free Software Foundation; either version 2 of // the License, or (at your option) any later version. // // Eigen is distributed in the hope that it will be useful, but WITHOUT ANY @@ -18,7 +18,7 @@ // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the // GNU General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public +// You should have received a copy of the GNU Lesser General Public // License and a copy of the GNU General Public License along with // Eigen. If not, see . @@ -47,6 +47,7 @@ class DiagonalMatrix : NoOperatorEquals, typedef typename CoeffsVectorType::Scalar Scalar; typedef typename CoeffsVectorType::Ref CoeffsVecRef; friend class MatrixBase; + friend class MatrixBase::Traits; typedef MatrixBase Base; DiagonalMatrix(const CoeffsVecRef& coeffs) : m_coeffs(coeffs) @@ -54,7 +55,7 @@ class DiagonalMatrix : NoOperatorEquals, assert(CoeffsVectorType::Traits::IsVectorAtCompileTime && coeffs.size() > 0); } - + private: enum { RowsAtCompileTime = CoeffsVectorType::Traits::SizeAtCompileTime, @@ -62,16 +63,16 @@ class DiagonalMatrix : NoOperatorEquals, MaxRowsAtCompileTime = CoeffsVectorType::Traits::MaxSizeAtCompileTime, MaxColsAtCompileTime = CoeffsVectorType::Traits::MaxSizeAtCompileTime }; - + const DiagonalMatrix& _ref() const { return *this; } int _rows() const { return m_coeffs.size(); } int _cols() const { return m_coeffs.size(); } - + Scalar _coeff(int row, int col) const { return row == col ? m_coeffs.coeff(row) : static_cast(0); } - + protected: const CoeffsVecRef m_coeffs; }; diff --git a/Eigen/src/Core/ForwardDeclarations.h b/Eigen/src/Core/ForwardDeclarations.h index 6935c030f..6ed9dacfe 100644 --- a/Eigen/src/Core/ForwardDeclarations.h +++ b/Eigen/src/Core/ForwardDeclarations.h @@ -35,12 +35,7 @@ template clas template class Transpose; template class Conjugate; template class CwiseBinaryOp; -struct CwiseProductOp; -struct CwiseQuotientOp; template class CwiseUnaryOp; -struct CwiseOppositeOp; -struct ConjugateOp; -struct CwiseAbsOp; template class Product; template class ScalarMultiple; template class Random; @@ -52,6 +47,12 @@ template class Identity; template class Map; template class Eval; +struct ScalarProductOp; +struct ScalarQuotientOp; +struct ScalarOppositeOp; +struct ScalarConjugateOp; +struct ScalarAbsOp; + template struct Reference { typedef T Type; diff --git a/Eigen/src/Core/Identity.h b/Eigen/src/Core/Identity.h index fbe1479a4..a057e915b 100644 --- a/Eigen/src/Core/Identity.h +++ b/Eigen/src/Core/Identity.h @@ -5,12 +5,12 @@ // // Eigen is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either +// License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // // Alternatively, 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 of +// published by the Free Software Foundation; either version 2 of // the License, or (at your option) any later version. // // Eigen is distributed in the hope that it will be useful, but WITHOUT ANY @@ -18,7 +18,7 @@ // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the // GNU General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public +// You should have received a copy of the GNU Lesser General Public // License and a copy of the GNU General Public License along with // Eigen. If not, see . @@ -37,6 +37,7 @@ template class Identity : NoOperatorEquals, public: typedef typename MatrixType::Scalar Scalar; friend class MatrixBase; + friend class MatrixBase::Traits; typedef MatrixBase Base; Identity(int rows, int cols) : m_rows(rows), m_cols(cols) @@ -46,7 +47,7 @@ template class Identity : NoOperatorEquals, && cols > 0 && (ColsAtCompileTime == Dynamic || ColsAtCompileTime == cols)); } - + private: enum { RowsAtCompileTime = MatrixType::Traits::RowsAtCompileTime, @@ -54,16 +55,16 @@ template class Identity : NoOperatorEquals, MaxRowsAtCompileTime = MatrixType::Traits::MaxRowsAtCompileTime, MaxColsAtCompileTime = MatrixType::Traits::MaxColsAtCompileTime }; - + const Identity& _ref() const { return *this; } int _rows() const { return m_rows.value(); } int _cols() const { return m_cols.value(); } - + Scalar _coeff(int row, int col) const { return row == col ? static_cast(1) : static_cast(0); } - + protected: const IntAtRunTimeIfDynamic m_rows; const IntAtRunTimeIfDynamic m_cols; diff --git a/Eigen/src/Core/Map.h b/Eigen/src/Core/Map.h index 352703a12..b3160396a 100644 --- a/Eigen/src/Core/Map.h +++ b/Eigen/src/Core/Map.h @@ -5,12 +5,12 @@ // // Eigen is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either +// License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // // Alternatively, 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 of +// published by the Free Software Foundation; either version 2 of // the License, or (at your option) any later version. // // Eigen is distributed in the hope that it will be useful, but WITHOUT ANY @@ -18,7 +18,7 @@ // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the // GNU General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public +// You should have received a copy of the GNU Lesser General Public // License and a copy of the GNU General Public License along with // Eigen. If not, see . @@ -44,6 +44,7 @@ template class Map public: typedef typename MatrixType::Scalar Scalar; friend class MatrixBase; + friend class MatrixBase::Traits; typedef MatrixBase Base; private: @@ -58,7 +59,7 @@ template class Map const Map& _ref() const { return *this; } int _rows() const { return m_rows; } int _cols() const { return m_cols; } - + const Scalar& _coeff(int row, int col) const { if(Order == ColumnMajor) @@ -66,7 +67,7 @@ template class Map else // RowMajor return m_data[col + row * m_cols]; } - + Scalar& _coeffRef(int row, int col) { if(Order == ColumnMajor) @@ -74,7 +75,7 @@ template class Map else // RowMajor return const_cast(m_data)[col + row * m_cols]; } - + public: Map(const Scalar* data, int rows, int cols) : m_data(data), m_rows(rows), m_cols(cols) { @@ -83,9 +84,9 @@ template class Map && cols > 0 && (ColsAtCompileTime == Dynamic || ColsAtCompileTime == cols)); } - + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Map) - + protected: const Scalar* m_data; const int m_rows, m_cols; diff --git a/Eigen/src/Core/Matrix.h b/Eigen/src/Core/Matrix.h index 29d3066d7..bfb6d5f65 100644 --- a/Eigen/src/Core/Matrix.h +++ b/Eigen/src/Core/Matrix.h @@ -5,12 +5,12 @@ // // Eigen is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either +// License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // // Alternatively, 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 of +// published by the Free Software Foundation; either version 2 of // the License, or (at your option) any later version. // // Eigen is distributed in the hope that it will be useful, but WITHOUT ANY @@ -18,7 +18,7 @@ // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the // GNU General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public +// You should have received a copy of the GNU Lesser General Public // License and a copy of the GNU General Public License along with // Eigen. If not, see . @@ -79,13 +79,14 @@ class Matrix : public MatrixBase<_Scalar, Matrix<_Scalar, _Rows, _Cols, { public: friend class MatrixBase<_Scalar, Matrix>; + friend class MatrixBase<_Scalar, Matrix>::Traits; friend class Map; - + typedef MatrixBase<_Scalar, Matrix> Base; typedef _Scalar Scalar; typedef MatrixRef Ref; friend class MatrixRef; - + private: enum { RowsAtCompileTime = _Rows, @@ -103,7 +104,7 @@ class Matrix : public MatrixBase<_Scalar, Matrix<_Scalar, _Rows, _Cols, Ref _ref() const { return Ref(*this); } int _rows() const { return m_storage.rows(); } int _cols() const { return m_storage.cols(); } - + const Scalar& _coeff(int row, int col) const { if(StorageOrder == ColumnMajor) @@ -111,7 +112,7 @@ class Matrix : public MatrixBase<_Scalar, Matrix<_Scalar, _Rows, _Cols, else // RowMajor return m_storage.data()[col + row * m_storage.cols()]; } - + Scalar& _coeffRef(int row, int col) { if(StorageOrder == ColumnMajor) @@ -119,12 +120,12 @@ class Matrix : public MatrixBase<_Scalar, Matrix<_Scalar, _Rows, _Cols, else // RowMajor return m_storage.data()[col + row * m_storage.cols()]; } - + public: /** \returns a const pointer to the data array of this matrix */ const Scalar *data() const { return m_storage.data(); } - + /** \returns a pointer to the data array of this matrix */ Scalar *data() { return m_storage.data(); } @@ -148,7 +149,7 @@ class Matrix : public MatrixBase<_Scalar, Matrix<_Scalar, _Rows, _Cols, * is allowed. The resizing, if any, is then done in the appropriate way so that * row-vectors remain row-vectors and vectors remain vectors. */ - template + template Matrix& operator=(const MatrixBase& other) { if(RowsAtCompileTime == 1) @@ -164,7 +165,7 @@ class Matrix : public MatrixBase<_Scalar, Matrix<_Scalar, _Rows, _Cols, else resize(other.rows(), other.cols()); return Base::operator=(other); } - + /** This is a special case of the templated operator=. Its purpose is to * prevent a default operator= from hiding the templated operator=. */ @@ -172,19 +173,19 @@ class Matrix : public MatrixBase<_Scalar, Matrix<_Scalar, _Rows, _Cols, { return operator=(other); } - + EIGEN_INHERIT_ASSIGNMENT_OPERATOR(Matrix, +=) EIGEN_INHERIT_ASSIGNMENT_OPERATOR(Matrix, -=) EIGEN_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(Matrix, *=) EIGEN_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(Matrix, /=) - + static const Map map(const Scalar* array, int rows, int cols); static const Map map(const Scalar* array, int size); static const Map map(const Scalar* array); static Map map(Scalar* array, int rows, int cols); static Map map(Scalar* array, int size); static Map map(Scalar* array); - + /** Default constructor, does nothing. Only for fixed-size matrices. * For dynamic-size matrices and vectors, this constructor is forbidden (guarded by * an assertion) because it would leave the matrix without an allocated data buffer. @@ -193,7 +194,7 @@ class Matrix : public MatrixBase<_Scalar, Matrix<_Scalar, _Rows, _Cols, { assert(RowsAtCompileTime > 0 && ColsAtCompileTime > 0); } - + /** Constructs a vector or row-vector with given dimension. \only_for_vectors * * Note that this is only useful for dynamic-size vectors. For fixed-size vectors, @@ -208,7 +209,7 @@ class Matrix : public MatrixBase<_Scalar, Matrix<_Scalar, _Rows, _Cols, || (ColsAtCompileTime == 1 && (RowsAtCompileTime == Dynamic || RowsAtCompileTime == dim))); } - + /** This constructor has two very different behaviors, depending on the type of *this. * * \li When Matrix is a fixed-size vector type of size 2, this constructor constructs @@ -271,7 +272,7 @@ class Matrix : public MatrixBase<_Scalar, Matrix<_Scalar, _Rows, _Cols, Matrix(const Scalar *data, int rows, int cols); Matrix(const Scalar *data, int size); explicit Matrix(const Scalar *data); - + /** Constructor copying the value of the expression \a other */ template Matrix(const MatrixBase& other) diff --git a/Eigen/src/Core/MatrixBase.h b/Eigen/src/Core/MatrixBase.h index 102b14529..7d401e96c 100644 --- a/Eigen/src/Core/MatrixBase.h +++ b/Eigen/src/Core/MatrixBase.h @@ -143,8 +143,8 @@ template class MatrixBase * \sa class NumTraits */ typedef typename NumTraits::Real RealScalar; - - /// \name a - matrix properties + + /// \name matrix properties //@{ /** \returns the number of rows. \sa cols(), Traits::RowsAtCompileTime */ int rows() const { return static_cast(this)->_rows(); } @@ -163,12 +163,12 @@ template class MatrixBase /** \returns a Ref to *this. \sa Ref */ Ref ref() const { return static_cast(this)->_ref(); } - + //@{ /** Copies \a other into *this. \returns a reference to *this. */ template Derived& operator=(const MatrixBase& other); - + /** Special case of the template operator=, in order to prevent the compiler * from generating a default operator= (issue hit with g++ 4.1) */ @@ -176,7 +176,7 @@ template class MatrixBase { return this->operator=(other); } - + /** swaps *this with the expression \a other. * * \note \a other is only marked const because I couln't find another way @@ -186,22 +186,22 @@ template class MatrixBase template void swap(const MatrixBase& other); //@} - - /// \name c - sub-matrices + + /// \name sub-matrices //@{ Row row(int i); const Row row(int i) const; - + Column col(int i); const Column col(int i) const; - + Minor minor(int row, int col); const Minor minor(int row, int col) const; - + Block block(int startRow, int startCol, int blockRows, int blockCols); const Block block(int startRow, int startCol, int blockRows, int blockCols) const; - + Block block(int start, int size); const Block block(int start, int size) const; @@ -223,7 +223,7 @@ template class MatrixBase const DiagonalCoeffs diagonal() const; //@} - /// \name d - matrix transformation + /// \name matrix transformation //@{ template const Cast cast() const; @@ -231,23 +231,24 @@ template class MatrixBase Transpose transpose(); const Transpose transpose() const; - - const CwiseUnaryOp conjugate() const; - const Transpose > adjoint() const; + + const CwiseUnaryOp conjugate() const; + const Transpose > adjoint() const; const ScalarMultiple normalized() const; //@} - /// \name f - metrics (??) + // FIXME not sure about the following name + /// \name metrics //@{ Scalar trace() const; - + template Scalar dot(const MatrixBase& other) const; RealScalar norm2() const; RealScalar norm() const; //@} - + static const Eval > random(int rows, int cols); static const Eval > random(int size); static const Eval > random(); @@ -259,24 +260,24 @@ template class MatrixBase static const Ones ones(); static const Identity identity(); static const Identity identity(int rows, int cols); - + Derived& setZero(); Derived& setOnes(); Derived& setRandom(); Derived& setIdentity(); - - /// \name g - matrix diagnostic and comparison + + /// \name matrix diagnostic and comparison //@{ bool isZero(RealScalar prec = precision()) const; bool isOnes(RealScalar prec = precision()) const; bool isIdentity(RealScalar prec = precision()) const; bool isDiagonal(RealScalar prec = precision()) const; - + template bool isOrtho(const MatrixBase& other, RealScalar prec = precision()) const; bool isOrtho(RealScalar prec = precision()) const; - + template bool isApprox(const OtherDerived& other, RealScalar prec = precision()) const; @@ -286,10 +287,10 @@ template class MatrixBase bool isMuchSmallerThan(const MatrixBase& other, RealScalar prec = precision()) const; //@} - - /// \name e - arithemetic operators + + /// \name arithemetic operators //@{ - const CwiseUnaryOp operator-() const; + const CwiseUnaryOp operator-() const; template Derived& operator+=(const MatrixBase& other); @@ -306,38 +307,38 @@ template class MatrixBase friend const ScalarMultiple operator*(const Scalar& scalar, - const MatrixBase& matrix) - { return matrix*scalar; } + const MatrixBase& matrix) + { return matrix*scalar; } template const Product lazyProduct(const MatrixBase& other) const EIGEN_ALWAYS_INLINE; - const CwiseUnaryOp cwiseAbs() const; + const CwiseUnaryOp cwiseAbs() const; template - const CwiseBinaryOp + const CwiseBinaryOp cwiseProduct(const MatrixBase &other) const; template - const CwiseBinaryOp + const CwiseBinaryOp cwiseQuotient(const MatrixBase &other) const; //@} - /// \name b - coefficient accessors + /// \name coefficient accessors //@{ Scalar coeff(int row, int col) const; Scalar operator()(int row, int col) const; - + Scalar& coeffRef(int row, int col); Scalar& operator()(int row, int col); - + Scalar coeff(int index) const; Scalar operator[](int index) const; - + Scalar& coeffRef(int index); Scalar& operator[](int index); - + Scalar x() const; Scalar y() const; Scalar z() const; @@ -348,7 +349,7 @@ template class MatrixBase Scalar& w(); //@} - /// \name h - special functions + /// \name special functions //@{ const Eval eval() const EIGEN_ALWAYS_INLINE; diff --git a/Eigen/src/Core/MatrixRef.h b/Eigen/src/Core/MatrixRef.h index bfc8491bd..7cc1fd138 100644 --- a/Eigen/src/Core/MatrixRef.h +++ b/Eigen/src/Core/MatrixRef.h @@ -5,12 +5,12 @@ // // Eigen is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either +// License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // // Alternatively, 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 of +// published by the Free Software Foundation; either version 2 of // the License, or (at your option) any later version. // // Eigen is distributed in the hope that it will be useful, but WITHOUT ANY @@ -18,7 +18,7 @@ // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the // GNU General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public +// You should have received a copy of the GNU Lesser General Public // License and a copy of the GNU General Public License along with // Eigen. If not, see . @@ -31,8 +31,9 @@ template class MatrixRef public: typedef typename MatrixType::Scalar Scalar; friend class MatrixBase; + friend class MatrixBase::Traits; typedef MatrixBase Base; - + MatrixRef(const MatrixType& matrix) : m_matrix(matrix) {} ~MatrixRef() {} @@ -54,7 +55,7 @@ template class MatrixRef { return m_matrix._coeff(row, col); } - + Scalar& _coeffRef(int row, int col) { return const_cast(&m_matrix)->_coeffRef(row, col); diff --git a/Eigen/src/Core/Minor.h b/Eigen/src/Core/Minor.h index ae631ba41..b98f09707 100644 --- a/Eigen/src/Core/Minor.h +++ b/Eigen/src/Core/Minor.h @@ -5,12 +5,12 @@ // // Eigen is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either +// License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // // Alternatively, 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 of +// published by the Free Software Foundation; either version 2 of // the License, or (at your option) any later version. // // Eigen is distributed in the hope that it will be useful, but WITHOUT ANY @@ -18,7 +18,7 @@ // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the // GNU General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public +// You should have received a copy of the GNU Lesser General Public // License and a copy of the GNU General Public License along with // Eigen. If not, see . @@ -44,8 +44,9 @@ template class Minor typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::Ref MatRef; friend class MatrixBase; + friend class MatrixBase::Traits; typedef MatrixBase Base; - + Minor(const MatRef& matrix, int row, int col) : m_matrix(matrix), m_row(row), m_col(col) @@ -53,9 +54,9 @@ template class Minor assert(row >= 0 && row < matrix.rows() && col >= 0 && col < matrix.cols()); } - + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Minor) - + private: enum { RowsAtCompileTime = (MatrixType::Traits::RowsAtCompileTime != Dynamic) ? @@ -71,17 +72,17 @@ template class Minor const Minor& _ref() const { return *this; } int _rows() const { return m_matrix.rows() - 1; } int _cols() const { return m_matrix.cols() - 1; } - + Scalar& _coeffRef(int row, int col) { return m_matrix.coeffRef(row + (row >= m_row), col + (col >= m_col)); } - + Scalar _coeff(int row, int col) const { return m_matrix.coeff(row + (row >= m_row), col + (col >= m_col)); } - + protected: MatRef m_matrix; const int m_row, m_col; diff --git a/Eigen/src/Core/Ones.h b/Eigen/src/Core/Ones.h index 48b1156b1..e9131cd51 100644 --- a/Eigen/src/Core/Ones.h +++ b/Eigen/src/Core/Ones.h @@ -5,12 +5,12 @@ // // Eigen is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either +// License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // // Alternatively, 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 of +// published by the Free Software Foundation; either version 2 of // the License, or (at your option) any later version. // // Eigen is distributed in the hope that it will be useful, but WITHOUT ANY @@ -18,7 +18,7 @@ // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the // GNU General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public +// You should have received a copy of the GNU Lesser General Public // License and a copy of the GNU General Public License along with // Eigen. If not, see . @@ -38,6 +38,7 @@ template class Ones : NoOperatorEquals, public: typedef typename MatrixType::Scalar Scalar; friend class MatrixBase; + friend class MatrixBase::Traits; typedef MatrixBase Base; private: @@ -47,16 +48,16 @@ template class Ones : NoOperatorEquals, MaxRowsAtCompileTime = MatrixType::Traits::MaxRowsAtCompileTime, MaxColsAtCompileTime = MatrixType::Traits::MaxColsAtCompileTime }; - + const Ones& _ref() const { return *this; } int _rows() const { return m_rows.value(); } int _cols() const { return m_cols.value(); } - + Scalar _coeff(int, int) const { return static_cast(1); } - + public: Ones(int rows, int cols) : m_rows(rows), m_cols(cols) { @@ -65,7 +66,7 @@ template class Ones : NoOperatorEquals, && cols > 0 && (ColsAtCompileTime == Dynamic || ColsAtCompileTime == cols)); } - + protected: const IntAtRunTimeIfDynamic m_rows; const IntAtRunTimeIfDynamic m_cols; diff --git a/Eigen/src/Core/Product.h b/Eigen/src/Core/Product.h index f6204ed40..f41d887a5 100644 --- a/Eigen/src/Core/Product.h +++ b/Eigen/src/Core/Product.h @@ -5,12 +5,12 @@ // // Eigen is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either +// License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // // Alternatively, 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 of +// published by the Free Software Foundation; either version 2 of // the License, or (at your option) any later version. // // Eigen is distributed in the hope that it will be useful, but WITHOUT ANY @@ -18,7 +18,7 @@ // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the // GNU General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public +// You should have received a copy of the GNU Lesser General Public // License and a copy of the GNU General Public License along with // Eigen. If not, see . @@ -80,14 +80,15 @@ template class Product : NoOperatorEquals, typedef typename Lhs::Ref LhsRef; typedef typename Rhs::Ref RhsRef; friend class MatrixBase; + friend class MatrixBase::Traits; typedef MatrixBase Base; Product(const LhsRef& lhs, const RhsRef& rhs) - : m_lhs(lhs), m_rhs(rhs) + : m_lhs(lhs), m_rhs(rhs) { assert(lhs.cols() == rhs.rows()); } - + private: enum { RowsAtCompileTime = Lhs::Traits::RowsAtCompileTime, @@ -99,7 +100,7 @@ template class Product : NoOperatorEquals, const Product& _ref() const { return *this; } int _rows() const { return m_lhs.rows(); } int _cols() const { return m_rhs.cols(); } - + Scalar _coeff(int row, int col) const { Scalar res; @@ -117,7 +118,7 @@ template class Product : NoOperatorEquals, } return res; } - + protected: const LhsRef m_lhs; const RhsRef m_rhs; diff --git a/Eigen/src/Core/Random.h b/Eigen/src/Core/Random.h index aa24dd453..468216d56 100644 --- a/Eigen/src/Core/Random.h +++ b/Eigen/src/Core/Random.h @@ -5,12 +5,12 @@ // // Eigen is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either +// License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // // Alternatively, 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 of +// published by the Free Software Foundation; either version 2 of // the License, or (at your option) any later version. // // Eigen is distributed in the hope that it will be useful, but WITHOUT ANY @@ -18,7 +18,7 @@ // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the // GNU General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public +// You should have received a copy of the GNU Lesser General Public // License and a copy of the GNU General Public License along with // Eigen. If not, see . @@ -38,8 +38,9 @@ template class Random : NoOperatorEquals, public: typedef typename MatrixType::Scalar Scalar; friend class MatrixBase; + friend class MatrixBase::Traits; typedef MatrixBase Base; - + private: enum { RowsAtCompileTime = MatrixType::Traits::RowsAtCompileTime, @@ -47,16 +48,16 @@ template class Random : NoOperatorEquals, MaxRowsAtCompileTime = MatrixType::Traits::MaxRowsAtCompileTime, MaxColsAtCompileTime = MatrixType::Traits::MaxColsAtCompileTime }; - + const Random& _ref() const { return *this; } int _rows() const { return m_rows.value(); } int _cols() const { return m_cols.value(); } - + Scalar _coeff(int, int) const { return ei_random(); } - + public: Random(int rows, int cols) : m_rows(rows), m_cols(cols) { @@ -65,7 +66,7 @@ template class Random : NoOperatorEquals, && cols > 0 && (ColsAtCompileTime == Dynamic || ColsAtCompileTime == cols)); } - + protected: const IntAtRunTimeIfDynamic m_rows; const IntAtRunTimeIfDynamic m_cols; diff --git a/Eigen/src/Core/Row.h b/Eigen/src/Core/Row.h index 05ee45e72..4657e32db 100644 --- a/Eigen/src/Core/Row.h +++ b/Eigen/src/Core/Row.h @@ -5,12 +5,12 @@ // // Eigen is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either +// License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // // Alternatively, 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 of +// published by the Free Software Foundation; either version 2 of // the License, or (at your option) any later version. // // Eigen is distributed in the hope that it will be useful, but WITHOUT ANY @@ -18,7 +18,7 @@ // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the // GNU General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public +// You should have received a copy of the GNU Lesser General Public // License and a copy of the GNU General Public License along with // Eigen. If not, see . @@ -52,6 +52,7 @@ template class Row typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::Ref MatRef; friend class MatrixBase; + friend class MatrixBase::Traits; typedef MatrixBase Base; Row(const MatRef& matrix, int row) @@ -59,15 +60,15 @@ template class Row { assert(row >= 0 && row < matrix.rows()); } - + template Row& operator=(const MatrixBase& other) { return MatrixBase >::operator=(other); } - + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Row) - + private: enum { RowsAtCompileTime = 1, @@ -77,20 +78,20 @@ template class Row }; const Row& _ref() const { return *this; } - + int _rows() const { return 1; } int _cols() const { return m_matrix.cols(); } - + Scalar& _coeffRef(int, int col) { return m_matrix.coeffRef(m_row, col); } - + Scalar _coeff(int, int col) const { return m_matrix.coeff(m_row, col); } - + protected: MatRef m_matrix; const int m_row; diff --git a/Eigen/src/Core/ScalarMultiple.h b/Eigen/src/Core/ScalarMultiple.h index 5ea664994..29858cea9 100644 --- a/Eigen/src/Core/ScalarMultiple.h +++ b/Eigen/src/Core/ScalarMultiple.h @@ -5,12 +5,12 @@ // // Eigen is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either +// License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // // Alternatively, 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 of +// published by the Free Software Foundation; either version 2 of // the License, or (at your option) any later version. // // Eigen is distributed in the hope that it will be useful, but WITHOUT ANY @@ -18,7 +18,7 @@ // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the // GNU General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public +// You should have received a copy of the GNU Lesser General Public // License and a copy of the GNU General Public License along with // Eigen. If not, see . @@ -43,6 +43,7 @@ template class ScalarMultiple : NoOperatorEquals, typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::Ref MatRef; friend class MatrixBase; + friend class MatrixBase::Traits; typedef MatrixBase Base; ScalarMultiple(const MatRef& matrix, Scalar factor) @@ -70,37 +71,37 @@ template class ScalarMultiple : NoOperatorEquals, const Scalar m_factor; }; -/** relates MatrixBase sa class ScalarMultiple */ -template -const ScalarMultiple -MatrixBase::operator*(const Scalar& scalar) const -{ - return ScalarMultiple(ref(), scalar); -} - -/** \relates MatrixBase \sa class ScalarMultiple */ -template -const ScalarMultiple -MatrixBase::operator/(const Scalar& scalar) const -{ - assert(NumTraits::HasFloatingPoint); - return ScalarMultiple(ref(), static_cast(1) / scalar); +/** relates MatrixBase sa class ScalarMultiple */ +template +const ScalarMultiple +MatrixBase::operator*(const Scalar& scalar) const +{ + return ScalarMultiple(ref(), scalar); } - -/** \sa ScalarMultiple */ -template -Derived& -MatrixBase::operator*=(const Scalar& other) -{ - return *this = *this * other; -} - -/** \sa ScalarMultiple */ -template -Derived& -MatrixBase::operator/=(const Scalar& other) -{ - return *this = *this / other; + +/** \relates MatrixBase \sa class ScalarMultiple */ +template +const ScalarMultiple +MatrixBase::operator/(const Scalar& scalar) const +{ + assert(NumTraits::HasFloatingPoint); + return ScalarMultiple(ref(), static_cast(1) / scalar); +} + +/** \sa ScalarMultiple */ +template +Derived& +MatrixBase::operator*=(const Scalar& other) +{ + return *this = *this * other; +} + +/** \sa ScalarMultiple */ +template +Derived& +MatrixBase::operator/=(const Scalar& other) +{ + return *this = *this / other; } #endif // EIGEN_SCALARMULTIPLE_H diff --git a/Eigen/src/Core/Transpose.h b/Eigen/src/Core/Transpose.h index 5320ad522..3fbf87b0c 100644 --- a/Eigen/src/Core/Transpose.h +++ b/Eigen/src/Core/Transpose.h @@ -5,12 +5,12 @@ // // Eigen is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either +// License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // // Alternatively, 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 of +// published by the Free Software Foundation; either version 2 of // the License, or (at your option) any later version. // // Eigen is distributed in the hope that it will be useful, but WITHOUT ANY @@ -18,7 +18,7 @@ // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the // GNU General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public +// You should have received a copy of the GNU Lesser General Public // License and a copy of the GNU General Public License along with // Eigen. If not, see . @@ -44,12 +44,13 @@ template class Transpose typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::Ref MatRef; friend class MatrixBase; + friend class MatrixBase::Traits; typedef MatrixBase Base; - + Transpose(const MatRef& matrix) : m_matrix(matrix) {} - + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Transpose) - + private: enum { RowsAtCompileTime = MatrixType::Traits::ColsAtCompileTime, @@ -61,17 +62,17 @@ template class Transpose const Transpose& _ref() const { return *this; } int _rows() const { return m_matrix.cols(); } int _cols() const { return m_matrix.rows(); } - + Scalar& _coeffRef(int row, int col) { return m_matrix.coeffRef(col, row); } - + Scalar _coeff(int row, int col) const { return m_matrix.coeff(col, row); } - + protected: MatRef m_matrix; }; @@ -102,9 +103,9 @@ MatrixBase::transpose() const * Example: \include MatrixBase_adjoint.cpp * Output: \verbinclude MatrixBase_adjoint.out * - * \sa transpose(), conjugate(), class Transpose, class ConjugateOp */ + * \sa transpose(), conjugate(), class Transpose, class ScalarConjugateOp */ template -const Transpose > +const Transpose > MatrixBase::adjoint() const { return conjugate().transpose(); diff --git a/Eigen/src/Core/Zero.h b/Eigen/src/Core/Zero.h index 5ed4e4c9a..e152a6fc1 100644 --- a/Eigen/src/Core/Zero.h +++ b/Eigen/src/Core/Zero.h @@ -5,12 +5,12 @@ // // Eigen is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either +// License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // // Alternatively, 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 of +// published by the Free Software Foundation; either version 2 of // the License, or (at your option) any later version. // // Eigen is distributed in the hope that it will be useful, but WITHOUT ANY @@ -18,7 +18,7 @@ // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the // GNU General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public +// You should have received a copy of the GNU Lesser General Public // License and a copy of the GNU General Public License along with // Eigen. If not, see . @@ -38,8 +38,9 @@ template class Zero : NoOperatorEquals, public: typedef typename MatrixType::Scalar Scalar; friend class MatrixBase; + friend class MatrixBase::Traits; typedef MatrixBase Base; - + private: enum { RowsAtCompileTime = MatrixType::Traits::RowsAtCompileTime, @@ -51,12 +52,12 @@ template class Zero : NoOperatorEquals, const Zero& _ref() const { return *this; } int _rows() const { return m_rows.value(); } int _cols() const { return m_cols.value(); } - + Scalar _coeff(int, int) const { return static_cast(0); } - + public: Zero(int rows, int cols) : m_rows(rows), m_cols(cols) { @@ -65,7 +66,7 @@ template class Zero : NoOperatorEquals, && cols > 0 && (ColsAtCompileTime == Dynamic || ColsAtCompileTime == cols)); } - + protected: const IntAtRunTimeIfDynamic m_rows; const IntAtRunTimeIfDynamic m_cols; diff --git a/doc/Mainpage.dox b/doc/Mainpage.dox index 8dde22963..fea80519d 100644 --- a/doc/Mainpage.dox +++ b/doc/Mainpage.dox @@ -69,12 +69,10 @@ The To-do wiki for Eigen is here:

Compiler Support

-Eigen is standard C++98 and so should theoretically be compatible with any compliant compiler. Of course, in practice, things are slightly different. +Eigen is standard C++98 and so should theoretically be compatible with any compliant compiler. Of course, in practice, things might be slightly different. At least, Eigen is known to compile with any version of GCC from 3.3 to 4.3 as well as with recent versions of ICC. Eigen is well tested with recent versions of GCC and ICC. Both GCC 4.2 and ICC gives very good performance. ICC might provide even better performance when the auto-vectorization makes sense. For some reason the performance is not so great with GCC 4.1. -Eigen is also known to compile with GCC 3.4 and 4.0. However, these later ones seems to not correctly handle friend class with the CRT design pattern. Therefore, at the moment, for any GCC versions earlier than 4.1, all private members of Eigen's classes are made public. It is up to the user to take care to access public members only. - For best performance, we recommend the following compilation flags:
  • \b GCC: \c -O3 \c -DNDEBUG \c -finline-limit=10000 \c -falign-functions=64