op_misc_meat.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 
18 
19 template<typename T1>
20 inline
21 void
23  {
25 
26  typedef typename T1::pod_type T;
27 
28  const Proxy<T1> A(X.m);
29 
30  out.set_size(A.get_n_rows(), A.get_n_cols());
31 
32  const uword n_elem = out.n_elem;
33  T* out_mem = out.memptr();
34 
35  for(uword i=0; i<n_elem; ++i)
36  {
37  out_mem[i] = std::real(A[i]);
38  }
39  }
40 
41 
42 
43 template<typename T1>
44 inline
45 void
47  {
49 
50  typedef typename T1::pod_type T;
51 
52  const ProxyCube<T1> A(X.m);
53 
54  out.set_size(A.get_n_rows(), A.get_n_cols(), A.get_n_slices());
55 
56  const uword n_elem = out.n_elem;
57  T* out_mem = out.memptr();
58 
59  for(uword i=0; i<n_elem; ++i)
60  {
61  out_mem[i] = std::real(A[i]);
62  }
63  }
64 
65 
66 
67 template<typename T1>
68 inline
69 void
71  {
73 
74  typedef typename T1::pod_type T;
75 
76  const Proxy<T1> A(X.m);
77 
78  out.set_size(A.get_n_rows(), A.get_n_cols());
79 
80  const uword n_elem = out.n_elem;
81  T* out_mem = out.memptr();
82 
83  for(uword i=0; i<n_elem; ++i)
84  {
85  out_mem[i] = std::imag(A[i]);
86  }
87  }
88 
89 
90 
91 template<typename T1>
92 inline
93 void
95  {
97 
98  typedef typename T1::pod_type T;
99 
100  const ProxyCube<T1> A(X.m);
101 
102  out.set_size(A.get_n_rows(), A.get_n_cols(), A.get_n_slices());
103 
104  const uword n_elem = out.n_elem;
105  T* out_mem = out.memptr();
106 
107  for(uword i=0; i<n_elem; ++i)
108  {
109  out_mem[i] = std::imag(A[i]);
110  }
111  }
112 
113 
114 
115 template<typename T1>
116 inline
117 void
119  {
121 
122  typedef typename T1::pod_type T;
123 
124  const Proxy<T1> A(X.m);
125 
126  out.set_size(A.get_n_rows(), A.get_n_cols());
127 
128  const uword n_elem = out.n_elem;
129  T* out_mem = out.memptr();
130 
131  for(uword i=0; i<n_elem; ++i)
132  {
133  out_mem[i] = std::abs(A[i]);
134  }
135  }
136 
137 
138 
139 template<typename T1>
140 inline
141 void
143  {
145 
146  typedef typename T1::pod_type T;
147 
148  const ProxyCube<T1> A(X.m);
149 
150  out.set_size(A.get_n_rows(), A.get_n_cols(), A.get_n_slices());
151 
152  const uword n_elem = out.n_elem;
153  T* out_mem = out.memptr();
154 
155  for(uword i=0; i<n_elem; ++i)
156  {
157  out_mem[i] = std::abs(A[i]);
158  }
159  }
160 
161 
162 
163 template<typename T1>
164 inline
165 void
167  {
169 
170  out = X.m;
171  }
172 
173 
174 
arma_inline arma_warn_unused eT * memptr()
returns a pointer to array of eTs used by the matrix
Definition: Mat_meat.hpp:4024
void set_size(const uword in_elem)
change the matrix to have user specified dimensions (data is not preserved)
Definition: Mat_meat.hpp:4211
arma_aligned const T1 & m
storage of reference to the operand (eg. a matrix)
Definition: mtOp_bones.hpp:39
static void apply(Mat< typename T1::elem_type > &out, const Op< T1, op_sympd > &X)
void set_size(const uword in_rows, const uword in_cols, const uword in_slices)
change the cube to have user specified dimensions (data is not preserved)
Definition: Cube_meat.hpp:2414
static void apply(Mat< typename T1::pod_type > &out, const mtOp< typename T1::pod_type, T1, op_abs > &X)
const uword n_elem
number of elements in the matrix (read-only)
Definition: Mat_bones.hpp:31
arma_aligned const T1 & m
storage of reference to the operand (eg. a matrix)
Definition: Op_bones.hpp:45
u32 uword
Definition: typedef.hpp:85
static void apply(Mat< typename T1::pod_type > &out, const mtOp< typename T1::pod_type, T1, op_imag > &X)
arma_inline arma_warn_unused eT * memptr()
returns a pointer to array of eTs used by the cube
Definition: Cube_meat.hpp:2260
Dense cube class.
Definition: Cube_bones.hpp:30
arma_inline const T1 & real(const Base< typename T1::pod_type, T1 > &X)
Definition: fn_elem.hpp:50
arma_inline const eOp< T1, eop_abs > abs(const Base< typename T1::elem_type, T1 > &X, const typename arma_not_cx< typename T1::elem_type >::result *junk=0)
Definition: fn_elem.hpp:317
#define arma_extra_debug_sigprint
Definition: debug.hpp:1116
const uword n_elem
number of elements in the cube (read-only)
Definition: Cube_bones.hpp:41
Dense matrix class.
const Gen< typename T1::pod_type, gen_zeros > imag(const Base< typename T1::pod_type, T1 > &X)
Definition: fn_elem.hpp:101
static void apply(Mat< typename T1::pod_type > &out, const mtOp< typename T1::pod_type, T1, op_real > &X)
arma_aligned const T1 & m
storage of reference to the operand (eg. a matrix)


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