* 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")
This commit is contained in:
Gael Guennebaud
2008-03-04 12:34:58 +00:00
parent 46885d33bf
commit f65cca5d1d
23 changed files with 248 additions and 240 deletions

View File

@@ -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/>.
@@ -37,6 +37,7 @@ template<typename MatrixType> class Identity : NoOperatorEquals,
public:
typedef typename MatrixType::Scalar Scalar;
friend class MatrixBase<Scalar, Identity>;
friend class MatrixBase<Scalar, Identity>::Traits;
typedef MatrixBase<Scalar, Identity> Base;
Identity(int rows, int cols) : m_rows(rows), m_cols(cols)
@@ -46,7 +47,7 @@ template<typename MatrixType> class Identity : NoOperatorEquals,
&& cols > 0
&& (ColsAtCompileTime == Dynamic || ColsAtCompileTime == cols));
}
private:
enum {
RowsAtCompileTime = MatrixType::Traits::RowsAtCompileTime,
@@ -54,16 +55,16 @@ template<typename MatrixType> 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<Scalar>(1) : static_cast<Scalar>(0);
}
protected:
const IntAtRunTimeIfDynamic<RowsAtCompileTime> m_rows;
const IntAtRunTimeIfDynamic<ColsAtCompileTime> m_cols;