fn_strans.hpp 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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 fn_strans
  16. //! @{
  17. template<typename T1>
  18. arma_warn_unused
  19. arma_inline
  20. const Op<T1, op_strans>
  21. strans
  22. (
  23. const T1& X,
  24. const typename enable_if< is_arma_type<T1>::value == true >::result* junk1 = 0,
  25. const typename arma_cx_only<typename T1::elem_type>::result* junk2 = 0
  26. )
  27. {
  28. arma_extra_debug_sigprint();
  29. arma_ignore(junk1);
  30. arma_ignore(junk2);
  31. return Op<T1, op_strans>(X);
  32. }
  33. // NOTE: for non-complex objects, deliberately returning op_htrans instead of op_strans,
  34. // NOTE: due to currently more optimisations available when using op_htrans, especially by glue_times
  35. template<typename T1>
  36. arma_warn_unused
  37. arma_inline
  38. const Op<T1, op_htrans>
  39. strans
  40. (
  41. const T1& X,
  42. const typename enable_if< is_arma_type<T1>::value == true >::result* junk1 = 0,
  43. const typename arma_not_cx<typename T1::elem_type>::result* junk2 = 0
  44. )
  45. {
  46. arma_extra_debug_sigprint();
  47. arma_ignore(junk1);
  48. arma_ignore(junk2);
  49. return Op<T1, op_htrans>(X);
  50. }
  51. //
  52. // handling of sparse matrices
  53. template<typename T1>
  54. arma_warn_unused
  55. arma_inline
  56. const SpOp<T1, spop_strans>
  57. strans
  58. (
  59. const T1& X,
  60. const typename enable_if< is_arma_sparse_type<T1>::value == true >::result* junk1 = 0,
  61. const typename arma_cx_only<typename T1::elem_type>::result* junk2 = 0
  62. )
  63. {
  64. arma_extra_debug_sigprint();
  65. arma_ignore(junk1);
  66. arma_ignore(junk2);
  67. return SpOp<T1, spop_strans>(X);
  68. }
  69. template<typename T1>
  70. arma_warn_unused
  71. arma_inline
  72. const SpOp<T1, spop_htrans>
  73. strans
  74. (
  75. const T1& X,
  76. const typename enable_if< is_arma_sparse_type<T1>::value == true >::result* junk1 = 0,
  77. const typename arma_not_cx<typename T1::elem_type>::result* junk2 = 0
  78. )
  79. {
  80. arma_extra_debug_sigprint();
  81. arma_ignore(junk1);
  82. arma_ignore(junk2);
  83. return SpOp<T1, spop_htrans>(X);
  84. }
  85. //! @}