spglue_times_bones.hpp 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
  2. // Copyright 2008-2016 National ICT Australia (NICTA)
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. // ------------------------------------------------------------------------
  15. //! \addtogroup spglue_times
  16. //! @{
  17. class spglue_times
  18. {
  19. public:
  20. template<typename T1, typename T2>
  21. struct traits
  22. {
  23. static const bool is_row = T1::is_row;
  24. static const bool is_col = T2::is_col;
  25. static const bool is_xvec = false;
  26. };
  27. template<typename T1, typename T2>
  28. inline static void apply(SpMat<typename T1::elem_type>& out, const SpGlue<T1,T2,spglue_times>& X);
  29. template<typename T1, typename T2>
  30. inline static void apply(SpMat<typename T1::elem_type>& out, const SpGlue<SpOp<T1,spop_scalar_times>,T2,spglue_times>& X);
  31. template<typename eT>
  32. arma_hot inline static void apply_noalias(SpMat<eT>& c, const SpMat<eT>& x, const SpMat<eT>& y);
  33. };
  34. class spglue_times_misc
  35. {
  36. public:
  37. template<typename T1, typename T2>
  38. struct traits
  39. {
  40. static const bool is_row = T1::is_row;
  41. static const bool is_col = T2::is_col;
  42. static const bool is_xvec = false;
  43. };
  44. template<typename T1, typename T2>
  45. inline static void sparse_times_dense(Mat<typename T1::elem_type>& out, const T1& x, const T2& y);
  46. template<typename T1, typename T2>
  47. inline static void dense_times_sparse(Mat<typename T1::elem_type>& out, const T1& x, const T2& y);
  48. };
  49. class spglue_times_mixed
  50. {
  51. public:
  52. template<typename T1, typename T2>
  53. struct traits
  54. {
  55. static const bool is_row = T1::is_row;
  56. static const bool is_col = T2::is_col;
  57. static const bool is_xvec = false;
  58. };
  59. template<typename T1, typename T2>
  60. inline static void apply(SpMat<typename eT_promoter<T1,T2>::eT>& out, const mtSpGlue<typename eT_promoter<T1,T2>::eT, T1, T2, spglue_times_mixed>& expr);
  61. template<typename T1, typename T2>
  62. inline static void sparse_times_dense(Mat< typename promote_type<typename T1::elem_type, typename T2::elem_type>::result >& out, const T1& X, const T2& Y);
  63. template<typename T1, typename T2>
  64. inline static void dense_times_sparse(Mat< typename promote_type<typename T1::elem_type, typename T2::elem_type>::result >& out, const T1& X, const T2& Y);
  65. };
  66. //! @}