* coefficient wise operators are more generic, with controllable result type.

- compatible with current STL's functors as well as with the extention proposal (TR1)
 * thanks to the above, Cast and ScalarMultiple have been removed
 * benchmark_suite is more flexible (compiler and matrix size)
This commit is contained in:
Gael Guennebaud
2008-03-06 11:36:27 +00:00
parent 8e0d548039
commit 138aad0ed0
17 changed files with 257 additions and 338 deletions

View File

@@ -227,7 +227,8 @@ template<typename Scalar, typename Derived> class MatrixBase
/// \name matrix transformation
//@{
template<typename NewScalar> const Cast<NewScalar, Derived> cast() const;
template<typename NewType>
const CwiseUnaryOp<ScalarCastOp<NewType>, Derived> cast() const;
const DiagonalMatrix<Derived> asDiagonal() const;
@@ -237,7 +238,7 @@ template<typename Scalar, typename Derived> class MatrixBase
const CwiseUnaryOp<ScalarConjugateOp, Derived> conjugate() const;
const Transpose<CwiseUnaryOp<ScalarConjugateOp, Derived> > adjoint() const;
const ScalarMultiple<Derived> normalized() const;
const CwiseUnaryOp<ScalarMultipleOp<Scalar>, Derived> normalized() const;
//@}
// FIXME not sure about the following name
@@ -304,12 +305,11 @@ template<typename Scalar, typename Derived> class MatrixBase
Derived& operator*=(const Scalar& other);
Derived& operator/=(const Scalar& other);
const ScalarMultiple<Derived> operator*(const Scalar& scalar) const;
const ScalarMultiple<Derived> operator/(const Scalar& scalar) const;
const CwiseUnaryOp<ScalarMultipleOp<Scalar>, Derived> operator*(const Scalar& scalar) const;
const CwiseUnaryOp<ScalarMultipleOp<Scalar>, Derived> operator/(const Scalar& scalar) const;
friend
const ScalarMultiple<Derived> operator*(const Scalar& scalar,
const MatrixBase& matrix)
friend const CwiseUnaryOp<ScalarMultipleOp<Scalar>, Derived>
operator*(const Scalar& scalar, const MatrixBase& matrix)
{ return matrix*scalar; }
template<typename OtherDerived>
@@ -356,11 +356,11 @@ template<typename Scalar, typename Derived> class MatrixBase
const Eval<Derived> eval() const EIGEN_ALWAYS_INLINE;
template<typename CustomUnaryOp>
const CwiseUnaryOp<CustomUnaryOp, Derived> cwise() const;
const CwiseUnaryOp<CustomUnaryOp, Derived> cwise(const CustomUnaryOp& func = CustomUnaryOp()) const;
template<typename CustomBinaryOp, typename OtherDerived>
const CwiseBinaryOp<CustomBinaryOp, Derived, OtherDerived>
cwise(const MatrixBase<Scalar, OtherDerived> &other) const;
cwise(const MatrixBase<Scalar, OtherDerived> &other, const CustomBinaryOp& func = CustomBinaryOp()) const;
//@}
/** puts in *row and *col the location of the coefficient of *this