unwrap_cube.hpp
Go to the documentation of this file.
1 // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
2 // Copyright (C) 2008-2010 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 
18 
19 template<typename T1>
21  {
22  public:
23 
24  typedef typename T1::elem_type eT;
25 
26  inline
27  unwrap_cube(const T1& A)
28  : M(A)
29  {
31  }
32 
33  const Cube<eT> M;
34  };
35 
36 
37 
38 template<typename eT>
39 class unwrap_cube< Cube<eT> >
40  {
41  public:
42 
43  inline
45  : M(A)
46  {
48  }
49 
50  const Cube<eT>& M;
51  };
52 
53 
54 
55 //
56 //
57 //
58 
59 
60 
61 template<typename T1>
63  {
64  typedef typename T1::elem_type eT;
65 
66  inline
67  unwrap_cube_check(const T1& A, const Cube<eT>& B)
68  : M(A)
69  {
71 
73  }
74 
75  const Cube<eT> M;
76  };
77 
78 
79 
80 template<typename eT>
82  {
83  public:
84 
85  inline
86  unwrap_cube_check(const Cube<eT>& A, const Cube<eT>& B)
87  : M_local( (&A == &B) ? new Cube<eT>(A) : 0 )
88  , M ( (&A == &B) ? (*M_local) : A )
89  {
91  }
92 
93 
94  inline
96  {
98 
99  if(M_local)
100  {
101  delete M_local;
102  }
103  }
104 
105 
106  // the order below is important
108  const Cube<eT>& M;
109 
110  };
111 
112 
113 
unwrap_cube_check(const Cube< eT > &A, const Cube< eT > &B)
Definition: unwrap_cube.hpp:86
unwrap_cube_check(const T1 &A, const Cube< eT > &B)
Definition: unwrap_cube.hpp:67
#define arma_type_check(condition)
const Cube< eT > & M
Definition: unwrap_cube.hpp:50
unwrap_cube(const Cube< eT > &A)
Definition: unwrap_cube.hpp:44
Dense cube class.
Definition: Cube_bones.hpp:30
T1::elem_type eT
Definition: unwrap_cube.hpp:64
const Cube< eT > M
Definition: unwrap_cube.hpp:75
#define arma_extra_debug_sigprint
Definition: debug.hpp:1116
unwrap_cube(const T1 &A)
Definition: unwrap_cube.hpp:27
const Cube< eT > M
Definition: unwrap_cube.hpp:33
T1::elem_type eT
Definition: unwrap_cube.hpp:24


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