Chris@49
|
1 // Copyright (C) 2011-2012 Ryan Curtin
|
Chris@49
|
2 // Copyright (C) 2011 Matthew Amidon
|
Chris@49
|
3 //
|
Chris@49
|
4 // This Source Code Form is subject to the terms of the Mozilla Public
|
Chris@49
|
5 // License, v. 2.0. If a copy of the MPL was not distributed with this
|
Chris@49
|
6 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
Chris@49
|
7
|
Chris@49
|
8
|
Chris@49
|
9 //! \addtogroup SpCol
|
Chris@49
|
10 //! @{
|
Chris@49
|
11
|
Chris@49
|
12 //! Class for sparse column vectors (matrices with only one column)
|
Chris@49
|
13
|
Chris@49
|
14 template<typename eT>
|
Chris@49
|
15 class SpCol : public SpMat<eT>
|
Chris@49
|
16 {
|
Chris@49
|
17 public:
|
Chris@49
|
18
|
Chris@49
|
19 typedef eT elem_type;
|
Chris@49
|
20 typedef typename get_pod_type<eT>::result pod_type;
|
Chris@49
|
21
|
Chris@49
|
22 static const bool is_row = false;
|
Chris@49
|
23 static const bool is_col = true;
|
Chris@49
|
24
|
Chris@49
|
25
|
Chris@49
|
26 inline SpCol();
|
Chris@49
|
27 inline explicit SpCol(const uword n_elem);
|
Chris@49
|
28 inline SpCol(const uword in_rows, const uword in_cols);
|
Chris@49
|
29
|
Chris@49
|
30 inline SpCol(const char* text);
|
Chris@49
|
31 inline const SpCol& operator=(const char* text);
|
Chris@49
|
32
|
Chris@49
|
33 inline SpCol(const std::string& text);
|
Chris@49
|
34 inline const SpCol& operator=(const std::string& text);
|
Chris@49
|
35
|
Chris@49
|
36 inline const SpCol& operator=(const eT val);
|
Chris@49
|
37
|
Chris@49
|
38 template<typename T1> inline SpCol(const Base<eT,T1>& X);
|
Chris@49
|
39 template<typename T1> inline const SpCol& operator=(const Base<eT,T1>& X);
|
Chris@49
|
40
|
Chris@49
|
41 template<typename T1> inline SpCol(const SpBase<eT,T1>& X);
|
Chris@49
|
42 template<typename T1> inline const SpCol& operator=(const SpBase<eT,T1>& X);
|
Chris@49
|
43
|
Chris@49
|
44 template<typename T1, typename T2>
|
Chris@49
|
45 inline explicit SpCol(const SpBase<pod_type,T1>& A, const SpBase<pod_type,T2>& B);
|
Chris@49
|
46
|
Chris@49
|
47 inline SpValProxy<SpMat<eT> > row(const uword row_num);
|
Chris@49
|
48 inline eT row(const uword row_num) const;
|
Chris@49
|
49
|
Chris@49
|
50 // arma_inline subview_col<eT> rows(const uword in_row1, const uword in_row2);
|
Chris@49
|
51 // arma_inline const subview_col<eT> rows(const uword in_row1, const uword in_row2) const;
|
Chris@49
|
52
|
Chris@49
|
53 // arma_inline subview_col<eT> subvec(const uword in_row1, const uword in_row2);
|
Chris@49
|
54 // arma_inline const subview_col<eT> subvec(const uword in_row1, const uword in_row2) const;
|
Chris@49
|
55
|
Chris@49
|
56 // arma_inline subview_col<eT> subvec(const span& row_span);
|
Chris@49
|
57 // arma_inline const subview_col<eT> subvec(const span& row_span) const;
|
Chris@49
|
58
|
Chris@49
|
59 inline void shed_row (const uword row_num);
|
Chris@49
|
60 inline void shed_rows(const uword in_row1, const uword in_row2);
|
Chris@49
|
61
|
Chris@49
|
62 // inline void insert_rows(const uword row_num, const uword N, const bool set_to_zero = true);
|
Chris@49
|
63 // template<typename T1> inline void insert_rows(const uword row_num, const Base<eT,T1>& X);
|
Chris@49
|
64
|
Chris@49
|
65
|
Chris@49
|
66 typedef typename SpMat<eT>::iterator row_iterator;
|
Chris@49
|
67 typedef typename SpMat<eT>::const_iterator const_row_iterator;
|
Chris@49
|
68
|
Chris@49
|
69 inline row_iterator begin_row(const uword row_num = 0);
|
Chris@49
|
70 inline const_row_iterator begin_row(const uword row_num = 0) const;
|
Chris@49
|
71
|
Chris@49
|
72 inline row_iterator end_row (const uword row_num = 0);
|
Chris@49
|
73 inline const_row_iterator end_row (const uword row_num = 0) const;
|
Chris@49
|
74
|
Chris@49
|
75
|
Chris@49
|
76 #ifdef ARMA_EXTRA_SPCOL_PROTO
|
Chris@49
|
77 #include ARMA_INCFILE_WRAP(ARMA_EXTRA_SPCOL_PROTO)
|
Chris@49
|
78 #endif
|
Chris@49
|
79 };
|