eOpCube_meat.hpp 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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 eOpCube
  16. //! @{
  17. template<typename T1, typename eop_type>
  18. inline
  19. eOpCube<T1, eop_type>::eOpCube(const BaseCube<typename T1::elem_type, T1>& in_m)
  20. : P (in_m.get_ref())
  21. {
  22. arma_extra_debug_sigprint();
  23. }
  24. template<typename T1, typename eop_type>
  25. inline
  26. eOpCube<T1, eop_type>::eOpCube(const BaseCube<typename T1::elem_type, T1>& in_m, const typename T1::elem_type in_aux)
  27. : P (in_m.get_ref())
  28. , aux (in_aux)
  29. {
  30. arma_extra_debug_sigprint();
  31. }
  32. template<typename T1, typename eop_type>
  33. inline
  34. eOpCube<T1, eop_type>::eOpCube(const BaseCube<typename T1::elem_type, T1>& in_m, const uword in_aux_uword_a, const uword in_aux_uword_b)
  35. : P (in_m.get_ref())
  36. , aux_uword_a (in_aux_uword_a)
  37. , aux_uword_b (in_aux_uword_b)
  38. {
  39. arma_extra_debug_sigprint();
  40. }
  41. template<typename T1, typename eop_type>
  42. inline
  43. eOpCube<T1, eop_type>::eOpCube(const BaseCube<typename T1::elem_type, T1>& in_m, const uword in_aux_uword_a, const uword in_aux_uword_b, const uword in_aux_uword_c)
  44. : P (in_m.get_ref())
  45. , aux_uword_a (in_aux_uword_a)
  46. , aux_uword_b (in_aux_uword_b)
  47. , aux_uword_c (in_aux_uword_c)
  48. {
  49. arma_extra_debug_sigprint();
  50. }
  51. template<typename T1, typename eop_type>
  52. inline
  53. eOpCube<T1, eop_type>::eOpCube(const BaseCube<typename T1::elem_type, T1>& in_m, const typename T1::elem_type in_aux, const uword in_aux_uword_a, const uword in_aux_uword_b, const uword in_aux_uword_c)
  54. : P (in_m.get_ref())
  55. , aux (in_aux)
  56. , aux_uword_a (in_aux_uword_a)
  57. , aux_uword_b (in_aux_uword_b)
  58. , aux_uword_c (in_aux_uword_c)
  59. {
  60. arma_extra_debug_sigprint();
  61. }
  62. template<typename T1, typename eop_type>
  63. inline
  64. eOpCube<T1, eop_type>::~eOpCube()
  65. {
  66. arma_extra_debug_sigprint();
  67. }
  68. template<typename T1, typename eop_type>
  69. arma_inline
  70. uword
  71. eOpCube<T1, eop_type>::get_n_rows() const
  72. {
  73. return P.get_n_rows();
  74. }
  75. template<typename T1, typename eop_type>
  76. arma_inline
  77. uword
  78. eOpCube<T1, eop_type>::get_n_cols() const
  79. {
  80. return P.get_n_cols();
  81. }
  82. template<typename T1, typename eop_type>
  83. arma_inline
  84. uword
  85. eOpCube<T1, eop_type>::get_n_elem_slice() const
  86. {
  87. return P.get_n_elem_slice();
  88. }
  89. template<typename T1, typename eop_type>
  90. arma_inline
  91. uword
  92. eOpCube<T1, eop_type>::get_n_slices() const
  93. {
  94. return P.get_n_slices();
  95. }
  96. template<typename T1, typename eop_type>
  97. arma_inline
  98. uword
  99. eOpCube<T1, eop_type>::get_n_elem() const
  100. {
  101. return P.get_n_elem();
  102. }
  103. template<typename T1, typename eop_type>
  104. arma_inline
  105. typename T1::elem_type
  106. eOpCube<T1, eop_type>::operator[] (const uword i) const
  107. {
  108. return eop_core<eop_type>::process(P[i], aux);
  109. }
  110. template<typename T1, typename eop_type>
  111. arma_inline
  112. typename T1::elem_type
  113. eOpCube<T1, eop_type>::at(const uword row, const uword col, const uword slice) const
  114. {
  115. return eop_core<eop_type>::process(P.at(row, col, slice), aux);
  116. }
  117. template<typename T1, typename eop_type>
  118. arma_inline
  119. typename T1::elem_type
  120. eOpCube<T1, eop_type>::at_alt(const uword i) const
  121. {
  122. return eop_core<eop_type>::process(P.at_alt(i), aux);
  123. }
  124. //! @}