fn_symmat.hpp 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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_symmat
  16. //! @{
  17. template<typename T1>
  18. arma_warn_unused
  19. arma_inline
  20. typename enable_if2< is_cx<typename T1::elem_type>::no, const Op<T1, op_symmat> >::result
  21. symmatu(const Base<typename T1::elem_type,T1>& X, const bool do_conj = false)
  22. {
  23. arma_extra_debug_sigprint();
  24. arma_ignore(do_conj);
  25. return Op<T1, op_symmat>(X.get_ref(), 0, 0);
  26. }
  27. template<typename T1>
  28. arma_warn_unused
  29. arma_inline
  30. typename enable_if2< is_cx<typename T1::elem_type>::no, const Op<T1, op_symmat> >::result
  31. symmatl(const Base<typename T1::elem_type,T1>& X, const bool do_conj = false)
  32. {
  33. arma_extra_debug_sigprint();
  34. arma_ignore(do_conj);
  35. return Op<T1, op_symmat>(X.get_ref(), 1, 0);
  36. }
  37. template<typename T1>
  38. arma_warn_unused
  39. arma_inline
  40. typename enable_if2< is_cx<typename T1::elem_type>::yes, const Op<T1, op_symmat_cx> >::result
  41. symmatu(const Base<typename T1::elem_type,T1>& X, const bool do_conj = true)
  42. {
  43. arma_extra_debug_sigprint();
  44. return Op<T1, op_symmat_cx>(X.get_ref(), 0, (do_conj ? 1 : 0));
  45. }
  46. template<typename T1>
  47. arma_warn_unused
  48. arma_inline
  49. typename enable_if2< is_cx<typename T1::elem_type>::yes, const Op<T1, op_symmat_cx> >::result
  50. symmatl(const Base<typename T1::elem_type,T1>& X, const bool do_conj = true)
  51. {
  52. arma_extra_debug_sigprint();
  53. return Op<T1, op_symmat_cx>(X.get_ref(), 1, (do_conj ? 1 : 0));
  54. }
  55. //
  56. template<typename T1>
  57. arma_warn_unused
  58. arma_inline
  59. typename enable_if2< is_cx<typename T1::elem_type>::no, const SpOp<T1, spop_symmat> >::result
  60. symmatu(const SpBase<typename T1::elem_type,T1>& X, const bool do_conj = false)
  61. {
  62. arma_extra_debug_sigprint();
  63. arma_ignore(do_conj);
  64. return SpOp<T1, spop_symmat>(X.get_ref(), 0, 0);
  65. }
  66. template<typename T1>
  67. arma_warn_unused
  68. arma_inline
  69. typename enable_if2< is_cx<typename T1::elem_type>::no, const SpOp<T1, spop_symmat> >::result
  70. symmatl(const SpBase<typename T1::elem_type,T1>& X, const bool do_conj = false)
  71. {
  72. arma_extra_debug_sigprint();
  73. arma_ignore(do_conj);
  74. return SpOp<T1, spop_symmat>(X.get_ref(), 1, 0);
  75. }
  76. template<typename T1>
  77. arma_warn_unused
  78. arma_inline
  79. typename enable_if2< is_cx<typename T1::elem_type>::yes, const SpOp<T1, spop_symmat_cx> >::result
  80. symmatu(const SpBase<typename T1::elem_type,T1>& X, const bool do_conj = true)
  81. {
  82. arma_extra_debug_sigprint();
  83. return SpOp<T1, spop_symmat_cx>(X.get_ref(), 0, (do_conj ? 1 : 0));
  84. }
  85. template<typename T1>
  86. arma_warn_unused
  87. arma_inline
  88. typename enable_if2< is_cx<typename T1::elem_type>::yes, const SpOp<T1, spop_symmat_cx> >::result
  89. symmatl(const SpBase<typename T1::elem_type,T1>& X, const bool do_conj = true)
  90. {
  91. arma_extra_debug_sigprint();
  92. return SpOp<T1, spop_symmat_cx>(X.get_ref(), 1, (do_conj ? 1 : 0));
  93. }
  94. //! @}