From f65cca5d1d28cff4880026d48a9e95b279bed3e3 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Tue, 4 Mar 2008 12:34:58 +0000 Subject: * Eigen compiles with any GCC versions from, at least, 3.3 without the previous ugly hack :) * Renamed the scalar functors with the "Scalar" prefix (instead of "Cwise") --- Eigen/src/Core/Random.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'Eigen/src/Core/Random.h') 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; -- cgit v1.2.3