spop_misc_bones.hpp 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  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 spop_misc
  16. //! @{
  17. class spop_scalar_times
  18. : public traits_op_passthru
  19. {
  20. public:
  21. template<typename T1>
  22. inline static void apply(SpMat<typename T1::elem_type>& out, const SpOp<T1, spop_scalar_times>& in);
  23. };
  24. class spop_cx_scalar_times
  25. : public traits_op_passthru
  26. {
  27. public:
  28. template<typename T1>
  29. inline static void apply(SpMat< std::complex<typename T1::pod_type> >& out, const mtSpOp< std::complex<typename T1::pod_type>, T1, spop_cx_scalar_times>& in);
  30. };
  31. class spop_square
  32. : public traits_op_passthru
  33. {
  34. public:
  35. template<typename T1>
  36. inline static void apply(SpMat<typename T1::elem_type>& out, const SpOp<T1, spop_square>& in);
  37. };
  38. class spop_sqrt
  39. : public traits_op_passthru
  40. {
  41. public:
  42. template<typename T1>
  43. inline static void apply(SpMat<typename T1::elem_type>& out, const SpOp<T1, spop_sqrt>& in);
  44. };
  45. class spop_abs
  46. : public traits_op_passthru
  47. {
  48. public:
  49. template<typename T1>
  50. inline static void apply(SpMat<typename T1::elem_type>& out, const SpOp<T1, spop_abs>& in);
  51. };
  52. class spop_cx_abs
  53. : public traits_op_passthru
  54. {
  55. public:
  56. template<typename T1>
  57. inline static void apply(SpMat<typename T1::pod_type>& out, const mtSpOp<typename T1::pod_type, T1, spop_cx_abs>& in);
  58. };
  59. class spop_arg
  60. : public traits_op_passthru
  61. {
  62. public:
  63. template<typename T1>
  64. inline static void apply(SpMat<typename T1::elem_type>& out, const SpOp<T1, spop_arg>& in);
  65. };
  66. class spop_cx_arg
  67. : public traits_op_passthru
  68. {
  69. public:
  70. template<typename T1>
  71. inline static void apply(SpMat<typename T1::pod_type>& out, const mtSpOp<typename T1::pod_type, T1, spop_cx_arg>& in);
  72. };
  73. class spop_real
  74. : public traits_op_passthru
  75. {
  76. public:
  77. template<typename T1>
  78. inline static void apply(SpMat<typename T1::pod_type>& out, const mtSpOp<typename T1::pod_type, T1, spop_real>& in);
  79. };
  80. class spop_imag
  81. : public traits_op_passthru
  82. {
  83. public:
  84. template<typename T1>
  85. inline static void apply(SpMat<typename T1::pod_type>& out, const mtSpOp<typename T1::pod_type, T1, spop_imag>& in);
  86. };
  87. class spop_conj
  88. : public traits_op_passthru
  89. {
  90. public:
  91. template<typename T1>
  92. inline static void apply(SpMat<typename T1::elem_type>& out, const SpOp<T1, spop_conj>& in);
  93. };
  94. class spop_repelem
  95. : public traits_op_default
  96. {
  97. public:
  98. template<typename T1>
  99. inline static void apply(SpMat<typename T1::elem_type>& out, const SpOp<T1, spop_repelem>& in);
  100. };
  101. class spop_reshape
  102. : public traits_op_default
  103. {
  104. public:
  105. template<typename T1>
  106. inline static void apply(SpMat<typename T1::elem_type>& out, const SpOp<T1, spop_reshape>& in);
  107. };
  108. class spop_resize
  109. : public traits_op_default
  110. {
  111. public:
  112. template<typename T1>
  113. inline static void apply(SpMat<typename T1::elem_type>& out, const SpOp<T1, spop_resize>& in);
  114. };
  115. class spop_floor
  116. : public traits_op_passthru
  117. {
  118. public:
  119. template<typename T1>
  120. inline static void apply(SpMat<typename T1::elem_type>& out, const SpOp<T1, spop_floor>& in);
  121. };
  122. class spop_ceil
  123. : public traits_op_passthru
  124. {
  125. public:
  126. template<typename T1>
  127. inline static void apply(SpMat<typename T1::elem_type>& out, const SpOp<T1, spop_ceil>& in);
  128. };
  129. class spop_round
  130. : public traits_op_passthru
  131. {
  132. public:
  133. template<typename T1>
  134. inline static void apply(SpMat<typename T1::elem_type>& out, const SpOp<T1, spop_round>& in);
  135. };
  136. class spop_trunc
  137. : public traits_op_passthru
  138. {
  139. public:
  140. template<typename T1>
  141. inline static void apply(SpMat<typename T1::elem_type>& out, const SpOp<T1, spop_trunc>& in);
  142. };
  143. class spop_sign
  144. : public traits_op_passthru
  145. {
  146. public:
  147. template<typename T1>
  148. inline static void apply(SpMat<typename T1::elem_type>& out, const SpOp<T1, spop_sign>& in);
  149. };
  150. class spop_diagvec
  151. : public traits_op_col
  152. {
  153. public:
  154. template<typename T1>
  155. inline static void apply(SpMat<typename T1::elem_type>& out, const SpOp<T1, spop_diagvec>& in);
  156. };
  157. class spop_flipud
  158. : public traits_op_passthru
  159. {
  160. public:
  161. template<typename T1>
  162. inline static void apply(SpMat<typename T1::elem_type>& out, const SpOp<T1, spop_flipud>& in);
  163. };
  164. class spop_fliplr
  165. : public traits_op_passthru
  166. {
  167. public:
  168. template<typename T1>
  169. inline static void apply(SpMat<typename T1::elem_type>& out, const SpOp<T1, spop_fliplr>& in);
  170. };
  171. //! @}