max@0
|
1 // Copyright (C) 2010-2011 NICTA (www.nicta.com.au)
|
max@0
|
2 // Copyright (C) 2010-2011 Conrad Sanderson
|
max@0
|
3 //
|
max@0
|
4 // This file is part of the Armadillo C++ library.
|
max@0
|
5 // It is provided without any warranty of fitness
|
max@0
|
6 // for any purpose. You can redistribute this file
|
max@0
|
7 // and/or modify it under the terms of the GNU
|
max@0
|
8 // Lesser General Public License (LGPL) as published
|
max@0
|
9 // by the Free Software Foundation, either version 3
|
max@0
|
10 // of the License or (at your option) any later version.
|
max@0
|
11 // (see http://www.opensource.org/licenses for more info)
|
max@0
|
12
|
max@0
|
13
|
max@0
|
14 //! \addtogroup eop_core
|
max@0
|
15 //! @{
|
max@0
|
16
|
max@0
|
17
|
max@0
|
18 #undef arma_applier_1
|
max@0
|
19 #undef arma_applier_2
|
max@0
|
20 #undef arma_applier_3
|
max@0
|
21 #undef operatorA
|
max@0
|
22
|
max@0
|
23 #define arma_applier_1(operatorA) \
|
max@0
|
24 {\
|
max@0
|
25 uword i,j;\
|
max@0
|
26 \
|
max@0
|
27 for(i=0, j=1; j<n_elem; i+=2, j+=2)\
|
max@0
|
28 {\
|
max@0
|
29 eT tmp_i = P[i];\
|
max@0
|
30 eT tmp_j = P[j];\
|
max@0
|
31 \
|
max@0
|
32 tmp_i = eop_core<eop_type>::process(tmp_i, k);\
|
max@0
|
33 tmp_j = eop_core<eop_type>::process(tmp_j, k);\
|
max@0
|
34 \
|
max@0
|
35 out_mem[i] operatorA tmp_i;\
|
max@0
|
36 out_mem[j] operatorA tmp_j;\
|
max@0
|
37 }\
|
max@0
|
38 \
|
max@0
|
39 if(i < n_elem)\
|
max@0
|
40 {\
|
max@0
|
41 out_mem[i] operatorA eop_core<eop_type>::process(P[i], k);\
|
max@0
|
42 }\
|
max@0
|
43 }
|
max@0
|
44
|
max@0
|
45
|
max@0
|
46 #define arma_applier_2(operatorA) \
|
max@0
|
47 {\
|
max@0
|
48 uword count = 0;\
|
max@0
|
49 \
|
max@0
|
50 for(uword col=0; col<n_cols; ++col)\
|
max@0
|
51 {\
|
max@0
|
52 uword i,j;\
|
max@0
|
53 \
|
max@0
|
54 for(i=0, j=1; j<n_rows; i+=2, j+=2, count+=2)\
|
max@0
|
55 {\
|
max@0
|
56 eT tmp_i = P.at(i,col);\
|
max@0
|
57 eT tmp_j = P.at(j,col);\
|
max@0
|
58 \
|
max@0
|
59 tmp_i = eop_core<eop_type>::process(tmp_i, k);\
|
max@0
|
60 tmp_j = eop_core<eop_type>::process(tmp_j, k);\
|
max@0
|
61 \
|
max@0
|
62 out_mem[count ] operatorA tmp_i;\
|
max@0
|
63 out_mem[count+1] operatorA tmp_j;\
|
max@0
|
64 }\
|
max@0
|
65 \
|
max@0
|
66 if(i < n_rows)\
|
max@0
|
67 {\
|
max@0
|
68 out_mem[count] operatorA eop_core<eop_type>::process(P.at(i,col), k);\
|
max@0
|
69 ++count;\
|
max@0
|
70 }\
|
max@0
|
71 }\
|
max@0
|
72 }
|
max@0
|
73
|
max@0
|
74
|
max@0
|
75
|
max@0
|
76 #define arma_applier_3(operatorA) \
|
max@0
|
77 {\
|
max@0
|
78 uword count = 0;\
|
max@0
|
79 \
|
max@0
|
80 for(uword slice=0; slice<n_slices; ++slice)\
|
max@0
|
81 {\
|
max@0
|
82 for(uword col=0; col<n_cols; ++col)\
|
max@0
|
83 {\
|
max@0
|
84 uword i,j;\
|
max@0
|
85 \
|
max@0
|
86 for(i=0, j=1; j<n_rows; i+=2, j+=2, count+=2)\
|
max@0
|
87 {\
|
max@0
|
88 eT tmp_i = P.at(i,col,slice);\
|
max@0
|
89 eT tmp_j = P.at(j,col,slice);\
|
max@0
|
90 \
|
max@0
|
91 tmp_i = eop_core<eop_type>::process(tmp_i, k);\
|
max@0
|
92 tmp_j = eop_core<eop_type>::process(tmp_j, k);\
|
max@0
|
93 \
|
max@0
|
94 out_mem[count ] operatorA tmp_i;\
|
max@0
|
95 out_mem[count+1] operatorA tmp_j;\
|
max@0
|
96 }\
|
max@0
|
97 \
|
max@0
|
98 if(i < n_rows)\
|
max@0
|
99 {\
|
max@0
|
100 out_mem[count] operatorA eop_core<eop_type>::process(P.at(i,col,slice), k);\
|
max@0
|
101 ++count;\
|
max@0
|
102 }\
|
max@0
|
103 }\
|
max@0
|
104 }\
|
max@0
|
105 }
|
max@0
|
106
|
max@0
|
107
|
max@0
|
108
|
max@0
|
109 //
|
max@0
|
110 // matrices
|
max@0
|
111
|
max@0
|
112
|
max@0
|
113
|
max@0
|
114 template<typename eop_type>
|
max@0
|
115 template<typename T1>
|
max@0
|
116 arma_hot
|
max@0
|
117 inline
|
max@0
|
118 void
|
max@0
|
119 eop_core<eop_type>::apply(Mat<typename T1::elem_type>& out, const eOp<T1, eop_type>& x)
|
max@0
|
120 {
|
max@0
|
121 arma_extra_debug_sigprint();
|
max@0
|
122
|
max@0
|
123 typedef typename T1::elem_type eT;
|
max@0
|
124
|
max@0
|
125 const uword n_rows = out.n_rows;
|
max@0
|
126 const uword n_cols = out.n_cols;
|
max@0
|
127 const uword n_elem = out.n_elem;
|
max@0
|
128
|
max@0
|
129 // NOTE: we're assuming that the matrix has already been set to the correct size and there is no aliasing;
|
max@0
|
130 // size setting and alias checking is done by either the Mat contructor or operator=()
|
max@0
|
131
|
max@0
|
132 const eT k = x.aux;
|
max@0
|
133 eT* out_mem = out.memptr();
|
max@0
|
134
|
max@0
|
135 if(Proxy<T1>::prefer_at_accessor == false)
|
max@0
|
136 {
|
max@0
|
137 typename Proxy<T1>::ea_type P = x.P.get_ea();
|
max@0
|
138
|
max@0
|
139 arma_applier_1(=);
|
max@0
|
140 }
|
max@0
|
141 else
|
max@0
|
142 {
|
max@0
|
143 const Proxy<T1>& P = x.P;
|
max@0
|
144
|
max@0
|
145 arma_applier_2(=);
|
max@0
|
146 }
|
max@0
|
147 }
|
max@0
|
148
|
max@0
|
149
|
max@0
|
150
|
max@0
|
151 template<typename eop_type>
|
max@0
|
152 template<typename T1>
|
max@0
|
153 arma_hot
|
max@0
|
154 inline
|
max@0
|
155 void
|
max@0
|
156 eop_core<eop_type>::apply_inplace_plus(Mat<typename T1::elem_type>& out, const eOp<T1, eop_type>& x)
|
max@0
|
157 {
|
max@0
|
158 arma_extra_debug_sigprint();
|
max@0
|
159
|
max@0
|
160 typedef typename T1::elem_type eT;
|
max@0
|
161
|
max@0
|
162 const uword n_rows = x.get_n_rows();
|
max@0
|
163 const uword n_cols = x.get_n_cols();
|
max@0
|
164
|
max@0
|
165 arma_debug_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "addition");
|
max@0
|
166
|
max@0
|
167 eT* out_mem = out.memptr();
|
max@0
|
168 const uword n_elem = out.n_elem;
|
max@0
|
169
|
max@0
|
170 const eT k = x.aux;
|
max@0
|
171
|
max@0
|
172 if(Proxy<T1>::prefer_at_accessor == false)
|
max@0
|
173 {
|
max@0
|
174 typename Proxy<T1>::ea_type P = x.P.get_ea();
|
max@0
|
175
|
max@0
|
176 arma_applier_1(+=);
|
max@0
|
177 }
|
max@0
|
178 else
|
max@0
|
179 {
|
max@0
|
180 const Proxy<T1>& P = x.P;
|
max@0
|
181
|
max@0
|
182 arma_applier_2(+=);
|
max@0
|
183 }
|
max@0
|
184 }
|
max@0
|
185
|
max@0
|
186
|
max@0
|
187
|
max@0
|
188 template<typename eop_type>
|
max@0
|
189 template<typename T1>
|
max@0
|
190 arma_hot
|
max@0
|
191 inline
|
max@0
|
192 void
|
max@0
|
193 eop_core<eop_type>::apply_inplace_minus(Mat<typename T1::elem_type>& out, const eOp<T1, eop_type>& x)
|
max@0
|
194 {
|
max@0
|
195 arma_extra_debug_sigprint();
|
max@0
|
196
|
max@0
|
197 typedef typename T1::elem_type eT;
|
max@0
|
198
|
max@0
|
199 const uword n_rows = x.get_n_rows();
|
max@0
|
200 const uword n_cols = x.get_n_cols();
|
max@0
|
201
|
max@0
|
202 arma_debug_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "subtraction");
|
max@0
|
203
|
max@0
|
204 eT* out_mem = out.memptr();
|
max@0
|
205 const uword n_elem = out.n_elem;
|
max@0
|
206
|
max@0
|
207 const eT k = x.aux;
|
max@0
|
208
|
max@0
|
209 if(Proxy<T1>::prefer_at_accessor == false)
|
max@0
|
210 {
|
max@0
|
211 typename Proxy<T1>::ea_type P = x.P.get_ea();
|
max@0
|
212
|
max@0
|
213 arma_applier_1(-=);
|
max@0
|
214 }
|
max@0
|
215 else
|
max@0
|
216 {
|
max@0
|
217 const Proxy<T1>& P = x.P;
|
max@0
|
218
|
max@0
|
219 arma_applier_2(-=);
|
max@0
|
220 }
|
max@0
|
221 }
|
max@0
|
222
|
max@0
|
223
|
max@0
|
224
|
max@0
|
225 template<typename eop_type>
|
max@0
|
226 template<typename T1>
|
max@0
|
227 arma_hot
|
max@0
|
228 inline
|
max@0
|
229 void
|
max@0
|
230 eop_core<eop_type>::apply_inplace_schur(Mat<typename T1::elem_type>& out, const eOp<T1, eop_type>& x)
|
max@0
|
231 {
|
max@0
|
232 arma_extra_debug_sigprint();
|
max@0
|
233
|
max@0
|
234 typedef typename T1::elem_type eT;
|
max@0
|
235
|
max@0
|
236 const uword n_rows = x.get_n_rows();
|
max@0
|
237 const uword n_cols = x.get_n_cols();
|
max@0
|
238
|
max@0
|
239 arma_debug_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "element-wise multiplication");
|
max@0
|
240
|
max@0
|
241 eT* out_mem = out.memptr();
|
max@0
|
242 const uword n_elem = out.n_elem;
|
max@0
|
243
|
max@0
|
244 const eT k = x.aux;
|
max@0
|
245
|
max@0
|
246 if(Proxy<T1>::prefer_at_accessor == false)
|
max@0
|
247 {
|
max@0
|
248 typename Proxy<T1>::ea_type P = x.P.get_ea();
|
max@0
|
249
|
max@0
|
250 arma_applier_1(*=);
|
max@0
|
251 }
|
max@0
|
252 else
|
max@0
|
253 {
|
max@0
|
254 const Proxy<T1>& P = x.P;
|
max@0
|
255
|
max@0
|
256 arma_applier_2(*=);
|
max@0
|
257 }
|
max@0
|
258 }
|
max@0
|
259
|
max@0
|
260
|
max@0
|
261
|
max@0
|
262 template<typename eop_type>
|
max@0
|
263 template<typename T1>
|
max@0
|
264 arma_hot
|
max@0
|
265 inline
|
max@0
|
266 void
|
max@0
|
267 eop_core<eop_type>::apply_inplace_div(Mat<typename T1::elem_type>& out, const eOp<T1, eop_type>& x)
|
max@0
|
268 {
|
max@0
|
269 arma_extra_debug_sigprint();
|
max@0
|
270
|
max@0
|
271 typedef typename T1::elem_type eT;
|
max@0
|
272
|
max@0
|
273 const uword n_rows = x.get_n_rows();
|
max@0
|
274 const uword n_cols = x.get_n_cols();
|
max@0
|
275
|
max@0
|
276 arma_debug_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "element-wise division");
|
max@0
|
277
|
max@0
|
278 eT* out_mem = out.memptr();
|
max@0
|
279 const uword n_elem = out.n_elem;
|
max@0
|
280
|
max@0
|
281 const eT k = x.aux;
|
max@0
|
282
|
max@0
|
283 if(Proxy<T1>::prefer_at_accessor == false)
|
max@0
|
284 {
|
max@0
|
285 typename Proxy<T1>::ea_type P = x.P.get_ea();
|
max@0
|
286
|
max@0
|
287 arma_applier_1(/=);
|
max@0
|
288 }
|
max@0
|
289 else
|
max@0
|
290 {
|
max@0
|
291 const Proxy<T1>& P = x.P;
|
max@0
|
292
|
max@0
|
293 arma_applier_2(/=);
|
max@0
|
294 }
|
max@0
|
295 }
|
max@0
|
296
|
max@0
|
297
|
max@0
|
298
|
max@0
|
299 //
|
max@0
|
300 // cubes
|
max@0
|
301
|
max@0
|
302
|
max@0
|
303
|
max@0
|
304 template<typename eop_type>
|
max@0
|
305 template<typename T1>
|
max@0
|
306 arma_hot
|
max@0
|
307 inline
|
max@0
|
308 void
|
max@0
|
309 eop_core<eop_type>::apply(Cube<typename T1::elem_type>& out, const eOpCube<T1, eop_type>& x)
|
max@0
|
310 {
|
max@0
|
311 arma_extra_debug_sigprint();
|
max@0
|
312
|
max@0
|
313 typedef typename T1::elem_type eT;
|
max@0
|
314
|
max@0
|
315 const uword n_rows = out.n_rows;
|
max@0
|
316 const uword n_cols = out.n_cols;
|
max@0
|
317 const uword n_slices = out.n_slices;
|
max@0
|
318 const uword n_elem = out.n_elem;
|
max@0
|
319
|
max@0
|
320 // NOTE: we're assuming that the matrix has already been set to the correct size and there is no aliasing;
|
max@0
|
321 // size setting and alias checking is done by either the Mat contructor or operator=()
|
max@0
|
322
|
max@0
|
323 const eT k = x.aux;
|
max@0
|
324 eT* out_mem = out.memptr();
|
max@0
|
325
|
max@0
|
326 if(ProxyCube<T1>::prefer_at_accessor == false)
|
max@0
|
327 {
|
max@0
|
328 typename ProxyCube<T1>::ea_type P = x.P.get_ea();
|
max@0
|
329
|
max@0
|
330 arma_applier_1(=);
|
max@0
|
331 }
|
max@0
|
332 else
|
max@0
|
333 {
|
max@0
|
334 const ProxyCube<T1>& P = x.P;
|
max@0
|
335
|
max@0
|
336 arma_applier_3(=);
|
max@0
|
337 }
|
max@0
|
338 }
|
max@0
|
339
|
max@0
|
340
|
max@0
|
341
|
max@0
|
342 template<typename eop_type>
|
max@0
|
343 template<typename T1>
|
max@0
|
344 arma_hot
|
max@0
|
345 inline
|
max@0
|
346 void
|
max@0
|
347 eop_core<eop_type>::apply_inplace_plus(Cube<typename T1::elem_type>& out, const eOpCube<T1, eop_type>& x)
|
max@0
|
348 {
|
max@0
|
349 arma_extra_debug_sigprint();
|
max@0
|
350
|
max@0
|
351 typedef typename T1::elem_type eT;
|
max@0
|
352
|
max@0
|
353 const uword n_rows = x.get_n_rows();
|
max@0
|
354 const uword n_cols = x.get_n_cols();
|
max@0
|
355 const uword n_slices = x.get_n_slices();
|
max@0
|
356
|
max@0
|
357 arma_debug_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "addition");
|
max@0
|
358
|
max@0
|
359 eT* out_mem = out.memptr();
|
max@0
|
360 const uword n_elem = out.n_elem;
|
max@0
|
361
|
max@0
|
362 const eT k = x.aux;
|
max@0
|
363
|
max@0
|
364 if(ProxyCube<T1>::prefer_at_accessor == false)
|
max@0
|
365 {
|
max@0
|
366 typename ProxyCube<T1>::ea_type P = x.P.get_ea();
|
max@0
|
367
|
max@0
|
368 arma_applier_1(+=);
|
max@0
|
369 }
|
max@0
|
370 else
|
max@0
|
371 {
|
max@0
|
372 const ProxyCube<T1>& P = x.P;
|
max@0
|
373
|
max@0
|
374 arma_applier_3(+=);
|
max@0
|
375 }
|
max@0
|
376 }
|
max@0
|
377
|
max@0
|
378
|
max@0
|
379
|
max@0
|
380 template<typename eop_type>
|
max@0
|
381 template<typename T1>
|
max@0
|
382 arma_hot
|
max@0
|
383 inline
|
max@0
|
384 void
|
max@0
|
385 eop_core<eop_type>::apply_inplace_minus(Cube<typename T1::elem_type>& out, const eOpCube<T1, eop_type>& x)
|
max@0
|
386 {
|
max@0
|
387 arma_extra_debug_sigprint();
|
max@0
|
388
|
max@0
|
389 typedef typename T1::elem_type eT;
|
max@0
|
390
|
max@0
|
391 const uword n_rows = x.get_n_rows();
|
max@0
|
392 const uword n_cols = x.get_n_cols();
|
max@0
|
393 const uword n_slices = x.get_n_slices();
|
max@0
|
394
|
max@0
|
395 arma_debug_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "subtraction");
|
max@0
|
396
|
max@0
|
397 eT* out_mem = out.memptr();
|
max@0
|
398 const uword n_elem = out.n_elem;
|
max@0
|
399
|
max@0
|
400 const eT k = x.aux;
|
max@0
|
401
|
max@0
|
402 if(ProxyCube<T1>::prefer_at_accessor == false)
|
max@0
|
403 {
|
max@0
|
404 typename ProxyCube<T1>::ea_type P = x.P.get_ea();
|
max@0
|
405
|
max@0
|
406 arma_applier_1(-=);
|
max@0
|
407 }
|
max@0
|
408 else
|
max@0
|
409 {
|
max@0
|
410 const ProxyCube<T1>& P = x.P;
|
max@0
|
411
|
max@0
|
412 arma_applier_3(-=);
|
max@0
|
413 }
|
max@0
|
414 }
|
max@0
|
415
|
max@0
|
416
|
max@0
|
417
|
max@0
|
418 template<typename eop_type>
|
max@0
|
419 template<typename T1>
|
max@0
|
420 arma_hot
|
max@0
|
421 inline
|
max@0
|
422 void
|
max@0
|
423 eop_core<eop_type>::apply_inplace_schur(Cube<typename T1::elem_type>& out, const eOpCube<T1, eop_type>& x)
|
max@0
|
424 {
|
max@0
|
425 arma_extra_debug_sigprint();
|
max@0
|
426
|
max@0
|
427 typedef typename T1::elem_type eT;
|
max@0
|
428
|
max@0
|
429 const uword n_rows = x.get_n_rows();
|
max@0
|
430 const uword n_cols = x.get_n_cols();
|
max@0
|
431 const uword n_slices = x.get_n_slices();
|
max@0
|
432
|
max@0
|
433 arma_debug_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "element-wise multiplication");
|
max@0
|
434
|
max@0
|
435 eT* out_mem = out.memptr();
|
max@0
|
436 const uword n_elem = out.n_elem;
|
max@0
|
437
|
max@0
|
438 const eT k = x.aux;
|
max@0
|
439
|
max@0
|
440 if(ProxyCube<T1>::prefer_at_accessor == false)
|
max@0
|
441 {
|
max@0
|
442 typename ProxyCube<T1>::ea_type P = x.P.get_ea();
|
max@0
|
443
|
max@0
|
444 arma_applier_1(*=);
|
max@0
|
445 }
|
max@0
|
446 else
|
max@0
|
447 {
|
max@0
|
448 const ProxyCube<T1>& P = x.P;
|
max@0
|
449
|
max@0
|
450 arma_applier_3(*=);
|
max@0
|
451 }
|
max@0
|
452 }
|
max@0
|
453
|
max@0
|
454
|
max@0
|
455
|
max@0
|
456 template<typename eop_type>
|
max@0
|
457 template<typename T1>
|
max@0
|
458 arma_hot
|
max@0
|
459 inline
|
max@0
|
460 void
|
max@0
|
461 eop_core<eop_type>::apply_inplace_div(Cube<typename T1::elem_type>& out, const eOpCube<T1, eop_type>& x)
|
max@0
|
462 {
|
max@0
|
463 arma_extra_debug_sigprint();
|
max@0
|
464
|
max@0
|
465 typedef typename T1::elem_type eT;
|
max@0
|
466
|
max@0
|
467 const uword n_rows = x.get_n_rows();
|
max@0
|
468 const uword n_cols = x.get_n_cols();
|
max@0
|
469 const uword n_slices = x.get_n_slices();
|
max@0
|
470
|
max@0
|
471 arma_debug_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "element-wise division");
|
max@0
|
472
|
max@0
|
473 eT* out_mem = out.memptr();
|
max@0
|
474 const uword n_elem = out.n_elem;
|
max@0
|
475
|
max@0
|
476 const eT k = x.aux;
|
max@0
|
477
|
max@0
|
478 if(ProxyCube<T1>::prefer_at_accessor == false)
|
max@0
|
479 {
|
max@0
|
480 typename ProxyCube<T1>::ea_type P = x.P.get_ea();
|
max@0
|
481
|
max@0
|
482 arma_applier_1(/=);
|
max@0
|
483 }
|
max@0
|
484 else
|
max@0
|
485 {
|
max@0
|
486 const ProxyCube<T1>& P = x.P;
|
max@0
|
487
|
max@0
|
488 arma_applier_3(/=);
|
max@0
|
489 }
|
max@0
|
490 }
|
max@0
|
491
|
max@0
|
492
|
max@0
|
493
|
max@0
|
494 //
|
max@0
|
495 // common
|
max@0
|
496
|
max@0
|
497
|
max@0
|
498
|
max@0
|
499 template<typename eop_type>
|
max@0
|
500 template<typename eT>
|
max@0
|
501 arma_hot
|
max@0
|
502 arma_pure
|
max@0
|
503 arma_inline
|
max@0
|
504 eT
|
max@0
|
505 eop_core<eop_type>::process(const eT val, const eT k)
|
max@0
|
506 {
|
max@0
|
507 arma_ignore(val);
|
max@0
|
508 arma_ignore(k);
|
max@0
|
509
|
max@0
|
510 arma_stop("eop_core::process(): unhandled eop_type");
|
max@0
|
511 return eT(0);
|
max@0
|
512 }
|
max@0
|
513
|
max@0
|
514
|
max@0
|
515
|
max@0
|
516 template<> template<typename eT> arma_hot arma_const arma_inline eT
|
max@0
|
517 eop_core<eop_scalar_plus >::process(const eT val, const eT k) { return val + k; }
|
max@0
|
518
|
max@0
|
519 template<> template<typename eT> arma_hot arma_const arma_inline eT
|
max@0
|
520 eop_core<eop_scalar_minus_pre >::process(const eT val, const eT k) { return k - val; }
|
max@0
|
521
|
max@0
|
522 template<> template<typename eT> arma_hot arma_const arma_inline eT
|
max@0
|
523 eop_core<eop_scalar_minus_post>::process(const eT val, const eT k) { return val - k; }
|
max@0
|
524
|
max@0
|
525 template<> template<typename eT> arma_hot arma_const arma_inline eT
|
max@0
|
526 eop_core<eop_scalar_times >::process(const eT val, const eT k) { return val * k; }
|
max@0
|
527
|
max@0
|
528 template<> template<typename eT> arma_hot arma_const arma_inline eT
|
max@0
|
529 eop_core<eop_scalar_div_pre >::process(const eT val, const eT k) { return k / val; }
|
max@0
|
530
|
max@0
|
531 template<> template<typename eT> arma_hot arma_const arma_inline eT
|
max@0
|
532 eop_core<eop_scalar_div_post >::process(const eT val, const eT k) { return val / k; }
|
max@0
|
533
|
max@0
|
534 template<> template<typename eT> arma_hot arma_const arma_inline eT
|
max@0
|
535 eop_core<eop_square >::process(const eT val, const eT ) { return val*val; }
|
max@0
|
536
|
max@0
|
537 template<> template<typename eT> arma_hot arma_const arma_inline eT
|
max@0
|
538 eop_core<eop_neg >::process(const eT val, const eT ) { return eop_aux::neg(val); }
|
max@0
|
539
|
max@0
|
540 template<> template<typename eT> arma_hot arma_pure arma_inline eT
|
max@0
|
541 eop_core<eop_sqrt >::process(const eT val, const eT ) { return eop_aux::sqrt(val); }
|
max@0
|
542
|
max@0
|
543 template<> template<typename eT> arma_hot arma_pure arma_inline eT
|
max@0
|
544 eop_core<eop_log >::process(const eT val, const eT ) { return eop_aux::log(val); }
|
max@0
|
545
|
max@0
|
546 template<> template<typename eT> arma_hot arma_pure arma_inline eT
|
max@0
|
547 eop_core<eop_log2 >::process(const eT val, const eT ) { return eop_aux::log2(val); }
|
max@0
|
548
|
max@0
|
549 template<> template<typename eT> arma_hot arma_pure arma_inline eT
|
max@0
|
550 eop_core<eop_log10 >::process(const eT val, const eT ) { return eop_aux::log10(val); }
|
max@0
|
551
|
max@0
|
552 template<> template<typename eT> arma_hot arma_pure arma_inline eT
|
max@0
|
553 eop_core<eop_trunc_log >::process(const eT val, const eT ) { return arma::trunc_log(val); }
|
max@0
|
554
|
max@0
|
555 template<> template<typename eT> arma_hot arma_pure arma_inline eT
|
max@0
|
556 eop_core<eop_exp >::process(const eT val, const eT ) { return eop_aux::exp(val); }
|
max@0
|
557
|
max@0
|
558 template<> template<typename eT> arma_hot arma_pure arma_inline eT
|
max@0
|
559 eop_core<eop_exp2 >::process(const eT val, const eT ) { return eop_aux::exp2(val); }
|
max@0
|
560
|
max@0
|
561 template<> template<typename eT> arma_hot arma_pure arma_inline eT
|
max@0
|
562 eop_core<eop_exp10 >::process(const eT val, const eT ) { return eop_aux::exp10(val); }
|
max@0
|
563
|
max@0
|
564 template<> template<typename eT> arma_hot arma_pure arma_inline eT
|
max@0
|
565 eop_core<eop_trunc_exp >::process(const eT val, const eT ) { return arma::trunc_exp(val); }
|
max@0
|
566
|
max@0
|
567 template<> template<typename eT> arma_hot arma_pure arma_inline eT
|
max@0
|
568 eop_core<eop_cos >::process(const eT val, const eT ) { return eop_aux::cos(val); }
|
max@0
|
569
|
max@0
|
570 template<> template<typename eT> arma_hot arma_pure arma_inline eT
|
max@0
|
571 eop_core<eop_sin >::process(const eT val, const eT ) { return eop_aux::sin(val); }
|
max@0
|
572
|
max@0
|
573 template<> template<typename eT> arma_hot arma_pure arma_inline eT
|
max@0
|
574 eop_core<eop_tan >::process(const eT val, const eT ) { return eop_aux::tan(val); }
|
max@0
|
575
|
max@0
|
576 template<> template<typename eT> arma_hot arma_pure arma_inline eT
|
max@0
|
577 eop_core<eop_acos >::process(const eT val, const eT ) { return eop_aux::acos(val); }
|
max@0
|
578
|
max@0
|
579 template<> template<typename eT> arma_hot arma_pure arma_inline eT
|
max@0
|
580 eop_core<eop_asin >::process(const eT val, const eT ) { return eop_aux::asin(val); }
|
max@0
|
581
|
max@0
|
582 template<> template<typename eT> arma_hot arma_pure arma_inline eT
|
max@0
|
583 eop_core<eop_atan >::process(const eT val, const eT ) { return eop_aux::atan(val); }
|
max@0
|
584
|
max@0
|
585 template<> template<typename eT> arma_hot arma_pure arma_inline eT
|
max@0
|
586 eop_core<eop_cosh >::process(const eT val, const eT ) { return eop_aux::cosh(val); }
|
max@0
|
587
|
max@0
|
588 template<> template<typename eT> arma_hot arma_pure arma_inline eT
|
max@0
|
589 eop_core<eop_sinh >::process(const eT val, const eT ) { return eop_aux::sinh(val); }
|
max@0
|
590
|
max@0
|
591 template<> template<typename eT> arma_hot arma_pure arma_inline eT
|
max@0
|
592 eop_core<eop_tanh >::process(const eT val, const eT ) { return eop_aux::tanh(val); }
|
max@0
|
593
|
max@0
|
594 template<> template<typename eT> arma_hot arma_pure arma_inline eT
|
max@0
|
595 eop_core<eop_acosh >::process(const eT val, const eT ) { return eop_aux::acosh(val); }
|
max@0
|
596
|
max@0
|
597 template<> template<typename eT> arma_hot arma_pure arma_inline eT
|
max@0
|
598 eop_core<eop_asinh >::process(const eT val, const eT ) { return eop_aux::asinh(val); }
|
max@0
|
599
|
max@0
|
600 template<> template<typename eT> arma_hot arma_pure arma_inline eT
|
max@0
|
601 eop_core<eop_atanh >::process(const eT val, const eT ) { return eop_aux::atanh(val); }
|
max@0
|
602
|
max@0
|
603 template<> template<typename eT> arma_hot arma_pure arma_inline eT
|
max@0
|
604 eop_core<eop_eps >::process(const eT val, const eT ) { return eop_aux::direct_eps(val); }
|
max@0
|
605
|
max@0
|
606 template<> template<typename eT> arma_hot arma_pure arma_inline eT
|
max@0
|
607 eop_core<eop_abs >::process(const eT val, const eT ) { return eop_aux::arma_abs(val); }
|
max@0
|
608
|
max@0
|
609 template<> template<typename eT> arma_hot arma_pure arma_inline eT
|
max@0
|
610 eop_core<eop_conj >::process(const eT val, const eT ) { return eop_aux::conj(val); }
|
max@0
|
611
|
max@0
|
612 template<> template<typename eT> arma_hot arma_pure arma_inline eT
|
max@0
|
613 eop_core<eop_pow >::process(const eT val, const eT k) { return eop_aux::pow(val, k); }
|
max@0
|
614
|
max@0
|
615 template<> template<typename eT> arma_hot arma_pure arma_inline eT
|
max@0
|
616 eop_core<eop_floor >::process(const eT val, const eT ) { return eop_aux::floor(val); }
|
max@0
|
617
|
max@0
|
618 template<> template<typename eT> arma_hot arma_pure arma_inline eT
|
max@0
|
619 eop_core<eop_ceil >::process(const eT val, const eT ) { return eop_aux::ceil(val); }
|
max@0
|
620
|
max@0
|
621
|
max@0
|
622
|
max@0
|
623 #undef arma_applier_1
|
max@0
|
624 #undef arma_applier_2
|
max@0
|
625 #undef arma_applier_3
|
max@0
|
626
|
max@0
|
627
|
max@0
|
628
|
max@0
|
629 //! @}
|