subview_elem2_bones.hpp 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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 subview_elem2
  16. //! @{
  17. template<typename eT, typename T1, typename T2>
  18. class subview_elem2 : public Base<eT, subview_elem2<eT,T1,T2> >
  19. {
  20. public:
  21. typedef eT elem_type;
  22. typedef typename get_pod_type<elem_type>::result pod_type;
  23. static const bool is_row = false;
  24. static const bool is_col = false;
  25. static const bool is_xvec = false;
  26. arma_aligned const Mat<eT>& m;
  27. arma_aligned const Base<uword,T1>& base_ri;
  28. arma_aligned const Base<uword,T2>& base_ci;
  29. const bool all_rows;
  30. const bool all_cols;
  31. protected:
  32. arma_inline subview_elem2(const Mat<eT>& in_m, const Base<uword,T1>& in_ri, const Base<uword,T2>& in_ci, const bool in_all_rows, const bool in_all_cols);
  33. public:
  34. inline ~subview_elem2();
  35. template<typename op_type>
  36. inline void inplace_op(const eT val);
  37. template<typename op_type, typename expr>
  38. inline void inplace_op(const Base<eT,expr>& x);
  39. inline void fill(const eT val);
  40. inline void zeros();
  41. inline void ones();
  42. inline void operator+= (const eT val);
  43. inline void operator-= (const eT val);
  44. inline void operator*= (const eT val);
  45. inline void operator/= (const eT val);
  46. // deliberately returning void
  47. template<typename T3, typename T4> inline void operator_equ(const subview_elem2<eT,T3,T4>& x);
  48. template<typename T3, typename T4> inline void operator= (const subview_elem2<eT,T3,T4>& x);
  49. inline void operator= (const subview_elem2<eT,T1,T2>& x);
  50. template<typename T3, typename T4> inline void operator+= (const subview_elem2<eT,T3,T4>& x);
  51. template<typename T3, typename T4> inline void operator-= (const subview_elem2<eT,T3,T4>& x);
  52. template<typename T3, typename T4> inline void operator%= (const subview_elem2<eT,T3,T4>& x);
  53. template<typename T3, typename T4> inline void operator/= (const subview_elem2<eT,T3,T4>& x);
  54. template<typename expr> inline void operator= (const Base<eT,expr>& x);
  55. template<typename expr> inline void operator+= (const Base<eT,expr>& x);
  56. template<typename expr> inline void operator-= (const Base<eT,expr>& x);
  57. template<typename expr> inline void operator%= (const Base<eT,expr>& x);
  58. template<typename expr> inline void operator/= (const Base<eT,expr>& x);
  59. inline static void extract(Mat<eT>& out, const subview_elem2& in);
  60. inline static void plus_inplace(Mat<eT>& out, const subview_elem2& in);
  61. inline static void minus_inplace(Mat<eT>& out, const subview_elem2& in);
  62. inline static void schur_inplace(Mat<eT>& out, const subview_elem2& in);
  63. inline static void div_inplace(Mat<eT>& out, const subview_elem2& in);
  64. private:
  65. friend class Mat<eT>;
  66. subview_elem2();
  67. };
  68. //! @}