Chris@49: // Copyright (C) 2008-2010 NICTA (www.nicta.com.au) Chris@49: // Copyright (C) 2008-2010 Conrad Sanderson Chris@49: // Chris@49: // This Source Code Form is subject to the terms of the Mozilla Public Chris@49: // License, v. 2.0. If a copy of the MPL was not distributed with this Chris@49: // file, You can obtain one at http://mozilla.org/MPL/2.0/. Chris@49: Chris@49: Chris@49: //! \addtogroup operator_cube_schur Chris@49: //! @{ Chris@49: Chris@49: Chris@49: // operator %, which we define it to do a schur product (element-wise multiplication) Chris@49: Chris@49: Chris@49: //! element-wise multiplication of BaseCube objects with same element type Chris@49: template Chris@49: arma_inline Chris@49: const eGlueCube Chris@49: operator% Chris@49: ( Chris@49: const BaseCube& X, Chris@49: const BaseCube& Y Chris@49: ) Chris@49: { Chris@49: arma_extra_debug_sigprint(); Chris@49: Chris@49: return eGlueCube(X.get_ref(), Y.get_ref()); Chris@49: } Chris@49: Chris@49: Chris@49: Chris@49: //! element-wise multiplication of BaseCube objects with different element types Chris@49: template Chris@49: inline Chris@49: const mtGlueCube::result, T1, T2, glue_mixed_schur> Chris@49: operator% Chris@49: ( Chris@49: const BaseCube< typename force_different_type::T1_result, T1>& X, Chris@49: const BaseCube< typename force_different_type::T2_result, T2>& Y Chris@49: ) Chris@49: { Chris@49: arma_extra_debug_sigprint(); Chris@49: Chris@49: typedef typename T1::elem_type eT1; Chris@49: typedef typename T2::elem_type eT2; Chris@49: Chris@49: typedef typename promote_type::result out_eT; Chris@49: Chris@49: promote_type::check(); Chris@49: Chris@49: return mtGlueCube( X.get_ref(), Y.get_ref() ); Chris@49: } Chris@49: Chris@49: Chris@49: Chris@49: //! @}