SpCol_bones.hpp 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 SpCol
  16. //! @{
  17. //! Class for sparse column vectors (matrices with only one column)
  18. template<typename eT>
  19. class SpCol : public SpMat<eT>
  20. {
  21. public:
  22. typedef eT elem_type;
  23. typedef typename get_pod_type<eT>::result pod_type;
  24. static const bool is_row = false;
  25. static const bool is_col = true;
  26. static const bool is_xvec = false;
  27. inline SpCol();
  28. inline explicit SpCol(const uword n_elem);
  29. inline explicit SpCol(const uword in_rows, const uword in_cols);
  30. inline explicit SpCol(const SizeMat& s);
  31. inline SpCol(const char* text);
  32. inline SpCol& operator=(const char* text);
  33. inline SpCol(const std::string& text);
  34. inline SpCol& operator=(const std::string& text);
  35. inline SpCol& operator=(const eT val);
  36. template<typename T1> inline SpCol(const Base<eT,T1>& X);
  37. template<typename T1> inline SpCol& operator=(const Base<eT,T1>& X);
  38. template<typename T1> inline SpCol(const SpBase<eT,T1>& X);
  39. template<typename T1> inline SpCol& operator=(const SpBase<eT,T1>& X);
  40. template<typename T1, typename T2>
  41. inline explicit SpCol(const SpBase<pod_type,T1>& A, const SpBase<pod_type,T2>& B);
  42. inline const SpOp<SpCol<eT>,spop_htrans> t() const;
  43. inline const SpOp<SpCol<eT>,spop_htrans> ht() const;
  44. inline const SpOp<SpCol<eT>,spop_strans> st() const;
  45. inline void shed_row (const uword row_num);
  46. inline void shed_rows(const uword in_row1, const uword in_row2);
  47. // inline void insert_rows(const uword row_num, const uword N, const bool set_to_zero = true);
  48. typedef typename SpMat<eT>::iterator row_iterator;
  49. typedef typename SpMat<eT>::const_iterator const_row_iterator;
  50. inline row_iterator begin_row(const uword row_num = 0);
  51. inline const_row_iterator begin_row(const uword row_num = 0) const;
  52. inline row_iterator end_row (const uword row_num = 0);
  53. inline const_row_iterator end_row (const uword row_num = 0) const;
  54. #ifdef ARMA_EXTRA_SPCOL_PROTO
  55. #include ARMA_INCFILE_WRAP(ARMA_EXTRA_SPCOL_PROTO)
  56. #endif
  57. };