subview_cube_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 
20 template<typename eT>
21 class subview_cube : public BaseCube<eT, subview_cube<eT> >
22  {
23  public: arma_aligned const Cube<eT>& m;
25 
26  public:
27 
28  typedef eT elem_type;
30 
31  const uword aux_row1;
32  const uword aux_col1;
34 
35  const uword n_rows;
36  const uword n_cols;
38  const uword n_slices;
39  const uword n_elem;
40 
41 
42  protected:
43 
44  arma_inline subview_cube(const Cube<eT>& in_m, const uword in_row1, const uword in_col1, const uword in_slice1, const uword in_n_rows, const uword in_n_cols, const uword in_n_slices);
45  arma_inline subview_cube( Cube<eT>& in_m, const uword in_row1, const uword in_col1, const uword in_slice1, const uword in_n_rows, const uword in_n_cols, const uword in_n_slices);
46 
47 
48  public:
49 
50  inline ~subview_cube();
51 
52  inline void operator+= (const eT val);
53  inline void operator-= (const eT val);
54  inline void operator*= (const eT val);
55  inline void operator/= (const eT val);
56 
57  // deliberately returning void
58  template<typename T1> inline void operator= (const BaseCube<eT,T1>& x);
59  template<typename T1> inline void operator+= (const BaseCube<eT,T1>& x);
60  template<typename T1> inline void operator-= (const BaseCube<eT,T1>& x);
61  template<typename T1> inline void operator%= (const BaseCube<eT,T1>& x);
62  template<typename T1> inline void operator/= (const BaseCube<eT,T1>& x);
63 
64  inline void operator= (const subview_cube& x);
65  inline void operator+= (const subview_cube& x);
66  inline void operator-= (const subview_cube& x);
67  inline void operator%= (const subview_cube& x);
68  inline void operator/= (const subview_cube& x);
69 
70  template<typename T1> inline void operator= (const Base<eT,T1>& x);
71  template<typename T1> inline void operator+= (const Base<eT,T1>& x);
72  template<typename T1> inline void operator-= (const Base<eT,T1>& x);
73  template<typename T1> inline void operator%= (const Base<eT,T1>& x);
74  template<typename T1> inline void operator/= (const Base<eT,T1>& x);
75 
76  inline static void extract(Cube<eT>& out, const subview_cube& in);
77  inline static void plus_inplace(Cube<eT>& out, const subview_cube& in);
78  inline static void minus_inplace(Cube<eT>& out, const subview_cube& in);
79  inline static void schur_inplace(Cube<eT>& out, const subview_cube& in);
80  inline static void div_inplace(Cube<eT>& out, const subview_cube& in);
81 
82  inline static void extract(Mat<eT>& out, const subview_cube& in);
83  inline static void plus_inplace(Mat<eT>& out, const subview_cube& in);
84  inline static void minus_inplace(Mat<eT>& out, const subview_cube& in);
85  inline static void schur_inplace(Mat<eT>& out, const subview_cube& in);
86  inline static void div_inplace(Mat<eT>& out, const subview_cube& in);
87 
88  inline void fill(const eT val);
89  inline void zeros();
90  inline void ones();
91 
92  inline eT& operator[](const uword i);
93  inline eT operator[](const uword i) const;
94 
95  inline eT& operator()(const uword i);
96  inline eT operator()(const uword i) const;
97 
98  arma_inline eT& operator()(const uword in_row, const uword in_col, const uword in_slice);
99  arma_inline eT operator()(const uword in_row, const uword in_col, const uword in_slice) const;
100 
101  arma_inline eT& at(const uword in_row, const uword in_col, const uword in_slice);
102  arma_inline eT at(const uword in_row, const uword in_col, const uword in_slice) const;
103 
104  arma_inline eT* slice_colptr(const uword in_slice, const uword in_col);
105  arma_inline const eT* slice_colptr(const uword in_slice, const uword in_col) const;
106 
107  inline bool check_overlap(const subview_cube& x) const;
108  inline bool check_overlap(const Mat<eT>& x) const;
109 
110 
111  private:
112 
113  friend class Mat<eT>;
114  friend class Cube<eT>;
115 
116  subview_cube();
117  };
118 
119 
120 
void operator%=(const BaseCube< eT, T1 > &x)
void operator+=(const eT val)
static void minus_inplace(Cube< eT > &out, const subview_cube &in)
cube X -= Y.subcube(...)
void operator*=(const eT val)
void operator/=(const eT val)
const uword n_elem
static void extract(Cube< eT > &out, const subview_cube &in)
cube X = Y.subcube(...)
bool check_overlap(const subview_cube &x) const
arma_inline eT & at(const uword in_row, const uword in_col, const uword in_slice)
u32 uword
Definition: typedef.hpp:85
const uword aux_slice1
const uword n_slices
void operator=(const BaseCube< eT, T1 > &x)
eT & operator()(const uword i)
static void plus_inplace(Cube< eT > &out, const subview_cube &in)
cube X += Y.subcube(...)
Dense cube class.
Definition: Cube_bones.hpp:30
const uword aux_col1
void operator-=(const eT val)
#define arma_aligned
static void schur_inplace(Cube< eT > &out, const subview_cube &in)
cube X %= Y.subcube(...)
Analog of the Base class, intended for cubes.
arma_aligned Cube< eT > * m_ptr
Dense matrix class.
#define arma_inline
const uword n_cols
const uword n_rows
eT & operator[](const uword i)
static void div_inplace(Cube< eT > &out, const subview_cube &in)
cube X /= Y.subcube(...)
void fill(const eT val)
const uword n_elem_slice
arma_inline eT * slice_colptr(const uword in_slice, const uword in_col)
arma_aligned const Cube< eT > & m
get_pod_type< elem_type >::result pod_type
const uword aux_row1


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