diff options
author | Gael Guennebaud <g.gael@free.fr> | 2008-03-04 12:34:58 +0000 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2008-03-04 12:34:58 +0000 |
commit | f65cca5d1d28cff4880026d48a9e95b279bed3e3 (patch) | |
tree | 33b8efd96071734e14fd83bdbc2886d4e76550b3 /Eigen/src/Core/Random.h | |
parent | 46885d33bfd6cdcf3040923a4aef1b059684b854 (diff) |
* 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")
Diffstat (limited to 'Eigen/src/Core/Random.h')
-rw-r--r-- | Eigen/src/Core/Random.h | 17 |
1 files changed, 9 insertions, 8 deletions
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 <http://www.gnu.org/licenses/>. @@ -38,8 +38,9 @@ template<typename MatrixType> class Random : NoOperatorEquals, public: typedef typename MatrixType::Scalar Scalar; friend class MatrixBase<Scalar, Random>; + friend class MatrixBase<Scalar, Random>::Traits; typedef MatrixBase<Scalar, Random> Base; - + private: enum { RowsAtCompileTime = MatrixType::Traits::RowsAtCompileTime, @@ -47,16 +48,16 @@ template<typename MatrixType> 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<Scalar>(); } - + public: Random(int rows, int cols) : m_rows(rows), m_cols(cols) { @@ -65,7 +66,7 @@ template<typename MatrixType> class Random : NoOperatorEquals, && cols > 0 && (ColsAtCompileTime == Dynamic || ColsAtCompileTime == cols)); } - + protected: const IntAtRunTimeIfDynamic<RowsAtCompileTime> m_rows; const IntAtRunTimeIfDynamic<ColsAtCompileTime> m_cols; |