aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Eigen/src/Core/Block.h14
-rw-r--r--Eigen/src/Core/Diagonal.h2
-rw-r--r--Eigen/src/Core/Transpose.h2
-rw-r--r--Eigen/src/Core/util/XprHelper.h40
-rw-r--r--Eigen/src/Sparse/SparseMatrix.h15
5 files changed, 9 insertions, 64 deletions
diff --git a/Eigen/src/Core/Block.h b/Eigen/src/Core/Block.h
index 99e0cdc1f..2b251bc2c 100644
--- a/Eigen/src/Core/Block.h
+++ b/Eigen/src/Core/Block.h
@@ -119,7 +119,7 @@ template<typename XprType, int BlockRows, int BlockCols, bool InnerPanel, bool H
/** Column or Row constructor
*/
- inline Block(typename internal::as_argument<XprType>::type xpr, Index i)
+ inline Block(XprType& xpr, Index i)
: m_xpr(xpr),
// It is a row if and only if BlockRows==1 and BlockCols==XprType::ColsAtCompileTime,
// and it is a column if and only if BlockRows==XprType::RowsAtCompileTime and BlockCols==1,
@@ -137,7 +137,7 @@ template<typename XprType, int BlockRows, int BlockCols, bool InnerPanel, bool H
/** Fixed-size constructor
*/
- inline Block(typename internal::as_argument<XprType>::type xpr, Index startRow, Index startCol)
+ inline Block(XprType& xpr, Index startRow, Index startCol)
: m_xpr(xpr), m_startRow(startRow), m_startCol(startCol),
m_blockRows(BlockRows), m_blockCols(BlockCols)
{
@@ -148,7 +148,7 @@ template<typename XprType, int BlockRows, int BlockCols, bool InnerPanel, bool H
/** Dynamic-size constructor
*/
- inline Block(typename internal::as_argument<XprType>::type xpr,
+ inline Block(XprType& xpr,
Index startRow, Index startCol,
Index blockRows, Index blockCols)
: m_xpr(xpr), m_startRow(startRow), m_startCol(startCol),
@@ -265,7 +265,7 @@ class Block<XprType,BlockRows,BlockCols, InnerPanel,true>
/** Column or Row constructor
*/
- inline Block(typename internal::as_argument<XprType>::type xpr, Index i)
+ inline Block(XprType& xpr, Index i)
: Base(internal::const_cast_ptr(&xpr.coeffRef(
(BlockRows==1) && (BlockCols==XprType::ColsAtCompileTime) ? i : 0,
(BlockRows==XprType::RowsAtCompileTime) && (BlockCols==1) ? i : 0)),
@@ -281,7 +281,7 @@ class Block<XprType,BlockRows,BlockCols, InnerPanel,true>
/** Fixed-size constructor
*/
- inline Block(typename internal::as_argument<XprType>::type xpr, Index startRow, Index startCol)
+ inline Block(XprType& xpr, Index startRow, Index startCol)
: Base(internal::const_cast_ptr(&xpr.coeffRef(startRow,startCol))), m_xpr(xpr)
{
eigen_assert(startRow >= 0 && BlockRows >= 1 && startRow + BlockRows <= xpr.rows()
@@ -291,7 +291,7 @@ class Block<XprType,BlockRows,BlockCols, InnerPanel,true>
/** Dynamic-size constructor
*/
- inline Block(typename internal::as_argument<XprType>::type xpr,
+ inline Block(XprType& xpr,
Index startRow, Index startCol,
Index blockRows, Index blockCols)
: Base(internal::const_cast_ptr(&xpr.coeffRef(startRow,startCol)), blockRows, blockCols),
@@ -326,7 +326,7 @@ class Block<XprType,BlockRows,BlockCols, InnerPanel,true>
#ifndef EIGEN_PARSED_BY_DOXYGEN
/** \internal used by allowAligned() */
- inline Block(typename internal::as_argument<XprType>::type xpr, const Scalar* data, Index blockRows, Index blockCols)
+ inline Block(XprType& xpr, const Scalar* data, Index blockRows, Index blockCols)
: Base(data, blockRows, blockCols), m_xpr(xpr)
{
init();
diff --git a/Eigen/src/Core/Diagonal.h b/Eigen/src/Core/Diagonal.h
index 0fa374101..e807a49e4 100644
--- a/Eigen/src/Core/Diagonal.h
+++ b/Eigen/src/Core/Diagonal.h
@@ -82,7 +82,7 @@ template<typename MatrixType, int DiagIndex> class Diagonal
typedef typename internal::dense_xpr_base<Diagonal>::type Base;
EIGEN_DENSE_PUBLIC_INTERFACE(Diagonal)
- inline Diagonal(typename internal::as_argument<MatrixType>::type matrix, Index index = DiagIndex) : m_matrix(matrix), m_index(index) {}
+ inline Diagonal(MatrixType& matrix, Index index = DiagIndex) : m_matrix(matrix), m_index(index) {}
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Diagonal)
diff --git a/Eigen/src/Core/Transpose.h b/Eigen/src/Core/Transpose.h
index 9f80fefd8..b521f9319 100644
--- a/Eigen/src/Core/Transpose.h
+++ b/Eigen/src/Core/Transpose.h
@@ -75,7 +75,7 @@ template<typename MatrixType> class Transpose
typedef typename TransposeImpl<MatrixType,typename internal::traits<MatrixType>::StorageKind>::Base Base;
EIGEN_GENERIC_PUBLIC_INTERFACE(Transpose)
- inline Transpose(typename internal::as_argument<MatrixType>::type matrix) : m_matrix(matrix) {}
+ inline Transpose(MatrixType& matrix) : m_matrix(matrix) {}
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Transpose)
diff --git a/Eigen/src/Core/util/XprHelper.h b/Eigen/src/Core/util/XprHelper.h
index 1c4d42461..9047c5f83 100644
--- a/Eigen/src/Core/util/XprHelper.h
+++ b/Eigen/src/Core/util/XprHelper.h
@@ -333,46 +333,6 @@ template<typename T, int n=1, typename PlainObject = typename eval<T>::type> str
>::type type;
};
-template<typename ExpressionType>
-struct as_argument
-{
- typedef typename nested<ExpressionType>::type type;
-};
-
-template<typename ExpressionType>
-struct as_argument<const ExpressionType>
-{
- typedef const typename nested<ExpressionType>::type type;
-};
-
-template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
-struct as_argument<Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
-{
- typedef Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> MatrixType;
- typedef MatrixType& type;
-};
-
-template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
-struct as_argument<const Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
-{
- typedef Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> MatrixType;
- typedef const MatrixType& type;
-};
-
-template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
-struct as_argument<Array<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
-{
- typedef Array<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> ArrayType;
- typedef ArrayType& type;
-};
-
-template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
-struct as_argument<const Array<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
-{
- typedef Array<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> ArrayType;
- typedef const ArrayType& type;
-};
-
template<typename T>
T* const_cast_ptr(const T* ptr)
{
diff --git a/Eigen/src/Sparse/SparseMatrix.h b/Eigen/src/Sparse/SparseMatrix.h
index 190979b44..f6b8407f7 100644
--- a/Eigen/src/Sparse/SparseMatrix.h
+++ b/Eigen/src/Sparse/SparseMatrix.h
@@ -62,21 +62,6 @@ struct traits<SparseMatrix<_Scalar, _Options, _Index> >
};
};
-
-template<typename _Scalar, int _Options, typename _Index>
-struct as_argument<SparseMatrix<_Scalar, _Options, _Index> >
-{
- typedef SparseMatrix<_Scalar, _Options, _Index> MatrixType;
- typedef MatrixType& type;
-};
-
-template<typename _Scalar, int _Options, typename _Index>
-struct as_argument<const SparseMatrix<_Scalar, _Options, _Index> >
-{
- typedef SparseMatrix<_Scalar, _Options, _Index> MatrixType;
- typedef const MatrixType& type;
-};
-
} // end namespace internal
template<typename _Scalar, int _Options, typename _Index>