Main MRPT website > C++ reference
MRPT logo

CommonCwiseBinaryOps.h

Go to the documentation of this file.
00001 // This file is part of Eigen, a lightweight C++ template library
00002 // for linear algebra.
00003 //
00004 // Copyright (C) 2008-2009 Gael Guennebaud <gael.guennebaud@inria.fr>
00005 // Copyright (C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com>
00006 //
00007 // Eigen is free software; you can redistribute it and/or
00008 // modify it under the terms of the GNU Lesser General Public
00009 // License as published by the Free Software Foundation; either
00010 // version 3 of the License, or (at your option) any later version.
00011 //
00012 // Alternatively, you can redistribute it and/or
00013 // modify it under the terms of the GNU General Public License as
00014 // published by the Free Software Foundation; either version 2 of
00015 // the License, or (at your option) any later version.
00016 //
00017 // Eigen is distributed in the hope that it will be useful, but WITHOUT ANY
00018 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00019 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the
00020 // GNU General Public License for more details.
00021 //
00022 // You should have received a copy of the GNU Lesser General Public
00023 // License and a copy of the GNU General Public License along with
00024 // Eigen. If not, see <http://www.gnu.org/licenses/>.
00025 
00026 // This file is a base class plugin containing common coefficient wise functions.
00027 
00028 /** \returns an expression of the difference of \c *this and \a other
00029   *
00030   * \note If you want to substract a given scalar from all coefficients, see Cwise::operator-().
00031   *
00032   * \sa class CwiseBinaryOp, operator-=()
00033   */
00034 EIGEN_MAKE_CWISE_BINARY_OP(operator-,internal::scalar_difference_op)
00035 
00036 /** \returns an expression of the sum of \c *this and \a other
00037   *
00038   * \note If you want to add a given scalar to all coefficients, see Cwise::operator+().
00039   *
00040   * \sa class CwiseBinaryOp, operator+=()
00041   */
00042 EIGEN_MAKE_CWISE_BINARY_OP(operator+,internal::scalar_sum_op)
00043 
00044 /** \returns an expression of a custom coefficient-wise operator \a func of *this and \a other
00045   *
00046   * The template parameter \a CustomBinaryOp is the type of the functor
00047   * of the custom operator (see class CwiseBinaryOp for an example)
00048   *
00049   * Here is an example illustrating the use of custom functors:
00050   * \include class_CwiseBinaryOp.cpp
00051   * Output: \verbinclude class_CwiseBinaryOp.out
00052   *
00053   * \sa class CwiseBinaryOp, operator+(), operator-(), cwiseProduct()
00054   */
00055 template<typename CustomBinaryOp, typename OtherDerived>
00056 EIGEN_STRONG_INLINE const CwiseBinaryOp<CustomBinaryOp, Derived, OtherDerived>
00057 binaryExpr(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other, const CustomBinaryOp& func = CustomBinaryOp()) const
00058 {
00059   return CwiseBinaryOp<CustomBinaryOp, Derived, OtherDerived>(derived(), other.derived(), func);
00060 }
00061 



Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN: at Sat Mar 26 06:16:28 UTC 2011