op_htrans_bones.hpp 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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_htrans
  16. //! @{
  17. //! 'hermitian transpose' operation
  18. class op_htrans
  19. {
  20. public:
  21. template<typename T1>
  22. struct traits
  23. {
  24. static const bool is_row = T1::is_col; // deliberately swapped
  25. static const bool is_col = T1::is_row;
  26. static const bool is_xvec = T1::is_xvec;
  27. };
  28. template<typename eT>
  29. arma_hot arma_inline static void apply_mat_noalias(Mat<eT>& out, const Mat<eT>& A, const typename arma_not_cx<eT>::result* junk = 0);
  30. template<typename eT>
  31. arma_hot inline static void apply_mat_noalias(Mat<eT>& out, const Mat<eT>& A, const typename arma_cx_only<eT>::result* junk = 0);
  32. //
  33. template<typename T>
  34. arma_hot inline static void block_worker(std::complex<T>* Y, const std::complex<T>* X, const uword X_n_rows, const uword Y_n_rows, const uword n_rows, const uword n_cols);
  35. template<typename T>
  36. arma_hot inline static void apply_mat_noalias_large(Mat< std::complex<T> >& out, const Mat< std::complex<T> >& A);
  37. //
  38. template<typename eT>
  39. arma_hot arma_inline static void apply_mat_inplace(Mat<eT>& out, const typename arma_not_cx<eT>::result* junk = 0);
  40. template<typename eT>
  41. arma_hot inline static void apply_mat_inplace(Mat<eT>& out, const typename arma_cx_only<eT>::result* junk = 0);
  42. //
  43. template<typename eT>
  44. arma_hot arma_inline static void apply_mat(Mat<eT>& out, const Mat<eT>& A, const typename arma_not_cx<eT>::result* junk = 0);
  45. template<typename eT>
  46. arma_hot inline static void apply_mat(Mat<eT>& out, const Mat<eT>& A, const typename arma_cx_only<eT>::result* junk = 0);
  47. //
  48. template<typename T1>
  49. arma_hot inline static void apply_proxy(Mat<typename T1::elem_type>& out, const T1& X);
  50. //
  51. template<typename T1>
  52. arma_hot inline static void apply_direct(Mat<typename T1::elem_type>& out, const T1& X);
  53. template<typename T1>
  54. arma_hot inline static void apply(Mat<typename T1::elem_type>& out, const Op<T1,op_htrans>& in, const typename arma_not_cx<typename T1::elem_type>::result* junk = 0);
  55. template<typename T1>
  56. arma_hot inline static void apply(Mat<typename T1::elem_type>& out, const Op<T1,op_htrans>& in, const typename arma_cx_only<typename T1::elem_type>::result* junk = 0);
  57. //
  58. template<typename T1>
  59. arma_hot inline static void apply(Mat<typename T1::elem_type>& out, const Op< Op<T1, op_trimat>, op_htrans>& in);
  60. };
  61. class op_htrans2
  62. {
  63. public:
  64. template<typename T1>
  65. struct traits
  66. {
  67. static const bool is_row = T1::is_col; // deliberately swapped
  68. static const bool is_col = T1::is_row;
  69. static const bool is_xvec = T1::is_xvec;
  70. };
  71. template<typename T1>
  72. inline static void apply(Mat<typename T1::elem_type>& out, const Op<T1,op_htrans2>& in, const typename arma_not_cx<typename T1::elem_type>::result* junk = 0);
  73. template<typename T1>
  74. inline static void apply(Mat<typename T1::elem_type>& out, const Op<T1,op_htrans2>& in, const typename arma_cx_only<typename T1::elem_type>::result* junk = 0);
  75. };
  76. //! @}