Mercurial > hg > octave-nkf
annotate liboctave/numeric/bsxfun-defs.cc @ 17296:3a9efb68272d ss-3-7-6
snapshot 3.7.6
* configure.ac (OCTAVE_VERSION): Bump to 3.7.6.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 20 Aug 2013 15:17:54 -0400 |
parents | 648dabbb4c6b |
children | d63878346099 |
rev | line source |
---|---|
9747
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
1 /* |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
2 |
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
13704
diff
changeset
|
3 Copyright (C) 2009-2012 Jaroslav Hajek |
9747
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
4 Copyright (C) 2009 VZLU Prague |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
5 |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
6 This file is part of Octave. |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
7 |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
8 Octave is free software; you can redistribute it and/or modify it |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
9 under the terms of the GNU General Public License as published by the |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
10 Free Software Foundation; either version 3 of the License, or (at your |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
11 option) any later version. |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
12 |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
13 Octave is distributed in the hope that it will be useful, but WITHOUT |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
16 for more details. |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
17 |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
18 You should have received a copy of the GNU General Public License |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
19 along with Octave; see the file COPYING. If not, see |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
20 <http://www.gnu.org/licenses/>. |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
21 |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
22 */ |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
23 |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
24 #if !defined (octave_bsxfun_defs_h) |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
25 #define octave_bsxfun_defs_h 1 |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
26 |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
27 #include <algorithm> |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
28 #include <iostream> |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
29 |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
30 #include "dim-vector.h" |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
31 #include "oct-locbuf.h" |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
32 #include "lo-error.h" |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
33 |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
34 #include "mx-inlines.cc" |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
35 |
10362
b47ab50a6aa8
simplify appliers in mx-inlines.cc
Jaroslav Hajek <highegg@gmail.com>
parents:
10142
diff
changeset
|
36 template <class R, class X, class Y> |
b47ab50a6aa8
simplify appliers in mx-inlines.cc
Jaroslav Hajek <highegg@gmail.com>
parents:
10142
diff
changeset
|
37 Array<R> |
b47ab50a6aa8
simplify appliers in mx-inlines.cc
Jaroslav Hajek <highegg@gmail.com>
parents:
10142
diff
changeset
|
38 do_bsxfun_op (const Array<X>& x, const Array<Y>& y, |
b47ab50a6aa8
simplify appliers in mx-inlines.cc
Jaroslav Hajek <highegg@gmail.com>
parents:
10142
diff
changeset
|
39 void (*op_vv) (size_t, R *, const X *, const Y *), |
b47ab50a6aa8
simplify appliers in mx-inlines.cc
Jaroslav Hajek <highegg@gmail.com>
parents:
10142
diff
changeset
|
40 void (*op_sv) (size_t, R *, X, const Y *), |
b47ab50a6aa8
simplify appliers in mx-inlines.cc
Jaroslav Hajek <highegg@gmail.com>
parents:
10142
diff
changeset
|
41 void (*op_vs) (size_t, R *, const X *, Y)) |
9747
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
42 { |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
43 int nd = std::max (x.ndims (), y.ndims ()); |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
44 dim_vector dvx = x.dims ().redim (nd), dvy = y.dims ().redim (nd); |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
45 |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
46 // Construct the result dimensions. |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
47 dim_vector dvr; |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
48 dvr.resize (nd); |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
49 for (int i = 0; i < nd; i++) |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
50 { |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
51 octave_idx_type xk = dvx(i), yk = dvy(i); |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
52 if (xk == 1) |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
53 dvr(i) = yk; |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
54 else if (yk == 1 || xk == yk) |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
55 dvr(i) = xk; |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
56 else |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
57 { |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
58 (*current_liboctave_error_handler) |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
59 ("bsxfun: nonconformant dimensions: %s and %s", |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
60 x.dims ().str ().c_str (), y.dims ().str ().c_str ()); |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
61 break; |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
62 } |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
63 } |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
64 |
10362
b47ab50a6aa8
simplify appliers in mx-inlines.cc
Jaroslav Hajek <highegg@gmail.com>
parents:
10142
diff
changeset
|
65 Array<R> retval (dvr); |
9747
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
66 |
10362
b47ab50a6aa8
simplify appliers in mx-inlines.cc
Jaroslav Hajek <highegg@gmail.com>
parents:
10142
diff
changeset
|
67 const X *xvec = x.fortran_vec (); |
b47ab50a6aa8
simplify appliers in mx-inlines.cc
Jaroslav Hajek <highegg@gmail.com>
parents:
10142
diff
changeset
|
68 const Y *yvec = y.fortran_vec (); |
b47ab50a6aa8
simplify appliers in mx-inlines.cc
Jaroslav Hajek <highegg@gmail.com>
parents:
10142
diff
changeset
|
69 R *rvec = retval.fortran_vec (); |
9747
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
70 |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
71 // Fold the common leading dimensions. |
13704
6f779cc391fb
More 64bit integer type fixes for bsxfun-defs.cc
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13700
diff
changeset
|
72 octave_idx_type start, ldr = 1; |
9747
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
73 for (start = 0; start < nd; start++) |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
74 { |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
75 if (dvx(start) != dvy(start)) |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
76 break; |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
77 ldr *= dvr(start); |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
78 } |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
79 |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
80 if (retval.is_empty ()) |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
81 ; // do nothing |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
82 else if (start == nd) |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
83 op_vv (retval.numel (), rvec, xvec, yvec); |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
84 else |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
85 { |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
86 // Determine the type of the low-level loop. |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
87 bool xsing = false, ysing = false; |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
88 if (ldr == 1) |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
89 { |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
90 xsing = dvx(start) == 1; |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
91 ysing = dvy(start) == 1; |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
92 if (xsing || ysing) |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
93 { |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
94 ldr *= dvx(start) * dvy(start); |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
95 start++; |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
96 } |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
97 } |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
98 dim_vector cdvx = dvx.cumulative (), cdvy = dvy.cumulative (); |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
99 // Nullify singleton dims to achieve a spread effect. |
13700
782dc237a02d
Pass correct integer type to std::max in bsxfun-defs.cc
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13139
diff
changeset
|
100 for (int i = std::max (start, octave_idx_type (1)); i < nd; i++) |
9747
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
101 { |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
102 if (dvx(i) == 1) |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
103 cdvx(i-1) = 0; |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
104 if (dvy(i) == 1) |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
105 cdvy(i-1) = 0; |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
106 } |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
107 |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
108 octave_idx_type niter = dvr.numel (start); |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
109 // The index array. |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
110 OCTAVE_LOCAL_BUFFER_INIT (octave_idx_type, idx, nd, 0); |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
111 for (octave_idx_type iter = 0; iter < niter; iter++) |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
112 { |
10142
829e69ec3110
make OCTAVE_QUIT a function
Jaroslav Hajek <highegg@gmail.com>
parents:
10140
diff
changeset
|
113 octave_quit (); |
9827
c15a5ed0da58
optimize bsxfun (@power, ...)
Jaroslav Hajek <highegg@gmail.com>
parents:
9747
diff
changeset
|
114 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
115 // Compute indices. |
9747
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
116 // FIXME: performance impact noticeable? |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
117 octave_idx_type xidx = cdvx.cum_compute_index (idx); |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
118 octave_idx_type yidx = cdvy.cum_compute_index (idx); |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
119 octave_idx_type ridx = dvr.compute_index (idx); |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
120 |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
121 // Apply the low-level loop. |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
122 if (xsing) |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
123 op_sv (ldr, rvec + ridx, xvec[xidx], yvec + yidx); |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
124 else if (ysing) |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
125 op_vs (ldr, rvec + ridx, xvec + xidx, yvec[yidx]); |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
126 else |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
127 op_vv (ldr, rvec + ridx, xvec + xidx, yvec + yidx); |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
128 |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
129 dvr.increment_index (idx + start, start); |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
130 } |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
131 } |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
132 |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
133 return retval; |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
134 } |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
135 |
13139
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
136 template <class R, class X> |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
137 void |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
138 do_inplace_bsxfun_op (Array<R>& r, const Array<X>& x, |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
139 void (*op_vv) (size_t, R *, const X *), |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
140 void (*op_vs) (size_t, R *, X)) |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
141 { |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
142 dim_vector dvr = r.dims (), dvx = x.dims (); |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
143 octave_idx_type nd = r.ndims (); |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
144 dvx.redim (nd); |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
145 |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
146 const X* xvec = x.fortran_vec (); |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
147 R* rvec = r.fortran_vec (); |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
148 |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
149 // Fold the common leading dimensions. |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
150 octave_idx_type start, ldr = 1; |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
151 for (start = 0; start < nd; start++) |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
152 { |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
153 if (dvr(start) != dvx(start)) |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
154 break; |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
155 ldr *= dvr(start); |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
156 } |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
157 |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
158 if (r.is_empty ()) |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
159 ; // do nothing |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
160 else if (start == nd) |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
161 op_vv (r.numel (), rvec, xvec); |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
162 else |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
163 { |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
164 // Determine the type of the low-level loop. |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
165 bool xsing = false; |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
166 if (ldr == 1) |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
167 { |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
168 xsing = dvx(start) == 1; |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
169 if (xsing) |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
170 { |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
171 ldr *= dvr(start) * dvx(start); |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
172 start++; |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
173 } |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
174 } |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
175 |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
176 dim_vector cdvx = dvx.cumulative (); |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
177 // Nullify singleton dims to achieve a spread effect. |
13700
782dc237a02d
Pass correct integer type to std::max in bsxfun-defs.cc
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13139
diff
changeset
|
178 for (int i = std::max (start, octave_idx_type (1)); i < nd; i++) |
13139
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
179 { |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
180 if (dvx(i) == 1) |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
181 cdvx(i-1) = 0; |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
182 } |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
183 |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
184 octave_idx_type niter = dvr.numel (start); |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
185 // The index array. |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
186 OCTAVE_LOCAL_BUFFER_INIT (octave_idx_type, idx, nd, 0); |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
187 for (octave_idx_type iter = 0; iter < niter; iter++) |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
188 { |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
189 octave_quit (); |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
190 |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
191 // Compute indices. |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
192 // FIXME: performance impact noticeable? |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
193 octave_idx_type xidx = cdvx.cum_compute_index (idx); |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
194 octave_idx_type ridx = dvr.compute_index (idx); |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
195 |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
196 // Apply the low-level loop. |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
197 if (xsing) |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
198 op_vs (ldr, rvec + ridx, xvec[xidx]); |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
199 else |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
200 op_vv (ldr, rvec + ridx, xvec + xidx); |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
201 |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
202 dvr.increment_index (idx + start, start); |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
203 } |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
204 } |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
205 } |
aa4a23337a0f
Enable BSX in-place for missing assignment operators
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13012
diff
changeset
|
206 |
9747
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
207 #define BSXFUN_OP_DEF(OP, ARRAY) \ |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
208 ARRAY bsxfun_ ## OP (const ARRAY& x, const ARRAY& y) |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
209 |
9827
c15a5ed0da58
optimize bsxfun (@power, ...)
Jaroslav Hajek <highegg@gmail.com>
parents:
9747
diff
changeset
|
210 #define BSXFUN_OP2_DEF(OP, ARRAY, ARRAY1, ARRAY2) \ |
c15a5ed0da58
optimize bsxfun (@power, ...)
Jaroslav Hajek <highegg@gmail.com>
parents:
9747
diff
changeset
|
211 ARRAY bsxfun_ ## OP (const ARRAY1& x, const ARRAY2& y) |
c15a5ed0da58
optimize bsxfun (@power, ...)
Jaroslav Hajek <highegg@gmail.com>
parents:
9747
diff
changeset
|
212 |
9747
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
213 #define BSXFUN_REL_DEF(OP, ARRAY) \ |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
214 boolNDArray bsxfun_ ## OP (const ARRAY& x, const ARRAY& y) |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
215 |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
216 #define BSXFUN_OP_DEF_MXLOOP(OP, ARRAY, LOOP) \ |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
217 BSXFUN_OP_DEF(OP, ARRAY) \ |
10362
b47ab50a6aa8
simplify appliers in mx-inlines.cc
Jaroslav Hajek <highegg@gmail.com>
parents:
10142
diff
changeset
|
218 { return do_bsxfun_op<ARRAY::element_type, ARRAY::element_type, ARRAY::element_type> \ |
b47ab50a6aa8
simplify appliers in mx-inlines.cc
Jaroslav Hajek <highegg@gmail.com>
parents:
10142
diff
changeset
|
219 (x, y, LOOP, LOOP, LOOP); } |
9747
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
220 |
9827
c15a5ed0da58
optimize bsxfun (@power, ...)
Jaroslav Hajek <highegg@gmail.com>
parents:
9747
diff
changeset
|
221 #define BSXFUN_OP2_DEF_MXLOOP(OP, ARRAY, ARRAY1, ARRAY2, LOOP) \ |
c15a5ed0da58
optimize bsxfun (@power, ...)
Jaroslav Hajek <highegg@gmail.com>
parents:
9747
diff
changeset
|
222 BSXFUN_OP2_DEF(OP, ARRAY, ARRAY1, ARRAY2) \ |
10362
b47ab50a6aa8
simplify appliers in mx-inlines.cc
Jaroslav Hajek <highegg@gmail.com>
parents:
10142
diff
changeset
|
223 { return do_bsxfun_op<ARRAY::element_type, ARRAY1::element_type, ARRAY2::element_type> \ |
b47ab50a6aa8
simplify appliers in mx-inlines.cc
Jaroslav Hajek <highegg@gmail.com>
parents:
10142
diff
changeset
|
224 (x, y, LOOP, LOOP, LOOP); } |
9827
c15a5ed0da58
optimize bsxfun (@power, ...)
Jaroslav Hajek <highegg@gmail.com>
parents:
9747
diff
changeset
|
225 |
9747
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
226 #define BSXFUN_REL_DEF_MXLOOP(OP, ARRAY, LOOP) \ |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
227 BSXFUN_REL_DEF(OP, ARRAY) \ |
10362
b47ab50a6aa8
simplify appliers in mx-inlines.cc
Jaroslav Hajek <highegg@gmail.com>
parents:
10142
diff
changeset
|
228 { return do_bsxfun_op<bool, ARRAY::element_type, ARRAY::element_type> \ |
b47ab50a6aa8
simplify appliers in mx-inlines.cc
Jaroslav Hajek <highegg@gmail.com>
parents:
10142
diff
changeset
|
229 (x, y, LOOP, LOOP, LOOP); } |
9747
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
230 |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
231 #define BSXFUN_STDOP_DEFS_MXLOOP(ARRAY) \ |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
232 BSXFUN_OP_DEF_MXLOOP (add, ARRAY, mx_inline_add) \ |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
233 BSXFUN_OP_DEF_MXLOOP (sub, ARRAY, mx_inline_sub) \ |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
234 BSXFUN_OP_DEF_MXLOOP (mul, ARRAY, mx_inline_mul) \ |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
235 BSXFUN_OP_DEF_MXLOOP (div, ARRAY, mx_inline_div) \ |
10140
36ea14c8992d
fix reversed min/max in bsxfun
Jaroslav Hajek <highegg@gmail.com>
parents:
9827
diff
changeset
|
236 BSXFUN_OP_DEF_MXLOOP (min, ARRAY, mx_inline_xmin) \ |
36ea14c8992d
fix reversed min/max in bsxfun
Jaroslav Hajek <highegg@gmail.com>
parents:
9827
diff
changeset
|
237 BSXFUN_OP_DEF_MXLOOP (max, ARRAY, mx_inline_xmax) \ |
9747
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
238 |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
239 #define BSXFUN_STDREL_DEFS_MXLOOP(ARRAY) \ |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
240 BSXFUN_REL_DEF_MXLOOP (eq, ARRAY, mx_inline_eq) \ |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
241 BSXFUN_REL_DEF_MXLOOP (ne, ARRAY, mx_inline_ne) \ |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
242 BSXFUN_REL_DEF_MXLOOP (lt, ARRAY, mx_inline_lt) \ |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
243 BSXFUN_REL_DEF_MXLOOP (le, ARRAY, mx_inline_le) \ |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
244 BSXFUN_REL_DEF_MXLOOP (gt, ARRAY, mx_inline_gt) \ |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
245 BSXFUN_REL_DEF_MXLOOP (ge, ARRAY, mx_inline_ge) |
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
246 |
13012
15eefbd9d4e8
Implement a few missing automatic bsxfun power operators
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
11586
diff
changeset
|
247 //For bsxfun power with mixed integer/float types |
15eefbd9d4e8
Implement a few missing automatic bsxfun power operators
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
11586
diff
changeset
|
248 #define BSXFUN_POW_MIXED_MXLOOP(INT_TYPE) \ |
15eefbd9d4e8
Implement a few missing automatic bsxfun power operators
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
11586
diff
changeset
|
249 BSXFUN_OP2_DEF_MXLOOP (pow, INT_TYPE, INT_TYPE, NDArray, mx_inline_pow) \ |
15eefbd9d4e8
Implement a few missing automatic bsxfun power operators
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
11586
diff
changeset
|
250 BSXFUN_OP2_DEF_MXLOOP (pow, INT_TYPE, INT_TYPE, FloatNDArray, mx_inline_pow)\ |
15eefbd9d4e8
Implement a few missing automatic bsxfun power operators
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
11586
diff
changeset
|
251 BSXFUN_OP2_DEF_MXLOOP (pow, INT_TYPE, NDArray, INT_TYPE, mx_inline_pow) \ |
15eefbd9d4e8
Implement a few missing automatic bsxfun power operators
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
11586
diff
changeset
|
252 BSXFUN_OP2_DEF_MXLOOP (pow, INT_TYPE, FloatNDArray, INT_TYPE, mx_inline_pow) |
15eefbd9d4e8
Implement a few missing automatic bsxfun power operators
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
11586
diff
changeset
|
253 |
9747
7bda650b691a
add omitted files from 26abff55f6fe
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
254 #endif |