eGlue_bones.hpp 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 eGlue
  16. //! @{
  17. template<typename T1, typename T2, typename eglue_type>
  18. class eGlue : public Base<typename T1::elem_type, eGlue<T1, T2, eglue_type> >
  19. {
  20. public:
  21. typedef typename T1::elem_type elem_type;
  22. typedef typename get_pod_type<elem_type>::result pod_type;
  23. typedef Proxy<T1> proxy1_type;
  24. typedef Proxy<T2> proxy2_type;
  25. static const bool use_at = (Proxy<T1>::use_at || Proxy<T2>::use_at );
  26. static const bool use_mp = (Proxy<T1>::use_mp || Proxy<T2>::use_mp );
  27. static const bool has_subview = (Proxy<T1>::has_subview || Proxy<T2>::has_subview);
  28. static const bool is_col = (Proxy<T1>::is_col || Proxy<T2>::is_col );
  29. static const bool is_row = (Proxy<T1>::is_row || Proxy<T2>::is_row );
  30. static const bool is_xvec = (Proxy<T1>::is_xvec || Proxy<T2>::is_xvec);
  31. arma_aligned const Proxy<T1> P1;
  32. arma_aligned const Proxy<T2> P2;
  33. arma_inline ~eGlue();
  34. arma_inline eGlue(const T1& in_A, const T2& in_B);
  35. arma_inline uword get_n_rows() const;
  36. arma_inline uword get_n_cols() const;
  37. arma_inline uword get_n_elem() const;
  38. arma_inline elem_type operator[] (const uword ii) const;
  39. arma_inline elem_type at (const uword row, const uword col) const;
  40. arma_inline elem_type at_alt (const uword ii) const;
  41. };
  42. //! @}