// Copyright (C) 2008-2013 National ICT Australia (NICTA) // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. // ------------------------------------------------------------------- // // Written by Conrad Sanderson - http://conradsanderson.id.au //! \addtogroup glue_times //! @{ //! \brief //! Template metaprogram depth_lhs //! calculates the number of Glue instances on the left hand side argument of Glue //! i.e. it recursively expands each Tx, until the type of Tx is not "Glue<..,.., glue_type>" (i.e the "glue_type" changes) template struct depth_lhs { static const uword num = 0; }; template struct depth_lhs< glue_type, Glue > { static const uword num = 1 + depth_lhs::num; }; template struct glue_times_redirect2_helper { template arma_hot inline static void apply(Mat& out, const Glue& X); }; template<> struct glue_times_redirect2_helper { template arma_hot inline static void apply(Mat& out, const Glue& X); }; template struct glue_times_redirect3_helper { template arma_hot inline static void apply(Mat& out, const Glue< Glue,T3,glue_times>& X); }; template<> struct glue_times_redirect3_helper { template arma_hot inline static void apply(Mat& out, const Glue< Glue,T3,glue_times>& X); }; template struct glue_times_redirect { template arma_hot inline static void apply(Mat& out, const Glue& X); }; template<> struct glue_times_redirect<2> { template arma_hot inline static void apply(Mat& out, const Glue& X); }; template<> struct glue_times_redirect<3> { template arma_hot inline static void apply(Mat& out, const Glue< Glue,T3,glue_times>& X); }; template<> struct glue_times_redirect<4> { template arma_hot inline static void apply(Mat& out, const Glue< Glue< Glue, T3, glue_times>, T4, glue_times>& X); }; //! Class which implements the immediate multiplication of two or more matrices class glue_times { public: template arma_hot inline static void apply(Mat& out, const Glue& X); template arma_hot inline static void apply_inplace(Mat& out, const T1& X); template arma_hot inline static void apply_inplace_plus(Mat& out, const Glue& X, const sword sign); // template arma_inline static uword mul_storage_cost(const TA& A, const TB& B); template arma_hot inline static void apply(Mat& out, const TA& A, const TB& B, const eT val); template arma_hot inline static void apply(Mat& out, const TA& A, const TB& B, const TC& C, const eT val); template arma_hot inline static void apply(Mat& out, const TA& A, const TB& B, const TC& C, const TD& D, const eT val); }; class glue_times_diag { public: template arma_hot inline static void apply(Mat& out, const Glue& X); }; //! @}