diagview_bones.hpp
Go to the documentation of this file.
1 // Copyright (C) 2008-2011 NICTA (www.nicta.com.au)
2 // Copyright (C) 2008-2011 Conrad Sanderson
3 //
4 // This file is part of the Armadillo C++ library.
5 // It is provided without any warranty of fitness
6 // for any purpose. You can redistribute this file
7 // and/or modify it under the terms of the GNU
8 // Lesser General Public License (LGPL) as published
9 // by the Free Software Foundation, either version 3
10 // of the License or (at your option) any later version.
11 // (see http://www.opensource.org/licenses for more info)
12 
13 
16 
17 
19 template<typename eT>
20 class diagview : public Base<eT, diagview<eT> >
21  {
22  public: arma_aligned const Mat<eT>& m;
23  protected: arma_aligned Mat<eT>* m_ptr;
24 
25  public:
26 
27  typedef eT elem_type;
29 
32 
33  const uword n_rows; // equal to n_elem
34  const uword n_elem;
35 
36  static const uword n_cols = 1;
37 
38 
39  protected:
40 
41  arma_inline diagview(const Mat<eT>& in_m, const uword in_row_offset, const uword in_col_offset, const uword len);
42  arma_inline diagview( Mat<eT>& in_m, const uword in_row_offset, const uword in_col_offset, const uword len);
43 
44 
45  public:
46 
47  inline ~diagview();
48 
49  inline void operator=(const diagview& x);
50 
51  inline void operator+=(const eT val);
52  inline void operator-=(const eT val);
53  inline void operator*=(const eT val);
54  inline void operator/=(const eT val);
55 
56  template<typename T1> inline void operator= (const Base<eT,T1>& x);
57  template<typename T1> inline void operator+=(const Base<eT,T1>& x);
58  template<typename T1> inline void operator-=(const Base<eT,T1>& x);
59  template<typename T1> inline void operator%=(const Base<eT,T1>& x);
60  template<typename T1> inline void operator/=(const Base<eT,T1>& x);
61 
62 
63  arma_inline eT& operator[](const uword i);
64  arma_inline eT operator[](const uword i) const;
65 
66  arma_inline eT& at(const uword i);
67  arma_inline eT at(const uword i) const;
68 
69  arma_inline eT& operator()(const uword i);
70  arma_inline eT operator()(const uword i) const;
71 
72  arma_inline eT& at(const uword in_n_row, const uword in_n_col);
73  arma_inline eT at(const uword in_n_row, const uword in_n_col) const;
74 
75  arma_inline eT& operator()(const uword in_n_row, const uword in_n_col);
76  arma_inline eT operator()(const uword in_n_row, const uword in_n_col) const;
77 
78 
79  inline void fill(const eT val);
80  inline void zeros();
81  inline void ones();
82 
83  inline static void extract(Mat<eT>& out, const diagview& in);
84 
85  inline static void plus_inplace(Mat<eT>& out, const diagview& in);
86  inline static void minus_inplace(Mat<eT>& out, const diagview& in);
87  inline static void schur_inplace(Mat<eT>& out, const diagview& in);
88  inline static void div_inplace(Mat<eT>& out, const diagview& in);
89 
90 
91  private:
92 
93  friend class Mat<eT>;
94  friend class subview<eT>;
95 
96  diagview();
97  //diagview(const diagview&); // making this private causes an error under gcc 4.1/4.2, but not 4.3
98  };
99 
100 
void operator+=(const eT val)
arma_aligned const Mat< eT > & m
static void plus_inplace(Mat< eT > &out, const diagview &in)
X += Y.diag()
static void minus_inplace(Mat< eT > &out, const diagview &in)
X -= Y.diag()
void zeros()
static const uword n_cols
void operator-=(const eT val)
void operator%=(const Base< eT, T1 > &x)
arma_inline eT & at(const uword i)
const uword n_rows
const uword n_elem
u32 uword
Definition: typedef.hpp:85
void operator*=(const eT val)
const uword col_offset
void fill(const eT val)
arma_aligned Mat< eT > * m_ptr
#define arma_aligned
void operator=(const diagview &x)
set a diagonal of our matrix using a diagonal from a foreign matrix
const uword row_offset
static void schur_inplace(Mat< eT > &out, const diagview &in)
X %= Y.diag()
Dense matrix class.
#define arma_inline
static void div_inplace(Mat< eT > &out, const diagview &in)
X /= Y.diag()
get_pod_type< eT >::result pod_type
void operator/=(const eT val)
arma_inline eT & operator()(const uword i)
static void extract(Mat< eT > &out, const diagview &in)
extract a diagonal and store it as a column vector
Class for storing data required to extract and set the diagonals of a matrix.
arma_inline eT & operator[](const uword i)


armadillo_matrix
Author(s):
autogenerated on Fri Apr 16 2021 02:31:57