op_dot_bones.hpp 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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 op_dot
  16. //! @{
  17. //! \brief
  18. //! dot product operation
  19. class op_dot
  20. : public traits_op_default
  21. {
  22. public:
  23. template<typename eT>
  24. arma_hot arma_inline static
  25. typename arma_not_cx<eT>::result
  26. direct_dot_arma(const uword n_elem, const eT* const A, const eT* const B);
  27. template<typename eT>
  28. arma_hot inline static
  29. typename arma_cx_only<eT>::result
  30. direct_dot_arma(const uword n_elem, const eT* const A, const eT* const B);
  31. template<typename eT>
  32. arma_hot inline static typename arma_real_only<eT>::result
  33. direct_dot(const uword n_elem, const eT* const A, const eT* const B);
  34. template<typename eT>
  35. arma_hot inline static typename arma_cx_only<eT>::result
  36. direct_dot(const uword n_elem, const eT* const A, const eT* const B);
  37. template<typename eT>
  38. arma_hot inline static typename arma_integral_only<eT>::result
  39. direct_dot(const uword n_elem, const eT* const A, const eT* const B);
  40. template<typename eT>
  41. arma_hot inline static eT direct_dot(const uword n_elem, const eT* const A, const eT* const B, const eT* C);
  42. template<typename T1, typename T2>
  43. arma_hot inline static typename T1::elem_type apply(const T1& X, const T2& Y);
  44. template<typename T1, typename T2>
  45. arma_hot inline static typename arma_not_cx<typename T1::elem_type>::result apply_proxy(const Proxy<T1>& PA, const Proxy<T2>& PB);
  46. template<typename T1, typename T2>
  47. arma_hot inline static typename arma_cx_only<typename T1::elem_type>::result apply_proxy(const Proxy<T1>& PA, const Proxy<T2>& PB);
  48. };
  49. //! \brief
  50. //! normalised dot product operation
  51. class op_norm_dot
  52. : public traits_op_default
  53. {
  54. public:
  55. template<typename T1, typename T2>
  56. arma_hot inline static typename T1::elem_type apply(const T1& X, const T2& Y);
  57. };
  58. //! \brief
  59. //! complex conjugate dot product operation
  60. class op_cdot
  61. : public traits_op_default
  62. {
  63. public:
  64. template<typename eT>
  65. arma_hot inline static eT direct_cdot_arma(const uword n_elem, const eT* const A, const eT* const B);
  66. template<typename eT>
  67. arma_hot inline static eT direct_cdot(const uword n_elem, const eT* const A, const eT* const B);
  68. template<typename T1, typename T2>
  69. arma_hot inline static typename T1::elem_type apply (const T1& X, const T2& Y);
  70. template<typename T1, typename T2>
  71. arma_hot inline static typename T1::elem_type apply_unwrap(const T1& X, const T2& Y);
  72. template<typename T1, typename T2>
  73. arma_hot inline static typename T1::elem_type apply_proxy (const T1& X, const T2& Y);
  74. };
  75. class op_dot_mixed
  76. : public traits_op_default
  77. {
  78. public:
  79. template<typename T1, typename T2>
  80. arma_hot inline static
  81. typename promote_type<typename T1::elem_type, typename T2::elem_type>::result
  82. apply(const T1& A, const T2& B);
  83. };
  84. //! @}