aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Array
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2009-12-17 13:56:33 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2009-12-17 13:56:33 +0100
commit5ca90e1b0c031eb18ea2096eb2054a19d4e2e146 (patch)
treecadf98591238928f095200af1a72290bce3c4908 /Eigen/src/Array
parentebb28788292bc8e76a03044f64ea580b43e03bef (diff)
some cleaning in DenseStorageBase
Diffstat (limited to 'Eigen/src/Array')
-rw-r--r--Eigen/src/Array/Array.h33
-rw-r--r--Eigen/src/Array/Random.h28
2 files changed, 16 insertions, 45 deletions
diff --git a/Eigen/src/Array/Array.h b/Eigen/src/Array/Array.h
index ac2ae140d..0324a15a0 100644
--- a/Eigen/src/Array/Array.h
+++ b/Eigen/src/Array/Array.h
@@ -25,42 +25,13 @@
#ifndef EIGEN_ARRAY_H
#define EIGEN_ARRAY_H
-
-
-// template<typename MatrixType, typename OtherDerived, bool SwapPointers>
-// struct ei_matrix_swap_impl
-// {
-// static inline void run(MatrixType& matrix, MatrixBase<OtherDerived>& other)
-// {
-// matrix.base().swap(other);
-// }
-// };
-//
-// template<typename MatrixType, typename OtherDerived>
-// struct ei_matrix_swap_impl<MatrixType, OtherDerived, true>
-// {
-// static inline void run(MatrixType& matrix, MatrixBase<OtherDerived>& other)
-// {
-// matrix.m_storage.swap(other.derived().m_storage);
-// }
-// };
-
-// template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
-// template<typename OtherDerived>
-// inline void Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::swap(MatrixBase<OtherDerived> EIGEN_REF_TO_TEMPORARY other)
-// {
-// enum { SwapPointers = ei_is_same_type<Matrix, OtherDerived>::ret && Base::SizeAtCompileTime==Dynamic };
-// ei_matrix_swap_impl<Matrix, OtherDerived, bool(SwapPointers)>::run(*this, *const_cast<MatrixBase<OtherDerived>*>(&other));
-// }
-
-
template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
class Array
- : public DenseStorageBase<Array<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>, ArrayBase, _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>
+ : public DenseStorageBase<Array<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>, ArrayBase, _Options>
{
public:
- typedef DenseStorageBase<Array<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>, ArrayBase, _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> Base;
+ typedef DenseStorageBase<Array<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>, ArrayBase, _Options> Base;
_EIGEN_DENSE_PUBLIC_INTERFACE(Array)
enum { Options = _Options };
diff --git a/Eigen/src/Array/Random.h b/Eigen/src/Array/Random.h
index 2ef51d1d4..34b835776 100644
--- a/Eigen/src/Array/Random.h
+++ b/Eigen/src/Array/Random.h
@@ -136,13 +136,13 @@ inline Derived& DenseBase<Derived>::setRandom()
*
* \sa MatrixBase::setRandom(), setRandom(int,int), class CwiseNullaryOp, MatrixBase::Random()
*/
-// template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
-// EIGEN_STRONG_INLINE Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>&
-// Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::setRandom(int size)
-// {
-// resize(size);
-// return setRandom();
-// }
+template<typename Derived, template<typename> class _Base, int _Options>
+EIGEN_STRONG_INLINE Derived&
+DenseStorageBase<Derived,_Base,_Options>::setRandom(int size)
+{
+ resize(size);
+ return setRandom();
+}
/** Resizes to the given size, and sets all coefficients in this expression to random values.
*
@@ -154,12 +154,12 @@ inline Derived& DenseBase<Derived>::setRandom()
*
* \sa MatrixBase::setRandom(), setRandom(int), class CwiseNullaryOp, MatrixBase::Random()
*/
-// template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
-// EIGEN_STRONG_INLINE Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>&
-// Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::setRandom(int rows, int cols)
-// {
-// resize(rows, cols);
-// return setRandom();
-// }
+template<typename Derived, template<typename> class _Base, int _Options>
+EIGEN_STRONG_INLINE Derived&
+DenseStorageBase<Derived,_Base,_Options>::setRandom(int rows, int cols)
+{
+ resize(rows, cols);
+ return setRandom();
+}
#endif // EIGEN_RANDOM_H