// This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // // Copyright (C) 2008 Gael Guennebaud // // 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 // 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 // the License, or (at your option) any later version. // // Eigen is distributed in the hope that it will be useful, but WITHOUT ANY // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS // 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 // License and a copy of the GNU General Public License along with // Eigen. If not, see . #ifndef EIGEN_ARRAY_CWISE_OPERATORS_H #define EIGEN_ARRAY_CWISE_OPERATORS_H // -- unary operators -- /** \returns an expression of the coefficient-wise square root of *this. */ template inline const CwiseUnaryOp::Scalar>, Derived> MatrixBase::cwiseSqrt() const { return derived(); } /** \returns an expression of the coefficient-wise exponential of *this. */ template inline const CwiseUnaryOp::Scalar>, Derived> MatrixBase::cwiseExp() const { return derived(); } /** \returns an expression of the coefficient-wise logarithm of *this. */ template inline const CwiseUnaryOp::Scalar>, Derived> MatrixBase::cwiseLog() const { return derived(); } /** \returns an expression of the coefficient-wise cosine of *this. */ template inline const CwiseUnaryOp::Scalar>, Derived> MatrixBase::cwiseCos() const { return derived(); } /** \returns an expression of the coefficient-wise sine of *this. */ template inline const CwiseUnaryOp::Scalar>, Derived> MatrixBase::cwiseSin() const { return derived(); } /** \returns an expression of the coefficient-wise power of *this to the given exponent. */ template inline const CwiseUnaryOp::Scalar>, Derived> MatrixBase::cwisePow(const Scalar& exponent) const { return CwiseUnaryOp, Derived> (derived(), ei_scalar_pow_op(exponent)); } // -- binary operators -- /** \returns an expression of the coefficient-wise \< operator of *this and \a other * * \sa class CwiseBinaryOp */ template template inline const CwiseBinaryOp::Scalar>, Derived, OtherDerived> MatrixBase::cwiseLessThan(const MatrixBase &other) const { return cwise(other, std::less()); } /** \returns an expression of the coefficient-wise \<= operator of *this and \a other * * \sa class CwiseBinaryOp */ template template inline const CwiseBinaryOp::Scalar>, Derived, OtherDerived> MatrixBase::cwiseLessEqual(const MatrixBase &other) const { return cwise(other, std::less_equal()); } /** \returns an expression of the coefficient-wise \> operator of *this and \a other * * \sa class CwiseBinaryOp */ template template inline const CwiseBinaryOp::Scalar>, Derived, OtherDerived> MatrixBase::cwiseGreaterThan(const MatrixBase &other) const { return cwise(other, std::greater()); } /** \returns an expression of the coefficient-wise \>= operator of *this and \a other * * \sa class CwiseBinaryOp */ template template inline const CwiseBinaryOp::Scalar>, Derived, OtherDerived> MatrixBase::cwiseGreaterEqual(const MatrixBase &other) const { return cwise(other, std::greater_equal()); } /** \returns an expression of the coefficient-wise == operator of *this and \a other * * \sa class CwiseBinaryOp */ template template inline const CwiseBinaryOp::Scalar>, Derived, OtherDerived> MatrixBase::cwiseEqualTo(const MatrixBase &other) const { return cwise(other, std::equal_to()); } /** \returns an expression of the coefficient-wise != operator of *this and \a other * * \sa class CwiseBinaryOp */ template template inline const CwiseBinaryOp::Scalar>, Derived, OtherDerived> MatrixBase::cwiseNotEqualTo(const MatrixBase &other) const { return cwise(other, std::not_equal_to()); } #endif // EIGEN_ARRAY_CWISE_OPERATORS_H