op_min_bones.hpp 3.9 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_min
  16. //! @{
  17. class op_min
  18. : public traits_op_xvec
  19. {
  20. public:
  21. //
  22. // dense matrices
  23. template<typename T1>
  24. inline static void apply(Mat<typename T1::elem_type>& out, const Op<T1,op_min>& in);
  25. template<typename eT>
  26. inline static void apply_noalias(Mat<eT>& out, const Mat<eT>& X, const uword dim, const typename arma_not_cx<eT>::result* junk = 0);
  27. template<typename eT>
  28. inline static void apply_noalias(Mat<eT>& out, const Mat<eT>& X, const uword dim, const typename arma_cx_only<eT>::result* junk = 0);
  29. //
  30. // cubes
  31. template<typename T1>
  32. inline static void apply(Cube<typename T1::elem_type>& out, const OpCube<T1,op_min>& in);
  33. template<typename eT>
  34. inline static void apply_noalias(Cube<eT>& out, const Cube<eT>& X, const uword dim, const typename arma_not_cx<eT>::result* junk = 0);
  35. template<typename eT>
  36. inline static void apply_noalias(Cube<eT>& out, const Cube<eT>& X, const uword dim, const typename arma_cx_only<eT>::result* junk = 0);
  37. //
  38. // for non-complex numbers
  39. template<typename eT>
  40. inline static eT direct_min(const eT* const X, const uword N);
  41. template<typename eT>
  42. inline static eT direct_min(const eT* const X, const uword N, uword& index_of_min_val);
  43. template<typename eT>
  44. inline static eT direct_min(const Mat<eT>& X, const uword row);
  45. template<typename eT>
  46. inline static eT min(const subview<eT>& X);
  47. template<typename T1>
  48. inline static typename arma_not_cx<typename T1::elem_type>::result min(const Base<typename T1::elem_type, T1>& X);
  49. template<typename T1>
  50. inline static typename arma_not_cx<typename T1::elem_type>::result min(const BaseCube<typename T1::elem_type, T1>& X);
  51. template<typename T1>
  52. inline static typename arma_not_cx<typename T1::elem_type>::result min_with_index(const Proxy<T1>& P, uword& index_of_min_val);
  53. template<typename T1>
  54. inline static typename arma_not_cx<typename T1::elem_type>::result min_with_index(const ProxyCube<T1>& P, uword& index_of_min_val);
  55. //
  56. // for complex numbers
  57. template<typename T>
  58. inline static std::complex<T> direct_min(const std::complex<T>* const X, const uword n_elem);
  59. template<typename T>
  60. inline static std::complex<T> direct_min(const std::complex<T>* const X, const uword n_elem, uword& index_of_min_val);
  61. template<typename T>
  62. inline static std::complex<T> direct_min(const Mat< std::complex<T> >& X, const uword row);
  63. template<typename T>
  64. inline static std::complex<T> min(const subview< std::complex<T> >& X);
  65. template<typename T1>
  66. inline static typename arma_cx_only<typename T1::elem_type>::result min(const Base<typename T1::elem_type, T1>& X);
  67. template<typename T1>
  68. inline static typename arma_cx_only<typename T1::elem_type>::result min(const BaseCube<typename T1::elem_type, T1>& X);
  69. template<typename T1>
  70. inline static typename arma_cx_only<typename T1::elem_type>::result min_with_index(const Proxy<T1>& P, uword& index_of_min_val);
  71. template<typename T1>
  72. inline static typename arma_cx_only<typename T1::elem_type>::result min_with_index(const ProxyCube<T1>& P, uword& index_of_min_val);
  73. };
  74. //! @}