![]() |
Eigen
3.3.3
|
00001 // This file is part of Eigen, a lightweight C++ template library 00002 // for linear algebra. 00003 // 00004 // Copyright (C) 2008-2016 Gael Guennebaud <gael.guennebaud@inria.fr> 00005 // Copyright (C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com> 00006 // 00007 // This Source Code Form is subject to the terms of the Mozilla 00008 // Public License v. 2.0. If a copy of the MPL was not distributed 00009 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 00010 00011 // This file is a base class plugin containing common coefficient wise functions. 00012 00019 EIGEN_MAKE_CWISE_BINARY_OP(operator-,difference) 00020 00021 00027 EIGEN_MAKE_CWISE_BINARY_OP(operator+,sum) 00028 00040 template<typename CustomBinaryOp, typename OtherDerived> 00041 EIGEN_DEVICE_FUNC 00042 EIGEN_STRONG_INLINE const CwiseBinaryOp<CustomBinaryOp, const Derived, const OtherDerived> 00043 binaryExpr(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other, const CustomBinaryOp& func = CustomBinaryOp()) const 00044 { 00045 return CwiseBinaryOp<CustomBinaryOp, const Derived, const OtherDerived>(derived(), other.derived(), func); 00046 } 00047 00048 00049 #ifndef EIGEN_PARSED_BY_DOXYGEN 00050 EIGEN_MAKE_SCALAR_BINARY_OP(operator*,product) 00051 #else 00052 00056 template<typename T> 00057 const CwiseBinaryOp<internal::scalar_product_op<Scalar,T>,Derived,Constant<T> > operator*(const T& scalar) const; 00062 template<typename T> friend 00063 const CwiseBinaryOp<internal::scalar_product_op<T,Scalar>,Constant<T>,Derived> operator*(const T& scalar, const StorageBaseType& expr); 00064 #endif 00065 00066 00067 00068 #ifndef EIGEN_PARSED_BY_DOXYGEN 00069 EIGEN_MAKE_SCALAR_BINARY_OP_ONTHERIGHT(operator/,quotient) 00070 #else 00071 00075 template<typename T> 00076 const CwiseBinaryOp<internal::scalar_quotient_op<Scalar,T>,Derived,Constant<T> > operator/(const T& scalar) const; 00077 #endif 00078 00088 template<typename OtherDerived> 00089 EIGEN_DEVICE_FUNC 00090 inline const CwiseBinaryOp<internal::scalar_boolean_and_op, const Derived, const OtherDerived> 00091 operator&&(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const 00092 { 00093 EIGEN_STATIC_ASSERT((internal::is_same<bool,Scalar>::value && internal::is_same<bool,typename OtherDerived::Scalar>::value), 00094 THIS_METHOD_IS_ONLY_FOR_EXPRESSIONS_OF_BOOL); 00095 return CwiseBinaryOp<internal::scalar_boolean_and_op, const Derived, const OtherDerived>(derived(),other.derived()); 00096 } 00097 00107 template<typename OtherDerived> 00108 EIGEN_DEVICE_FUNC 00109 inline const CwiseBinaryOp<internal::scalar_boolean_or_op, const Derived, const OtherDerived> 00110 operator||(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const 00111 { 00112 EIGEN_STATIC_ASSERT((internal::is_same<bool,Scalar>::value && internal::is_same<bool,typename OtherDerived::Scalar>::value), 00113 THIS_METHOD_IS_ONLY_FOR_EXPRESSIONS_OF_BOOL); 00114 return CwiseBinaryOp<internal::scalar_boolean_or_op, const Derived, const OtherDerived>(derived(),other.derived()); 00115 }