Mercurial > octave-nkf
annotate src/OPERATORS/op-int.h @ 8150:283989f2da9b
make null assignment matlab compatible
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Fri, 26 Sep 2008 11:52:01 -0400 |
parents | cd90e2842080 |
children | 280fae940bb0 |
rev | line source |
---|---|
4905 | 1 /* |
2 | |
7017 | 3 Copyright (C) 1996, 1997, 2004, 2005, 2006, 2007 John W. Eaton |
4905 | 4 |
5 This file is part of Octave. | |
6 | |
7 Octave is free software; you can redistribute it and/or modify it | |
8 under the terms of the GNU General Public License as published by the | |
7016 | 9 Free Software Foundation; either version 3 of the License, or (at your |
10 option) any later version. | |
4905 | 11 |
12 Octave is distributed in the hope that it will be useful, but WITHOUT | |
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
7016 | 18 along with Octave; see the file COPYING. If not, see |
19 <http://www.gnu.org/licenses/>. | |
4905 | 20 |
21 */ | |
22 | |
4952 | 23 #include "quit.h" |
24 | |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
25 #define DEFINTBINOP_OP(name, t1, t2, op, t3) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
26 BINOPDECL (name, a1, a2) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
27 { \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
28 CAST_BINOP_ARGS (const octave_ ## t1&, const octave_ ## t2&); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
29 octave_value retval = octave_value \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
30 (v1.t1 ## _value () op v2.t2 ## _value ()); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
31 if (octave_ ## t3 ::get_math_trunc_flag ()) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
32 gripe_binop_integer_math_truncated (#op, v1.type_name (). c_str (), \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
33 v2.type_name (). c_str ()); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
34 octave_ ## t3 ::clear_conv_flag (); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
35 return retval; \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
36 } |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
37 |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
38 #define DEFINTNDBINOP_OP(name, t1, t2, e1, e2, op, t3) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
39 BINOPDECL (name, a1, a2) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
40 { \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
41 CAST_BINOP_ARGS (const octave_ ## t1&, const octave_ ## t2&); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
42 octave_value retval = octave_value \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
43 (v1.e1 ## _value () op v2.e2 ## _value ()); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
44 if (octave_ ## t3 ::get_math_trunc_flag ()) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
45 gripe_binop_integer_math_truncated (#op, v1.type_name (). c_str (), \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
46 v2.type_name (). c_str ()); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
47 octave_ ## t3 ::clear_conv_flag (); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
48 return retval; \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
49 } |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
50 |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
51 #define DEFINTBINOP_FN(name, t1, t2, f, t3, op) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
52 BINOPDECL (name, a1, a2) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
53 { \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
54 CAST_BINOP_ARGS (const octave_ ## t1&, const octave_ ## t2&); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
55 octave_value retval = octave_value (f (v1.t1 ## _value (), v2.t2 ## _value ())); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
56 if (octave_ ## t3 ::get_math_trunc_flag ()) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
57 gripe_binop_integer_math_truncated (#op, v1.type_name (). c_str (), \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
58 v2.type_name (). c_str ()); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
59 octave_ ## t3 ::clear_conv_flag (); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
60 return retval; \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
61 } |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
62 |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
63 #define DEFINTNDBINOP_FN(name, t1, t2, e1, e2, f, t3, op) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
64 BINOPDECL (name, a1, a2) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
65 { \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
66 CAST_BINOP_ARGS (const octave_ ## t1&, const octave_ ## t2&); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
67 octave_value retval = octave_value (f (v1.e1 ## _value (), v2.e2 ## _value ())); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
68 if (octave_ ## t3 ::get_math_trunc_flag ()) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
69 gripe_binop_integer_math_truncated (#op, v1.type_name (). c_str (), \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
70 v2.type_name (). c_str ()); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
71 octave_ ## t3 ::clear_conv_flag (); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
72 return retval; \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
73 } |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
74 |
5075 | 75 #define OCTAVE_CONCAT_FN2(T1, T2) \ |
76 DEFNDCATOP_FN2 (T1 ## _ ## T2 ## _s_s, T1 ## _scalar, T2 ## _scalar, , T1 ## NDArray, T1 ## _array, T2 ## _array, concat) \ | |
77 DEFNDCATOP_FN2 (T1 ## _ ## T2 ## _s_m, T1 ## _scalar, T2 ## _matrix, , T1 ## NDArray, T1 ## _array, T2 ## _array, concat) \ | |
78 DEFNDCATOP_FN2 (T1 ## _ ## T2 ## _m_s, T1 ## _matrix, T2 ## _scalar, , T1 ## NDArray, T1 ## _array, T2 ## _array, concat) \ | |
79 DEFNDCATOP_FN2 (T1 ## _ ## T2 ## _m_m, T1 ## _matrix, T2 ## _matrix, , T1 ## NDArray, T1 ## _array, T2 ## _array, concat) | |
80 | |
81 #define OCTAVE_INSTALL_CONCAT_FN2(T1, T2) \ | |
82 INSTALL_CATOP (octave_ ## T1 ## _scalar, octave_ ## T2 ## _scalar, T1 ## _ ## T2 ## _s_s) \ | |
83 INSTALL_CATOP (octave_ ## T1 ## _scalar, octave_ ## T2 ## _matrix, T1 ## _ ## T2 ## _s_m) \ | |
84 INSTALL_CATOP (octave_ ## T1 ## _matrix, octave_ ## T2 ## _scalar, T1 ## _ ## T2 ## _m_s) \ | |
85 INSTALL_CATOP (octave_ ## T1 ## _matrix, octave_ ## T2 ## _matrix, T1 ## _ ## T2 ## _m_m) | |
86 | |
87 #define OCTAVE_DOUBLE_INT_CONCAT_FN(TYPE) \ | |
88 DEFNDCATOP_FN2 (double ## _ ## TYPE ## _s_s, scalar, TYPE ## _scalar, TYPE ## NDArray, , array, TYPE ## _array, concat) \ | |
89 DEFNDCATOP_FN2 (double ## _ ## TYPE ## _s_m, scalar, TYPE ## _matrix, TYPE ## NDArray, , array, TYPE ## _array, concat) \ | |
90 DEFNDCATOP_FN2 (double ## _ ## TYPE ## _m_s, matrix, TYPE ## _scalar, TYPE ## NDArray, , array, TYPE ## _array, concat) \ | |
91 DEFNDCATOP_FN2 (double ## _ ## TYPE ## _m_m, matrix, TYPE ## _matrix, TYPE ## NDArray, , array, TYPE ## _array, concat) | |
92 | |
93 #define OCTAVE_INSTALL_DOUBLE_INT_CONCAT_FN(TYPE) \ | |
94 INSTALL_CATOP (octave_scalar, octave_ ## TYPE ## _scalar, double ## _ ## TYPE ## _s_s) \ | |
95 INSTALL_CATOP (octave_scalar, octave_ ## TYPE ## _matrix, double ## _ ## TYPE ## _s_m) \ | |
96 INSTALL_CATOP (octave_matrix, octave_ ## TYPE ## _scalar, double ## _ ## TYPE ## _m_s) \ | |
97 INSTALL_CATOP (octave_matrix, octave_ ## TYPE ## _matrix, double ## _ ## TYPE ## _m_m) | |
98 | |
99 #define OCTAVE_INT_DOUBLE_CONCAT_FN(TYPE) \ | |
100 DEFNDCATOP_FN2 (TYPE ## _ ## double ## _s_s, TYPE ## _scalar, scalar, , TYPE ## NDArray, TYPE ## _array, array, concat) \ | |
101 DEFNDCATOP_FN2 (TYPE ## _ ## double ## _s_m, TYPE ## _scalar, matrix, , TYPE ## NDArray, TYPE ## _array, array, concat) \ | |
102 DEFNDCATOP_FN2 (TYPE ## _ ## double ## _m_s, TYPE ## _matrix, scalar, , TYPE ## NDArray, TYPE ## _array, array, concat) \ | |
103 DEFNDCATOP_FN2 (TYPE ## _ ## double ## _m_m, TYPE ## _matrix, matrix, , TYPE ## NDArray, TYPE ## _array, array, concat) | |
104 | |
105 #define OCTAVE_INSTALL_INT_DOUBLE_CONCAT_FN(TYPE) \ | |
106 INSTALL_CATOP (octave_ ## TYPE ## _scalar, octave_scalar, TYPE ## _ ## double ## _s_s) \ | |
107 INSTALL_CATOP (octave_ ## TYPE ## _scalar, octave_matrix, TYPE ## _ ## double ## _s_m) \ | |
108 INSTALL_CATOP (octave_ ## TYPE ## _matrix, octave_scalar, TYPE ## _ ## double ## _m_s) \ | |
109 INSTALL_CATOP (octave_ ## TYPE ## _matrix, octave_matrix, TYPE ## _ ## double ## _m_m) | |
110 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
111 #define OCTAVE_FLOAT_INT_CONCAT_FN(TYPE) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
112 DEFNDCATOP_FN2 (float ## _ ## TYPE ## _s_s, float_scalar, TYPE ## _scalar, TYPE ## NDArray, , float_array, TYPE ## _array, concat) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
113 DEFNDCATOP_FN2 (float ## _ ## TYPE ## _s_m, float_scalar, TYPE ## _matrix, TYPE ## NDArray, , float_array, TYPE ## _array, concat) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
114 DEFNDCATOP_FN2 (float ## _ ## TYPE ## _m_s, float_matrix, TYPE ## _scalar, TYPE ## NDArray, , float_array, TYPE ## _array, concat) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
115 DEFNDCATOP_FN2 (float ## _ ## TYPE ## _m_m, float_matrix, TYPE ## _matrix, TYPE ## NDArray, , float_array, TYPE ## _array, concat) |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
116 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
117 #define OCTAVE_INSTALL_FLOAT_INT_CONCAT_FN(TYPE) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
118 INSTALL_CATOP (octave_float_scalar, octave_ ## TYPE ## _scalar, float ## _ ## TYPE ## _s_s) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
119 INSTALL_CATOP (octave_float_scalar, octave_ ## TYPE ## _matrix, float ## _ ## TYPE ## _s_m) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
120 INSTALL_CATOP (octave_float_matrix, octave_ ## TYPE ## _scalar, float ## _ ## TYPE ## _m_s) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
121 INSTALL_CATOP (octave_float_matrix, octave_ ## TYPE ## _matrix, float ## _ ## TYPE ## _m_m) |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
122 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
123 #define OCTAVE_INT_FLOAT_CONCAT_FN(TYPE) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
124 DEFNDCATOP_FN2 (TYPE ## _ ## float ## _s_s, TYPE ## _scalar, float_scalar, , TYPE ## NDArray, TYPE ## _array, float_array, concat) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
125 DEFNDCATOP_FN2 (TYPE ## _ ## float ## _s_m, TYPE ## _scalar, float_matrix, , TYPE ## NDArray, TYPE ## _array, float_array, concat) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
126 DEFNDCATOP_FN2 (TYPE ## _ ## float ## _m_s, TYPE ## _matrix, float_scalar, , TYPE ## NDArray, TYPE ## _array, float_array, concat) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
127 DEFNDCATOP_FN2 (TYPE ## _ ## float ## _m_m, TYPE ## _matrix, float_matrix, , TYPE ## NDArray, TYPE ## _array, float_array, concat) |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
128 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
129 #define OCTAVE_INSTALL_INT_FLOAT_CONCAT_FN(TYPE) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
130 INSTALL_CATOP (octave_ ## TYPE ## _scalar, octave_float_scalar, TYPE ## _ ## float ## _s_s) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
131 INSTALL_CATOP (octave_ ## TYPE ## _scalar, octave_float_matrix, TYPE ## _ ## float ## _s_m) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
132 INSTALL_CATOP (octave_ ## TYPE ## _matrix, octave_float_scalar, TYPE ## _ ## float ## _m_s) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
133 INSTALL_CATOP (octave_ ## TYPE ## _matrix, octave_float_matrix, TYPE ## _ ## float ## _m_m) |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
134 |
5533 | 135 // For compatibility, concatenation with a character always returns a |
136 // character. | |
137 | |
138 #define OCTAVE_CHAR_INT_CONCAT_FN(TYPE) \ | |
139 DEFNDCHARCATOP_FN (char ## _ ## TYPE ## _m_s, char_matrix, TYPE ## _scalar, concat) \ | |
140 DEFNDCHARCATOP_FN (char ## _ ## TYPE ## _m_m, char_matrix, TYPE ## _matrix, concat) | |
141 | |
142 #define OCTAVE_INSTALL_CHAR_INT_CONCAT_FN(TYPE) \ | |
143 INSTALL_CATOP (octave_char_matrix_str, octave_ ## TYPE ## _scalar, char ## _ ## TYPE ## _m_s) \ | |
144 INSTALL_CATOP (octave_char_matrix_str, octave_ ## TYPE ## _matrix, char ## _ ## TYPE ## _m_m) \ | |
145 INSTALL_CATOP (octave_char_matrix_sq_str, octave_ ## TYPE ## _scalar, char ## _ ## TYPE ## _m_s) \ | |
146 INSTALL_CATOP (octave_char_matrix_sq_str, octave_ ## TYPE ## _matrix, char ## _ ## TYPE ## _m_m) | |
147 | |
148 #define OCTAVE_INT_CHAR_CONCAT_FN(TYPE) \ | |
149 DEFNDCHARCATOP_FN (TYPE ## _ ## char ## _s_m, TYPE ## _scalar, char_matrix, concat) \ | |
150 DEFNDCHARCATOP_FN (TYPE ## _ ## char ## _m_m, TYPE ## _matrix, char_matrix, concat) | |
151 | |
152 #define OCTAVE_INSTALL_INT_CHAR_CONCAT_FN(TYPE) \ | |
153 INSTALL_CATOP (octave_ ## TYPE ## _scalar, octave_char_matrix_str, TYPE ## _ ## char ## _s_m) \ | |
154 INSTALL_CATOP (octave_ ## TYPE ## _matrix, octave_char_matrix_str, TYPE ## _ ## char ## _m_m) \ | |
155 INSTALL_CATOP (octave_ ## TYPE ## _scalar, octave_char_matrix_sq_str, TYPE ## _ ## char ## _s_m) \ | |
156 INSTALL_CATOP (octave_ ## TYPE ## _matrix, octave_char_matrix_sq_str, TYPE ## _ ## char ## _m_m) | |
157 | |
4915 | 158 #define OCTAVE_CONCAT_FN(TYPE) \ |
159 DEFNDCATOP_FN (TYPE ## _s_s, TYPE ## _scalar, TYPE ## _scalar, TYPE ## _array, TYPE ## _array, concat) \ | |
160 DEFNDCATOP_FN (TYPE ## _s_m, TYPE ## _scalar, TYPE ## _matrix, TYPE ## _array, TYPE ## _array, concat) \ | |
161 DEFNDCATOP_FN (TYPE ## _m_s, TYPE ## _matrix, TYPE ## _scalar, TYPE ## _array, TYPE ## _array, concat) \ | |
162 DEFNDCATOP_FN (TYPE ## _m_m, TYPE ## _matrix, TYPE ## _matrix, TYPE ## _array, TYPE ## _array, concat) | |
163 | |
164 #define OCTAVE_INSTALL_CONCAT_FN(TYPE) \ | |
165 INSTALL_CATOP (octave_ ## TYPE ## _scalar, octave_ ## TYPE ## _scalar, TYPE ## _s_s) \ | |
166 INSTALL_CATOP (octave_ ## TYPE ## _scalar, octave_ ## TYPE ## _matrix, TYPE ## _s_m) \ | |
167 INSTALL_CATOP (octave_ ## TYPE ## _matrix, octave_ ## TYPE ## _scalar, TYPE ## _m_s) \ | |
168 INSTALL_CATOP (octave_ ## TYPE ## _matrix, octave_ ## TYPE ## _matrix, TYPE ## _m_m) | |
169 | |
4905 | 170 #define OCTAVE_S_INT_UNOPS(TYPE) \ |
171 /* scalar unary ops. */ \ | |
172 \ | |
173 DEFUNOP_OP (s_not, TYPE ## _scalar, !) \ | |
4965 | 174 DEFUNOP_OP (s_uplus, TYPE ## _scalar, /* no-op */) \ |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
175 DEFUNOP (s_uminus, TYPE ## _scalar) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
176 { \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
177 CAST_UNOP_ARG (const octave_ ## TYPE ## _scalar &); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
178 octave_value retval = octave_value (- v. TYPE ## _scalar_value ()); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
179 if (octave_ ## TYPE ::get_math_trunc_flag ()) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
180 gripe_unop_integer_math_truncated ("-", v.type_name (). c_str ()); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
181 octave_ ## TYPE ::clear_conv_flag (); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
182 return retval; \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
183 } \ |
4905 | 184 DEFUNOP_OP (s_transpose, TYPE ## _scalar, /* no-op */) \ |
185 DEFUNOP_OP (s_hermitian, TYPE ## _scalar, /* no-op */) \ | |
186 \ | |
5829 | 187 DEFNCUNOP_METHOD (s_incr, TYPE ## _scalar, increment) \ |
188 DEFNCUNOP_METHOD (s_decr, TYPE ## _scalar, decrement) | |
4905 | 189 |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
190 #define OCTAVE_SS_INT_ARITH_OPS(PFX, T1, T2, T3) \ |
4905 | 191 /* scalar by scalar ops. */ \ |
192 \ | |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
193 DEFINTBINOP_OP (PFX ## _add, T1 ## scalar, T2 ## scalar, +, T3) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
194 DEFINTBINOP_OP (PFX ## _sub, T1 ## scalar, T2 ## scalar, -, T3) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
195 DEFINTBINOP_OP (PFX ## _mul, T1 ## scalar, T2 ## scalar, *, T3) \ |
4905 | 196 \ |
4953 | 197 DEFBINOP (PFX ## _div, T1 ## scalar, T2 ## scalar) \ |
4905 | 198 { \ |
4953 | 199 CAST_BINOP_ARGS (const octave_ ## T1 ## scalar&, const octave_ ## T2 ## scalar&); \ |
4905 | 200 \ |
4953 | 201 if (! v2.T2 ## scalar_value ()) \ |
4905 | 202 gripe_divide_by_zero (); \ |
203 \ | |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
204 octave_value retval = octave_value (v1.T1 ## scalar_value () / v2.T2 ## scalar_value ()); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
205 if (octave_ ## T3 ::get_math_trunc_flag ()) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
206 gripe_binop_integer_math_truncated ("/", v1.type_name (). c_str (), \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
207 v2.type_name (). c_str ()); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
208 octave_ ## T3 ::clear_conv_flag (); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
209 return retval; \ |
4905 | 210 } \ |
211 \ | |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
212 DEFINTBINOP_FN (PFX ## _pow, T1 ## scalar, T2 ## scalar, xpow, T3, ^) \ |
4905 | 213 \ |
4953 | 214 DEFBINOP (PFX ## _ldiv, T1 ## scalar, T2 ## scalar) \ |
4905 | 215 { \ |
4953 | 216 CAST_BINOP_ARGS (const octave_ ## T1 ## scalar&, const octave_ ## T2 ## scalar&); \ |
4905 | 217 \ |
4953 | 218 if (! v1.T1 ## scalar_value ()) \ |
4905 | 219 gripe_divide_by_zero (); \ |
220 \ | |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
221 octave_value retval = octave_value (v2.T2 ## scalar_value () / v1.T1 ## scalar_value ()); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
222 if (octave_ ## T3 ::get_math_trunc_flag ()) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
223 gripe_binop_integer_math_truncated ("\\", v1.type_name (). c_str (), \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
224 v2.type_name (). c_str ()); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
225 octave_ ## T3 ::clear_conv_flag (); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
226 return retval; \ |
4953 | 227 } \ |
228 \ | |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
229 DEFINTBINOP_OP (PFX ## _el_mul, T1 ## scalar, T2 ## scalar, *, T3) \ |
4953 | 230 \ |
231 DEFBINOP (PFX ## _el_div, T1 ## scalar, T2 ## scalar) \ | |
232 { \ | |
233 CAST_BINOP_ARGS (const octave_ ## T1 ## scalar&, const octave_ ## T2 ## scalar&); \ | |
234 \ | |
235 if (! v2.T2 ## scalar_value ()) \ | |
236 gripe_divide_by_zero (); \ | |
237 \ | |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
238 octave_value retval = octave_value (v1.T1 ## scalar_value () / v2.T2 ## scalar_value ()); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
239 if (octave_ ## T3 ::get_math_trunc_flag ()) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
240 gripe_binop_integer_math_truncated (".\\", v1.type_name (). c_str (), \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
241 v2.type_name (). c_str ()); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
242 octave_ ## T3 ::clear_conv_flag (); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
243 return retval; \ |
4905 | 244 } \ |
245 \ | |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
246 DEFINTBINOP_FN (PFX ## _el_pow, T1 ## scalar, T2 ## scalar, xpow, T3, .^) \ |
4905 | 247 \ |
4953 | 248 DEFBINOP (PFX ## _el_ldiv, T1 ## scalar, T2 ## scalar) \ |
4905 | 249 { \ |
4953 | 250 CAST_BINOP_ARGS (const octave_ ## T1 ## scalar&, const octave_ ## T2 ## scalar&); \ |
4905 | 251 \ |
4953 | 252 if (! v1.T1 ## scalar_value ()) \ |
4905 | 253 gripe_divide_by_zero (); \ |
254 \ | |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
255 octave_value retval = octave_value (v2.T2 ## scalar_value () / v1.T1 ## scalar_value ()); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
256 if (octave_ ## T3 ::get_math_trunc_flag ()) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
257 gripe_binop_integer_math_truncated (".\\", v1.type_name (). c_str (), \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
258 v2.type_name (). c_str ()); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
259 octave_ ## T3 ::clear_conv_flag (); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
260 return retval; \ |
4953 | 261 } \ |
262 | |
5030 | 263 #define OCTAVE_SS_INT_BOOL_OPS(PFX, T1, T2, Z1, Z2) \ |
4964 | 264 DEFBINOP (PFX ## _el_and, T2, T2) \ |
265 { \ | |
266 CAST_BINOP_ARGS (const octave_ ## T1 ## scalar&, const octave_ ## T2 ## scalar&); \ | |
267 \ | |
5030 | 268 return v1.T1 ## scalar_value () != Z1 && v2.T2 ## scalar_value () != Z2; \ |
4964 | 269 } \ |
270 \ | |
271 DEFBINOP (PFX ## _el_or, T1, T2) \ | |
272 { \ | |
273 CAST_BINOP_ARGS (const octave_ ## T1 ## scalar&, const octave_ ## T2 ## scalar&); \ | |
274 \ | |
5030 | 275 return v1.T1 ## scalar_value () != Z1 || v2.T2 ## scalar_value () != Z2; \ |
4964 | 276 } |
4953 | 277 |
278 #define OCTAVE_SS_INT_CMP_OPS(PFX, T1, T2) \ | |
279 DEFBINOP_OP (PFX ## _lt, T1 ## scalar, T2 ## scalar, <) \ | |
280 DEFBINOP_OP (PFX ## _le, T1 ## scalar, T2 ## scalar, <=) \ | |
281 DEFBINOP_OP (PFX ## _eq, T1 ## scalar, T2 ## scalar, ==) \ | |
282 DEFBINOP_OP (PFX ## _ge, T1 ## scalar, T2 ## scalar, >=) \ | |
283 DEFBINOP_OP (PFX ## _gt, T1 ## scalar, T2 ## scalar, >) \ | |
284 DEFBINOP_OP (PFX ## _ne, T1 ## scalar, T2 ## scalar, !=) | |
285 | |
286 #define OCTAVE_SS_POW_OPS(T1, T2) \ | |
287 octave_value \ | |
288 xpow (const octave_ ## T1& a, const octave_ ## T2& b) \ | |
289 { \ | |
290 return pow (a, b); \ | |
4905 | 291 } \ |
292 \ | |
4953 | 293 octave_value \ |
294 xpow (const octave_ ## T1& a, double b) \ | |
4905 | 295 { \ |
4953 | 296 return pow (a, b); \ |
4905 | 297 } \ |
4953 | 298 \ |
299 octave_value \ | |
300 xpow (double a, const octave_ ## T1& b) \ | |
301 { \ | |
302 return pow (a, b); \ | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
303 } \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
304 \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
305 octave_value \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
306 xpow (const octave_ ## T1& a, float b) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
307 { \ |
7914
e998e81224b5
Various compilation fixes for MSVC.
John W. Eaton <jwe@octave.org>
parents:
7789
diff
changeset
|
308 return powf (a, b); \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
309 } \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
310 \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
311 octave_value \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
312 xpow (float a, const octave_ ## T1& b) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
313 { \ |
7914
e998e81224b5
Various compilation fixes for MSVC.
John W. Eaton <jwe@octave.org>
parents:
7789
diff
changeset
|
314 return powf (a, b); \ |
4953 | 315 } |
4952 | 316 |
4905 | 317 #define OCTAVE_SS_INT_OPS(TYPE) \ |
318 OCTAVE_S_INT_UNOPS (TYPE) \ | |
4952 | 319 OCTAVE_SS_POW_OPS (TYPE, TYPE) \ |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
320 OCTAVE_SS_INT_ARITH_OPS (ss, TYPE ## _, TYPE ## _, TYPE) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
321 OCTAVE_SS_INT_ARITH_OPS (ssx, TYPE ## _, , TYPE) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
322 OCTAVE_SS_INT_ARITH_OPS (sxs, , TYPE ## _, TYPE) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
323 OCTAVE_SS_INT_ARITH_OPS (ssfx, TYPE ## _, float_, TYPE) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
324 OCTAVE_SS_INT_ARITH_OPS (sfxs, float_, TYPE ## _, TYPE) \ |
4953 | 325 OCTAVE_SS_INT_CMP_OPS (ss, TYPE ## _, TYPE ## _) \ |
326 OCTAVE_SS_INT_CMP_OPS (sx, TYPE ## _, ) \ | |
327 OCTAVE_SS_INT_CMP_OPS (xs, , TYPE ## _) \ | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
328 OCTAVE_SS_INT_CMP_OPS (sfx, TYPE ## _, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
329 OCTAVE_SS_INT_CMP_OPS (fxs, float_, TYPE ## _) \ |
5030 | 330 OCTAVE_SS_INT_BOOL_OPS (ss, TYPE ## _, TYPE ## _, octave_ ## TYPE (0), octave_ ## TYPE (0)) \ |
331 OCTAVE_SS_INT_BOOL_OPS (sx, TYPE ## _, , octave_ ## TYPE (0), 0) \ | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
332 OCTAVE_SS_INT_BOOL_OPS (xs, , TYPE ## _, 0, octave_ ## TYPE (0)) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
333 OCTAVE_SS_INT_BOOL_OPS (sfx, TYPE ## _, float_, octave_ ## TYPE (0), 0) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
334 OCTAVE_SS_INT_BOOL_OPS (fxs, float_, TYPE ## _, 0, octave_ ## TYPE (0)) |
4905 | 335 |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
336 #define OCTAVE_SM_INT_ARITH_OPS(PFX, TS, TM, TI) \ |
4905 | 337 /* scalar by matrix ops. */ \ |
338 \ | |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
339 DEFINTNDBINOP_OP (PFX ## _add, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, +, TI) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
340 DEFINTNDBINOP_OP (PFX ## _sub, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, -, TI) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
341 DEFINTNDBINOP_OP (PFX ## _mul, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, *, TI) \ |
4905 | 342 \ |
4953 | 343 /* DEFBINOP (PFX ## _div, TS ## scalar, TM ## matrix) */ \ |
4905 | 344 /* { */ \ |
4953 | 345 /* CAST_BINOP_ARGS (const octave_ ## TS ## scalar&, const octave_ ## TM ## matrix&); */ \ |
4905 | 346 /* */ \ |
4953 | 347 /* Matrix m1 = v1.TM ## matrix_value (); */ \ |
348 /* Matrix m2 = v2.TM ## matrix_value (); */ \ | |
4905 | 349 /* */ \ |
350 /* return octave_value (xdiv (m1, m2)); */ \ | |
351 /* } */ \ | |
352 \ | |
4953 | 353 /* DEFBINOP_FN (PFX ## _pow, TS ## scalar, TM ## matrix, xpow) */ \ |
354 \ | |
355 DEFBINOP (PFX ## _ldiv, TS ## scalar, TM ## matrix) \ | |
356 { \ | |
357 CAST_BINOP_ARGS (const octave_ ## TS ## scalar&, const octave_ ## TM ## matrix&); \ | |
4905 | 358 \ |
4953 | 359 if (! v1.TS ## scalar_value ()) \ |
360 gripe_divide_by_zero (); \ | |
4905 | 361 \ |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
362 octave_value retval = octave_value (v2.TS ## scalar_value () / v1.TS ## scalar_value ()); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
363 if (octave_ ## TI ::get_math_trunc_flag ()) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
364 gripe_binop_integer_math_truncated ("\\", v1.type_name (). c_str (), \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
365 v2.type_name (). c_str ()); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
366 octave_ ## TI ::clear_conv_flag (); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
367 return retval; \ |
4953 | 368 } \ |
369 \ | |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
370 DEFINTNDBINOP_OP (PFX ## _el_mul, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, *, TI) \ |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
371 DEFBINOP (PFX ## _el_div, TS ## scalar, TM ## matrix) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
372 { \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
373 CAST_BINOP_ARGS (const octave_ ## TS ## scalar&, const octave_ ## TM ## matrix&); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
374 \ |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
375 octave_value retval = octave_value (v1.TS ## scalar_value () / v2.TM ## array_value ()); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
376 if (octave_ ## TI ::get_math_trunc_flag ()) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
377 gripe_binop_integer_math_truncated (".\\", v1.type_name (). c_str (), \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
378 v2.type_name (). c_str ()); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
379 octave_ ## TI ::clear_conv_flag (); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
380 return retval; \ |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
381 } \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
382 \ |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
383 DEFINTNDBINOP_FN (PFX ## _el_pow, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, elem_xpow, TI, .^) \ |
4905 | 384 \ |
4953 | 385 DEFBINOP (PFX ## _el_ldiv, TS ## scalar, TM ## matrix) \ |
386 { \ | |
387 CAST_BINOP_ARGS (const octave_ ## TS ## scalar&, const octave_ ## TM ## matrix&); \ | |
388 \ | |
389 if (! v1.TS ## scalar_value ()) \ | |
390 gripe_divide_by_zero (); \ | |
391 \ | |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
392 octave_value retval = octave_value (v2.TM ## array_value () / v1.TS ## scalar_value ()); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
393 if (octave_ ## TI ::get_math_trunc_flag ()) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
394 gripe_binop_integer_math_truncated (".\\", v1.type_name (). c_str (), \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
395 v2.type_name (). c_str ()); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
396 octave_ ## TI ::clear_conv_flag (); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
397 return retval; \ |
4953 | 398 } |
4905 | 399 |
4953 | 400 #define OCTAVE_SM_INT_CMP_OPS(PFX, TS, TM) \ |
401 DEFNDBINOP_FN (PFX ## _lt, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, mx_el_lt) \ | |
402 DEFNDBINOP_FN (PFX ## _le, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, mx_el_le) \ | |
403 DEFNDBINOP_FN (PFX ## _eq, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, mx_el_eq) \ | |
404 DEFNDBINOP_FN (PFX ## _ge, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, mx_el_ge) \ | |
405 DEFNDBINOP_FN (PFX ## _gt, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, mx_el_gt) \ | |
406 DEFNDBINOP_FN (PFX ## _ne, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, mx_el_ne) | |
4905 | 407 |
4953 | 408 #define OCTAVE_SM_INT_BOOL_OPS(PFX, TS, TM) \ |
4964 | 409 DEFNDBINOP_FN (PFX ## _el_and, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, mx_el_and) \ |
410 DEFNDBINOP_FN (PFX ## _el_or, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, mx_el_or) | |
4905 | 411 |
4952 | 412 #define OCTAVE_SM_POW_OPS(T1, T2) \ |
4953 | 413 octave_value \ |
414 elem_xpow (const octave_ ## T1& a, const T2 ## NDArray& b) \ | |
415 { \ | |
416 T2 ## NDArray result (b.dims ()); \ | |
417 for (int i = 0; i < b.length (); i++) \ | |
418 { \ | |
419 OCTAVE_QUIT; \ | |
420 result (i) = pow (a, b(i)); \ | |
421 } \ | |
422 return octave_value (result); \ | |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
423 } \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
424 \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
425 octave_value \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
426 elem_xpow (const octave_ ## T1& a, const NDArray& b) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
427 { \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
428 T1 ## NDArray result (b.dims ()); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
429 for (int i = 0; i < b.length (); i++) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
430 { \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
431 OCTAVE_QUIT; \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
432 result (i) = pow (a, b(i)); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
433 } \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
434 return octave_value (result); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
435 } \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
436 \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
437 octave_value \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
438 elem_xpow (double a, const T2 ## NDArray& b) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
439 { \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
440 T2 ## NDArray result (b.dims ()); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
441 for (int i = 0; i < b.length (); i++) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
442 { \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
443 OCTAVE_QUIT; \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
444 result (i) = pow (a, b(i)); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
445 } \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
446 return octave_value (result); \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
447 } \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
448 \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
449 octave_value \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
450 elem_xpow (const octave_ ## T1& a, const FloatNDArray& b) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
451 { \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
452 T1 ## NDArray result (b.dims ()); \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
453 for (int i = 0; i < b.length (); i++) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
454 { \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
455 OCTAVE_QUIT; \ |
7914
e998e81224b5
Various compilation fixes for MSVC.
John W. Eaton <jwe@octave.org>
parents:
7789
diff
changeset
|
456 result (i) = powf (a, b(i)); \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
457 } \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
458 return octave_value (result); \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
459 } \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
460 \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
461 octave_value \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
462 elem_xpow (float a, const T2 ## NDArray& b) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
463 { \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
464 T2 ## NDArray result (b.dims ()); \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
465 for (int i = 0; i < b.length (); i++) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
466 { \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
467 OCTAVE_QUIT; \ |
7914
e998e81224b5
Various compilation fixes for MSVC.
John W. Eaton <jwe@octave.org>
parents:
7789
diff
changeset
|
468 result (i) = powf (a, b(i)); \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
469 } \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
470 return octave_value (result); \ |
4953 | 471 } |
4952 | 472 |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
473 |
4963 | 474 #define OCTAVE_SM_CONV(TS, TM) \ |
475 DEFCONV (TS ## s_ ## TM ## m_conv, TM ## scalar, TM ## matrix) \ | |
476 { \ | |
477 CAST_CONV_ARG (const octave_ ## TS ## scalar&); \ | |
478 \ | |
479 return new octave_ ## TM ## matrix (v.TM ## array_value ()); \ | |
480 } | |
481 | |
4905 | 482 #define OCTAVE_SM_INT_OPS(TYPE) \ |
4952 | 483 OCTAVE_SM_POW_OPS (TYPE, TYPE) \ |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
484 OCTAVE_SM_INT_ARITH_OPS (sm, TYPE ## _, TYPE ## _, TYPE) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
485 OCTAVE_SM_INT_ARITH_OPS (smx, TYPE ## _, , TYPE) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
486 OCTAVE_SM_INT_ARITH_OPS (sxm, , TYPE ## _, TYPE) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
487 OCTAVE_SM_INT_ARITH_OPS (smfx, TYPE ## _, float_, TYPE) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
488 OCTAVE_SM_INT_ARITH_OPS (sfxm, float_, TYPE ## _, TYPE) \ |
4953 | 489 OCTAVE_SM_INT_CMP_OPS (sm, TYPE ## _, TYPE ## _) \ |
490 OCTAVE_SM_INT_CMP_OPS (xm, , TYPE ## _) \ | |
4964 | 491 OCTAVE_SM_INT_CMP_OPS (smx, TYPE ## _, ) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
492 OCTAVE_SM_INT_CMP_OPS (fxm, float_, TYPE ## _) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
493 OCTAVE_SM_INT_CMP_OPS (smfx, TYPE ## _, float_) \ |
4953 | 494 OCTAVE_SM_INT_BOOL_OPS (sm, TYPE ## _, TYPE ## _) \ |
495 OCTAVE_SM_INT_BOOL_OPS (xm, , TYPE ## _) \ | |
4964 | 496 OCTAVE_SM_INT_BOOL_OPS (smx, TYPE ## _, ) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
497 OCTAVE_SM_INT_BOOL_OPS (fxm, float_, TYPE ## _) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
498 OCTAVE_SM_INT_BOOL_OPS (smfx, TYPE ## _, float_) \ |
4963 | 499 OCTAVE_SM_CONV (TYPE ## _, TYPE ## _) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
500 OCTAVE_SM_CONV (TYPE ## _, complex_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
501 OCTAVE_SM_CONV (TYPE ## _, float_complex_) |
4905 | 502 |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
503 #define OCTAVE_MS_INT_ARITH_OPS(PFX, TM, TS, TI) \ |
4905 | 504 /* matrix by scalar ops. */ \ |
505 \ | |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
506 DEFINTNDBINOP_OP (PFX ## _add, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, +, TI) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
507 DEFINTNDBINOP_OP (PFX ## _sub, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, -, TI) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
508 DEFINTNDBINOP_OP (PFX ## _mul, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, *, TI) \ |
4953 | 509 \ |
510 DEFBINOP (PFX ## _div, TM ## matrix, TS ## scalar) \ | |
511 { \ | |
512 CAST_BINOP_ARGS (const octave_ ## TM ## matrix&, const octave_ ## TS ## scalar&); \ | |
4905 | 513 \ |
4953 | 514 if (! v2.TS ## scalar_value ()) \ |
515 gripe_divide_by_zero (); \ | |
516 \ | |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
517 octave_value retval = octave_value (v1.TM ## array_value () / v2.TS ## scalar_value ()); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
518 if (octave_ ## TI ::get_math_trunc_flag ()) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
519 gripe_binop_integer_math_truncated ("/", v1.type_name (). c_str (), \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
520 v2.type_name (). c_str ()); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
521 octave_ ## TI ::clear_conv_flag (); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
522 return retval; \ |
4953 | 523 } \ |
524 \ | |
525 /* DEFBINOP_FN (PFX ## _pow, TM ## matrix, TS ## scalar, xpow) */ \ | |
526 \ | |
527 /* DEFBINOP (PFX ## _ldiv, TM ## matrix, TS ## scalar) */ \ | |
4905 | 528 /* { */ \ |
4953 | 529 /* CAST_BINOP_ARGS (const octave_ ## TM ## matrix&, const octave_ ## TS ## scalar&); */ \ |
4905 | 530 /* */ \ |
4953 | 531 /* Matrix m1 = v1.TM ## matrix_value (); */ \ |
532 /* Matrix m2 = v2.TM ## matrix_value (); */ \ | |
4905 | 533 /* */ \ |
534 /* return octave_value (xleftdiv (m1, m2)); */ \ | |
535 /* } */ \ | |
536 \ | |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
537 DEFINTNDBINOP_OP (PFX ## _el_mul, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, *, TI) \ |
4953 | 538 \ |
539 DEFBINOP (PFX ## _el_div, TM ## matrix, TS ## scalar) \ | |
540 { \ | |
541 CAST_BINOP_ARGS (const octave_ ## TM ## matrix&, const octave_ ## TS ## scalar&); \ | |
4905 | 542 \ |
4953 | 543 if (! v2.TS ## scalar_value ()) \ |
544 gripe_divide_by_zero (); \ | |
545 \ | |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
546 octave_value retval = octave_value (v1.TM ## array_value () / v2.TS ## scalar_value ()); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
547 if (octave_ ## TI ::get_math_trunc_flag ()) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
548 gripe_binop_integer_math_truncated ("./", v1.type_name (). c_str (), \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
549 v2.type_name (). c_str ()); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
550 octave_ ## TI ::clear_conv_flag (); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
551 return retval; \ |
4953 | 552 } \ |
553 \ | |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
554 DEFINTNDBINOP_FN (PFX ## _el_pow, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, elem_xpow, TI, .^) \ |
4953 | 555 \ |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
556 DEFBINOP (PFX ## _el_ldiv, TM ## matrix, TS ## scalar) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
557 { \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
558 CAST_BINOP_ARGS (const octave_ ## TM ## matrix&, const octave_ ## TS ## scalar&); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
559 \ |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
560 octave_value retval = v2.TS ## scalar_value () / v1.TM ## array_value (); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
561 if (octave_ ## TI ::get_math_trunc_flag ()) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
562 gripe_binop_integer_math_truncated (".^", v1.type_name (). c_str (), \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
563 v2.type_name (). c_str ()); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
564 octave_ ## TI ::clear_conv_flag (); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
565 return retval; \ |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
566 } |
4905 | 567 |
4953 | 568 #define OCTAVE_MS_INT_CMP_OPS(PFX, TM, TS) \ |
569 DEFNDBINOP_FN (PFX ## _lt, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, mx_el_lt) \ | |
570 DEFNDBINOP_FN (PFX ## _le, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, mx_el_le) \ | |
571 DEFNDBINOP_FN (PFX ## _eq, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, mx_el_eq) \ | |
572 DEFNDBINOP_FN (PFX ## _ge, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, mx_el_ge) \ | |
573 DEFNDBINOP_FN (PFX ## _gt, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, mx_el_gt) \ | |
4964 | 574 DEFNDBINOP_FN (PFX ## _ne, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, mx_el_ne) |
4905 | 575 |
4953 | 576 #define OCTAVE_MS_INT_BOOL_OPS(PFX, TM, TS) \ |
4964 | 577 DEFNDBINOP_FN (PFX ## _el_and, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, mx_el_and) \ |
578 DEFNDBINOP_FN (PFX ## _el_or, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, mx_el_or) | |
4905 | 579 |
4953 | 580 #define OCTAVE_MS_INT_ASSIGN_OPS(PFX, TM, TS, TE) \ |
581 DEFNDASSIGNOP_FN (PFX ## _assign, TM ## matrix, TS ## scalar, TE ## array, assign) | |
4905 | 582 |
4952 | 583 #define OCTAVE_MS_POW_OPS(T1, T2) \ |
584 octave_value elem_xpow (T1 ## NDArray a, octave_ ## T2 b) \ | |
585 { \ | |
586 T1 ## NDArray result (a.dims ()); \ | |
587 for (int i = 0; i < a.length (); i++) \ | |
588 { \ | |
589 OCTAVE_QUIT; \ | |
590 result (i) = pow (a(i), b); \ | |
591 } \ | |
592 return octave_value (result); \ | |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
593 } \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
594 \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
595 octave_value elem_xpow (T1 ## NDArray a, double b) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
596 { \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
597 T1 ## NDArray result (a.dims ()); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
598 for (int i = 0; i < a.length (); i++) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
599 { \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
600 OCTAVE_QUIT; \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
601 result (i) = pow (a(i), b); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
602 } \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
603 return octave_value (result); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
604 } \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
605 \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
606 octave_value elem_xpow (NDArray a, octave_ ## T2 b) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
607 { \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
608 T2 ## NDArray result (a.dims ()); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
609 for (int i = 0; i < a.length (); i++) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
610 { \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
611 OCTAVE_QUIT; \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
612 result (i) = pow (a(i), b); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
613 } \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
614 return octave_value (result); \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
615 } \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
616 \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
617 octave_value elem_xpow (T1 ## NDArray a, float b) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
618 { \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
619 T1 ## NDArray result (a.dims ()); \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
620 for (int i = 0; i < a.length (); i++) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
621 { \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
622 OCTAVE_QUIT; \ |
7914
e998e81224b5
Various compilation fixes for MSVC.
John W. Eaton <jwe@octave.org>
parents:
7789
diff
changeset
|
623 result (i) = powf (a(i), b); \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
624 } \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
625 return octave_value (result); \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
626 } \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
627 \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
628 octave_value elem_xpow (FloatNDArray a, octave_ ## T2 b) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
629 { \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
630 T2 ## NDArray result (a.dims ()); \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
631 for (int i = 0; i < a.length (); i++) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
632 { \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
633 OCTAVE_QUIT; \ |
7914
e998e81224b5
Various compilation fixes for MSVC.
John W. Eaton <jwe@octave.org>
parents:
7789
diff
changeset
|
634 result (i) = powf (a(i), b); \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
635 } \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
636 return octave_value (result); \ |
4952 | 637 } |
638 | |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
639 |
4905 | 640 #define OCTAVE_MS_INT_OPS(TYPE) \ |
4952 | 641 OCTAVE_MS_POW_OPS (TYPE, TYPE) \ |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
642 OCTAVE_MS_INT_ARITH_OPS (ms, TYPE ## _, TYPE ## _, TYPE) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
643 OCTAVE_MS_INT_ARITH_OPS (msx, TYPE ## _, , TYPE) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
644 OCTAVE_MS_INT_ARITH_OPS (mxs, , TYPE ## _, TYPE) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
645 OCTAVE_MS_INT_ARITH_OPS (msfx, TYPE ## _, float_, TYPE) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
646 OCTAVE_MS_INT_ARITH_OPS (mfxs, float_, TYPE ## _, TYPE) \ |
4953 | 647 OCTAVE_MS_INT_CMP_OPS (ms, TYPE ## _, TYPE ## _) \ |
648 OCTAVE_MS_INT_CMP_OPS (mx, TYPE ## _, ) \ | |
4964 | 649 OCTAVE_MS_INT_CMP_OPS (mxs, , TYPE ## _) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
650 OCTAVE_MS_INT_CMP_OPS (mfx, TYPE ## _, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
651 OCTAVE_MS_INT_CMP_OPS (mfxs, float_, TYPE ## _) \ |
4953 | 652 OCTAVE_MS_INT_BOOL_OPS (ms, TYPE ## _, TYPE ## _) \ |
653 OCTAVE_MS_INT_BOOL_OPS (mx, TYPE ## _, ) \ | |
4964 | 654 OCTAVE_MS_INT_BOOL_OPS (mxs, , TYPE ## _) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
655 OCTAVE_MS_INT_BOOL_OPS (mfx, TYPE ## _, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
656 OCTAVE_MS_INT_BOOL_OPS (mfxs, float_, TYPE ## _) \ |
4953 | 657 OCTAVE_MS_INT_ASSIGN_OPS (ms, TYPE ## _, TYPE ## _, TYPE ## _) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
658 OCTAVE_MS_INT_ASSIGN_OPS (mx, TYPE ## _, , ) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
659 OCTAVE_MS_INT_ASSIGN_OPS (mfx, TYPE ## _, float_, float_) |
4905 | 660 |
661 #define OCTAVE_M_INT_UNOPS(TYPE) \ | |
662 /* matrix unary ops. */ \ | |
663 \ | |
664 DEFNDUNOP_OP (m_not, TYPE ## _matrix, TYPE ## _array, !) \ | |
4965 | 665 DEFNDUNOP_OP (m_uplus, TYPE ## _matrix, TYPE ## _array, /* no-op */) \ |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
666 DEFUNOP (m_uminus, TYPE ## _matrix) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
667 { \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
668 CAST_UNOP_ARG (const octave_ ## TYPE ## _matrix &); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
669 octave_value retval = octave_value (- v. TYPE ## _array_value ()); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
670 if (octave_ ## TYPE ::get_math_trunc_flag ()) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
671 gripe_unop_integer_math_truncated ("-", v.type_name (). c_str ()); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
672 octave_ ## TYPE ::clear_conv_flag (); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
673 return retval; \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
674 } \ |
4905 | 675 \ |
676 DEFUNOP (m_transpose, TYPE ## _matrix) \ | |
677 { \ | |
678 CAST_UNOP_ARG (const octave_ ## TYPE ## _matrix&); \ | |
679 \ | |
680 if (v.ndims () > 2) \ | |
681 { \ | |
682 error ("transpose not defined for N-d objects"); \ | |
683 return octave_value (); \ | |
684 } \ | |
685 else \ | |
686 return octave_value (v.TYPE ## _array_value().transpose ()); \ | |
687 } \ | |
688 \ | |
5829 | 689 DEFNCUNOP_METHOD (m_incr, TYPE ## _matrix, increment) \ |
690 DEFNCUNOP_METHOD (m_decr, TYPE ## _matrix, decrement) | |
4905 | 691 |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
692 #define OCTAVE_MM_INT_ARITH_OPS(PFX, T1, T2, T3) \ |
4905 | 693 /* matrix by matrix ops. */ \ |
694 \ | |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
695 DEFINTNDBINOP_OP (PFX ## _add, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, +, T3) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
696 DEFINTNDBINOP_OP (PFX ## _sub, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, -, T3) \ |
4905 | 697 \ |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
698 /* DEFBINOP_OP (PFX ## _mul, T1 ## matrix, T2 ## matrix, *) */ \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
699 /* DEFBINOP_FN (PFX ## _div, T1 ## matrix, T2 ## matrix, xdiv) */ \ |
4905 | 700 \ |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
701 DEFBINOPX (PFX ## _pow, T1 ## matrix, T2 ## matrix) \ |
4905 | 702 { \ |
703 error ("can't do A ^ B for A and B both matrices"); \ | |
704 return octave_value (); \ | |
705 } \ | |
706 \ | |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
707 /* DEFBINOP_FN (PFX ## _ldiv, T1 ## matrix, T2 ## matrix, xleftdiv) */ \ |
4905 | 708 \ |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
709 DEFINTNDBINOP_FN (PFX ## _el_mul, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, product, T3, .*) \ |
4905 | 710 \ |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
711 DEFINTNDBINOP_FN (PFX ## _el_div, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, quotient, T3, ./) \ |
4905 | 712 \ |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
713 DEFINTNDBINOP_FN (PFX ## _el_pow, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, elem_xpow, T3, .^) \ |
4905 | 714 \ |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
715 DEFBINOP (PFX ## _el_ldiv, T1 ## matrix, T2 ## matrix) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
716 { \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
717 CAST_BINOP_ARGS (const octave_ ## T1 ## matrix&, const octave_ ## T2 ## matrix&); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
718 \ |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
719 octave_value retval = octave_value (quotient (v2.T2 ## array_value (), v1.T1 ## array_value ())); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
720 if (octave_ ## T3 ::get_math_trunc_flag ()) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
721 gripe_binop_integer_math_truncated (".\\", v1.type_name (). c_str (), \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
722 v2.type_name (). c_str ()); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
723 octave_ ## T3 ::clear_conv_flag (); \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
724 return retval; \ |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
725 } |
4905 | 726 |
4964 | 727 #define OCTAVE_MM_INT_CMP_OPS(PFX, T1, T2) \ |
728 DEFNDBINOP_FN (PFX ## _lt, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_lt) \ | |
729 DEFNDBINOP_FN (PFX ## _le, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_le) \ | |
730 DEFNDBINOP_FN (PFX ## _eq, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_eq) \ | |
731 DEFNDBINOP_FN (PFX ## _ge, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_ge) \ | |
732 DEFNDBINOP_FN (PFX ## _gt, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_gt) \ | |
733 DEFNDBINOP_FN (PFX ## _ne, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_ne) | |
4905 | 734 |
4964 | 735 #define OCTAVE_MM_INT_BOOL_OPS(PFX, T1, T2) \ |
736 DEFNDBINOP_FN (PFX ## _el_and, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_and) \ | |
737 DEFNDBINOP_FN (PFX ## _el_or, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_or) | |
4905 | 738 |
4953 | 739 #define OCTAVE_MM_INT_ASSIGN_OPS(PFX, TLHS, TRHS, TE) \ |
740 DEFNDASSIGNOP_FN (PFX ## _assign, TLHS ## matrix, TRHS ## matrix, TE ## array, assign) | |
4905 | 741 |
4952 | 742 #define OCTAVE_MM_POW_OPS(T1, T2) \ |
4953 | 743 octave_value \ |
744 elem_xpow (const T1 ## NDArray& a, const T2 ## NDArray& b) \ | |
745 { \ | |
746 dim_vector a_dims = a.dims (); \ | |
747 dim_vector b_dims = b.dims (); \ | |
748 if (a_dims != b_dims) \ | |
749 { \ | |
750 gripe_nonconformant ("operator .^", a_dims, b_dims); \ | |
751 return octave_value (); \ | |
752 } \ | |
753 T1 ## NDArray result (a_dims); \ | |
754 for (int i = 0; i < a.length (); i++) \ | |
755 { \ | |
756 OCTAVE_QUIT; \ | |
757 result (i) = pow (a(i), b(i)); \ | |
758 } \ | |
759 return octave_value (result); \ | |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
760 } \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
761 \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
762 octave_value \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
763 elem_xpow (const T1 ## NDArray& a, const NDArray& b) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
764 { \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
765 dim_vector a_dims = a.dims (); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
766 dim_vector b_dims = b.dims (); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
767 if (a_dims != b_dims) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
768 { \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
769 gripe_nonconformant ("operator .^", a_dims, b_dims); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
770 return octave_value (); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
771 } \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
772 T1 ## NDArray result (a_dims); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
773 for (int i = 0; i < a.length (); i++) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
774 { \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
775 OCTAVE_QUIT; \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
776 result (i) = pow (a(i), b(i)); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
777 } \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
778 return octave_value (result); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
779 } \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
780 \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
781 octave_value \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
782 elem_xpow (const NDArray& a, const T2 ## NDArray& b) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
783 { \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
784 dim_vector a_dims = a.dims (); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
785 dim_vector b_dims = b.dims (); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
786 if (a_dims != b_dims) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
787 { \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
788 gripe_nonconformant ("operator .^", a_dims, b_dims); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
789 return octave_value (); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
790 } \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
791 T2 ## NDArray result (a_dims); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
792 for (int i = 0; i < a.length (); i++) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
793 { \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
794 OCTAVE_QUIT; \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
795 result (i) = pow (a(i), b(i)); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
796 } \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
797 return octave_value (result); \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
798 } \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
799 \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
800 octave_value \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
801 elem_xpow (const T1 ## NDArray& a, const FloatNDArray& b) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
802 { \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
803 dim_vector a_dims = a.dims (); \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
804 dim_vector b_dims = b.dims (); \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
805 if (a_dims != b_dims) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
806 { \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
807 gripe_nonconformant ("operator .^", a_dims, b_dims); \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
808 return octave_value (); \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
809 } \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
810 T1 ## NDArray result (a_dims); \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
811 for (int i = 0; i < a.length (); i++) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
812 { \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
813 OCTAVE_QUIT; \ |
7914
e998e81224b5
Various compilation fixes for MSVC.
John W. Eaton <jwe@octave.org>
parents:
7789
diff
changeset
|
814 result (i) = powf (a(i), b(i)); \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
815 } \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
816 return octave_value (result); \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
817 } \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
818 \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
819 octave_value \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
820 elem_xpow (const FloatNDArray& a, const T2 ## NDArray& b) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
821 { \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
822 dim_vector a_dims = a.dims (); \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
823 dim_vector b_dims = b.dims (); \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
824 if (a_dims != b_dims) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
825 { \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
826 gripe_nonconformant ("operator .^", a_dims, b_dims); \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
827 return octave_value (); \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
828 } \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
829 T2 ## NDArray result (a_dims); \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
830 for (int i = 0; i < a.length (); i++) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
831 { \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
832 OCTAVE_QUIT; \ |
7914
e998e81224b5
Various compilation fixes for MSVC.
John W. Eaton <jwe@octave.org>
parents:
7789
diff
changeset
|
833 result (i) = powf (a(i), b(i)); \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
834 } \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
835 return octave_value (result); \ |
4953 | 836 } |
4952 | 837 |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
838 |
4964 | 839 #define OCTAVE_MM_CONV(T1, T2) \ |
840 DEFCONV (T1 ## m_ ## T2 ## m_conv, T1 ## matrix, T2 ## matrix) \ | |
841 { \ | |
842 CAST_CONV_ARG (const octave_ ## T1 ## matrix&); \ | |
843 \ | |
844 return new octave_ ## T2 ## matrix (v.T2 ## array_value ()); \ | |
845 } | |
846 | |
4905 | 847 #define OCTAVE_MM_INT_OPS(TYPE) \ |
848 OCTAVE_M_INT_UNOPS (TYPE) \ | |
4952 | 849 OCTAVE_MM_POW_OPS (TYPE, TYPE) \ |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
850 OCTAVE_MM_INT_ARITH_OPS (mm, TYPE ## _, TYPE ## _, TYPE) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
851 OCTAVE_MM_INT_ARITH_OPS (mmx, TYPE ## _, , TYPE) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
852 OCTAVE_MM_INT_ARITH_OPS (mxm, , TYPE ## _, TYPE) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
853 OCTAVE_MM_INT_ARITH_OPS (mmfx, TYPE ## _, float_, TYPE) \ |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7914
diff
changeset
|
854 OCTAVE_MM_INT_ARITH_OPS (mfxm, float_, TYPE ## _, TYPE) \ |
4964 | 855 OCTAVE_MM_INT_CMP_OPS (mm, TYPE ## _, TYPE ## _) \ |
856 OCTAVE_MM_INT_CMP_OPS (mmx, TYPE ## _, ) \ | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
857 OCTAVE_MM_INT_CMP_OPS (mfxm, float_, TYPE ## _) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
858 OCTAVE_MM_INT_CMP_OPS (mmfx, TYPE ## _, float_) \ |
5038 | 859 OCTAVE_MM_INT_CMP_OPS (mxm, , TYPE ## _) \ |
4964 | 860 OCTAVE_MM_INT_BOOL_OPS (mm, TYPE ## _, TYPE ## _) \ |
861 OCTAVE_MM_INT_BOOL_OPS (mmx, TYPE ## _, ) \ | |
5038 | 862 OCTAVE_MM_INT_BOOL_OPS (mxm, , TYPE ## _) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
863 OCTAVE_MM_INT_BOOL_OPS (mmfx, TYPE ## _, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
864 OCTAVE_MM_INT_BOOL_OPS (mfxm, float_, TYPE ## _) \ |
4953 | 865 OCTAVE_MM_INT_ASSIGN_OPS (mm, TYPE ## _, TYPE ## _, TYPE ## _) \ |
4964 | 866 OCTAVE_MM_INT_ASSIGN_OPS (mmx, TYPE ## _, , ) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
867 OCTAVE_MM_INT_ASSIGN_OPS (mmfx, TYPE ## _, float_, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
868 OCTAVE_MM_CONV(TYPE ## _, complex_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
869 OCTAVE_MM_CONV(TYPE ## _, float_complex_) |
4905 | 870 |
4963 | 871 #define OCTAVE_RE_INT_ASSIGN_OPS(TYPE) \ |
872 DEFNDASSIGNOP_FN (TYPE ## ms_assign, matrix, TYPE ## _scalar, array, assign) \ | |
873 DEFNDASSIGNOP_FN (TYPE ## mm_assign, matrix, TYPE ## _matrix, array, assign) | |
874 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
875 #define OCTAVE_FLT_RE_INT_ASSIGN_OPS(TYPE) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
876 DEFNDASSIGNOP_FN (TYPE ## fms_assign, float_matrix, TYPE ## _scalar, float_array, assign) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
877 DEFNDASSIGNOP_FN (TYPE ## fmm_assign, float_matrix, TYPE ## _matrix, float_array, assign) |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
878 |
4963 | 879 #define OCTAVE_CX_INT_ASSIGN_OPS(TYPE) \ |
880 DEFNDASSIGNOP_FN (TYPE ## cms_assign, complex_matrix, TYPE ## _scalar, complex_array, assign) \ | |
881 DEFNDASSIGNOP_FN (TYPE ## cmm_assign, complex_matrix, TYPE ## _matrix, complex_array, assign) | |
882 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
883 #define OCTAVE_FLT_CX_INT_ASSIGN_OPS(TYPE) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
884 DEFNDASSIGNOP_FN (TYPE ## fcms_assign, float_complex_matrix, TYPE ## _scalar, float_complex_array, assign) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
885 DEFNDASSIGNOP_FN (TYPE ## fcmm_assign, float_complex_matrix, TYPE ## _matrix, float_complex_array, assign) |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
886 |
8150
283989f2da9b
make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
8039
diff
changeset
|
887 #define OCTAVE_INT_NULL_ASSIGN_OPS(TYPE) \ |
283989f2da9b
make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
8039
diff
changeset
|
888 DEFNULLASSIGNOP_FN (TYPE ## null_assign, TYPE ## _matrix, delete_elements) |
283989f2da9b
make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
8039
diff
changeset
|
889 |
4905 | 890 #define OCTAVE_INT_OPS(TYPE) \ |
891 OCTAVE_SS_INT_OPS (TYPE) \ | |
892 OCTAVE_SM_INT_OPS (TYPE) \ | |
893 OCTAVE_MS_INT_OPS (TYPE) \ | |
4915 | 894 OCTAVE_MM_INT_OPS (TYPE) \ |
4963 | 895 OCTAVE_CONCAT_FN (TYPE) \ |
896 OCTAVE_RE_INT_ASSIGN_OPS (TYPE) \ | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
897 OCTAVE_FLT_RE_INT_ASSIGN_OPS (TYPE) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
898 OCTAVE_CX_INT_ASSIGN_OPS (TYPE) \ |
8150
283989f2da9b
make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
8039
diff
changeset
|
899 OCTAVE_FLT_CX_INT_ASSIGN_OPS (TYPE) \ |
283989f2da9b
make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
8039
diff
changeset
|
900 OCTAVE_INT_NULL_ASSIGN_OPS(TYPE) |
4905 | 901 |
902 #define OCTAVE_INSTALL_S_INT_UNOPS(TYPE) \ | |
903 INSTALL_UNOP (op_not, octave_ ## TYPE ## _scalar, s_not); \ | |
4965 | 904 INSTALL_UNOP (op_uplus, octave_ ## TYPE ## _scalar, s_uplus); \ |
4905 | 905 INSTALL_UNOP (op_uminus, octave_ ## TYPE ## _scalar, s_uminus); \ |
906 INSTALL_UNOP (op_transpose, octave_ ## TYPE ## _scalar, s_transpose); \ | |
907 INSTALL_UNOP (op_hermitian, octave_ ## TYPE ## _scalar, s_hermitian); \ | |
908 \ | |
5829 | 909 INSTALL_NCUNOP (op_incr, octave_ ## TYPE ## _scalar, s_incr); \ |
910 INSTALL_NCUNOP (op_decr, octave_ ## TYPE ## _scalar, s_decr); | |
4905 | 911 |
4953 | 912 #define OCTAVE_INSTALL_SS_INT_ARITH_OPS(PFX, T1, T2) \ |
913 INSTALL_BINOP (op_add, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _add); \ | |
914 INSTALL_BINOP (op_sub, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _sub); \ | |
915 INSTALL_BINOP (op_mul, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _mul); \ | |
916 INSTALL_BINOP (op_div, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _div); \ | |
917 INSTALL_BINOP (op_pow, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _pow); \ | |
918 INSTALL_BINOP (op_ldiv, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _ldiv); \ | |
919 INSTALL_BINOP (op_el_mul, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _el_mul); \ | |
920 INSTALL_BINOP (op_el_div, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _el_div); \ | |
921 INSTALL_BINOP (op_el_pow, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _el_pow); \ | |
922 INSTALL_BINOP (op_el_ldiv, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _el_ldiv); | |
4905 | 923 |
4953 | 924 #define OCTAVE_INSTALL_SS_INT_CMP_OPS(PFX, T1, T2) \ |
925 INSTALL_BINOP (op_lt, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _lt); \ | |
926 INSTALL_BINOP (op_le, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _le); \ | |
927 INSTALL_BINOP (op_eq, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _eq); \ | |
928 INSTALL_BINOP (op_ge, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _ge); \ | |
929 INSTALL_BINOP (op_gt, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _gt); \ | |
930 INSTALL_BINOP (op_ne, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _ne); | |
4905 | 931 |
4953 | 932 #define OCTAVE_INSTALL_SS_INT_BOOL_OPS(PFX, T1, T2) \ |
4964 | 933 INSTALL_BINOP (op_el_and, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _el_and); \ |
934 INSTALL_BINOP (op_el_or, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _el_or); | |
4905 | 935 |
936 #define OCTAVE_INSTALL_SS_INT_OPS(TYPE) \ | |
937 OCTAVE_INSTALL_S_INT_UNOPS (TYPE) \ | |
4953 | 938 OCTAVE_INSTALL_SS_INT_ARITH_OPS (ss, TYPE ## _, TYPE ## _) \ |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
939 OCTAVE_INSTALL_SS_INT_ARITH_OPS (ssx, TYPE ## _, ) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
940 OCTAVE_INSTALL_SS_INT_ARITH_OPS (sxs, , TYPE ## _) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
941 OCTAVE_INSTALL_SS_INT_ARITH_OPS (ssfx, TYPE ## _, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
942 OCTAVE_INSTALL_SS_INT_ARITH_OPS (sfxs, float_, TYPE ## _) \ |
4953 | 943 OCTAVE_INSTALL_SS_INT_CMP_OPS (ss, TYPE ## _, TYPE ## _) \ |
944 OCTAVE_INSTALL_SS_INT_CMP_OPS (sx, TYPE ## _, ) \ | |
945 OCTAVE_INSTALL_SS_INT_CMP_OPS (xs, , TYPE ## _) \ | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
946 OCTAVE_INSTALL_SS_INT_CMP_OPS (sfx, TYPE ## _, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
947 OCTAVE_INSTALL_SS_INT_CMP_OPS (fxs, float_, TYPE ## _) \ |
4953 | 948 OCTAVE_INSTALL_SS_INT_BOOL_OPS (ss, TYPE ## _, TYPE ## _) \ |
949 OCTAVE_INSTALL_SS_INT_BOOL_OPS (sx, TYPE ## _, ) \ | |
950 OCTAVE_INSTALL_SS_INT_BOOL_OPS (xs, , TYPE ## _) \ | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
951 OCTAVE_INSTALL_SS_INT_BOOL_OPS (sfx, TYPE ## _, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
952 OCTAVE_INSTALL_SS_INT_BOOL_OPS (fxs, float_, TYPE ## _) \ |
4963 | 953 INSTALL_ASSIGNCONV (octave_ ## TYPE ## _scalar, octave_ ## TYPE ## _scalar, octave_ ## TYPE ## _matrix) \ |
954 INSTALL_ASSIGNCONV (octave_ ## TYPE ## _scalar, octave_scalar, octave_ ## TYPE ## _matrix) \ | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
955 INSTALL_ASSIGNCONV (octave_ ## TYPE ## _scalar, octave_float_scalar, octave_ ## TYPE ## _matrix) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
956 INSTALL_ASSIGNCONV (octave_ ## TYPE ## _scalar, octave_complex_scalar, octave_complex_matrix) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
957 INSTALL_ASSIGNCONV (octave_ ## TYPE ## _scalar, octave_float_complex_scalar, octave_float_complex_matrix) |
4905 | 958 |
4953 | 959 #define OCTAVE_INSTALL_SM_INT_ARITH_OPS(PFX, T1, T2) \ |
960 INSTALL_BINOP (op_add, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _add); \ | |
961 INSTALL_BINOP (op_sub, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _sub); \ | |
962 INSTALL_BINOP (op_mul, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _mul); \ | |
963 /* INSTALL_BINOP (op_div, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _div); */ \ | |
964 /* INSTALL_BINOP (op_pow, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _pow); */ \ | |
965 INSTALL_BINOP (op_ldiv, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _ldiv); \ | |
966 INSTALL_BINOP (op_el_mul, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _el_mul); \ | |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
967 INSTALL_BINOP (op_el_div, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _el_div); \ |
4953 | 968 INSTALL_BINOP (op_el_pow, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _el_pow); \ |
969 INSTALL_BINOP (op_el_ldiv, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _el_ldiv); | |
4905 | 970 |
4953 | 971 #define OCTAVE_INSTALL_SM_INT_CMP_OPS(PFX, T1, T2) \ |
972 INSTALL_BINOP (op_lt, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _lt); \ | |
973 INSTALL_BINOP (op_le, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _le); \ | |
974 INSTALL_BINOP (op_eq, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _eq); \ | |
975 INSTALL_BINOP (op_ge, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _ge); \ | |
976 INSTALL_BINOP (op_gt, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _gt); \ | |
977 INSTALL_BINOP (op_ne, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _ne); | |
4905 | 978 |
4953 | 979 #define OCTAVE_INSTALL_SM_INT_BOOL_OPS(PFX, T1, T2) \ |
4964 | 980 INSTALL_BINOP (op_el_and, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _el_and); \ |
981 INSTALL_BINOP (op_el_or, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _el_or); | |
4905 | 982 |
983 #define OCTAVE_INSTALL_SM_INT_OPS(TYPE) \ | |
4953 | 984 OCTAVE_INSTALL_SM_INT_ARITH_OPS (sm, TYPE ## _, TYPE ## _) \ |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
985 OCTAVE_INSTALL_SM_INT_ARITH_OPS (smx, TYPE ## _, ) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
986 OCTAVE_INSTALL_SM_INT_ARITH_OPS (sxm, , TYPE ## _) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
987 OCTAVE_INSTALL_SM_INT_ARITH_OPS (smfx, TYPE ## _, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
988 OCTAVE_INSTALL_SM_INT_ARITH_OPS (sfxm, float_, TYPE ## _) \ |
4953 | 989 OCTAVE_INSTALL_SM_INT_CMP_OPS (sm, TYPE ## _, TYPE ## _) \ |
990 OCTAVE_INSTALL_SM_INT_CMP_OPS (xm, , TYPE ## _) \ | |
4964 | 991 OCTAVE_INSTALL_SM_INT_CMP_OPS (smx, TYPE ## _, ) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
992 OCTAVE_INSTALL_SM_INT_CMP_OPS (fxm, float_, TYPE ## _) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
993 OCTAVE_INSTALL_SM_INT_CMP_OPS (smfx, TYPE ## _, float_) \ |
4953 | 994 OCTAVE_INSTALL_SM_INT_BOOL_OPS (sm, TYPE ## _, TYPE ## _) \ |
995 OCTAVE_INSTALL_SM_INT_BOOL_OPS (xm, , TYPE ## _) \ | |
4964 | 996 OCTAVE_INSTALL_SM_INT_BOOL_OPS (smx, TYPE ## _, ) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
997 OCTAVE_INSTALL_SM_INT_BOOL_OPS (fxm, float_, TYPE ## _) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
998 OCTAVE_INSTALL_SM_INT_BOOL_OPS (smfx, TYPE ## _, float_) \ |
4964 | 999 INSTALL_WIDENOP (octave_ ## TYPE ## _scalar, octave_ ## TYPE ## _matrix, TYPE ## _s_ ## TYPE ## _m_conv) \ |
1000 INSTALL_WIDENOP (octave_ ## TYPE ## _scalar, octave_complex_matrix, TYPE ## _s_complex_m_conv) \ | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1001 INSTALL_WIDENOP (octave_ ## TYPE ## _scalar, octave_float_complex_matrix, TYPE ## _s_float_complex_m_conv) \ |
4963 | 1002 INSTALL_ASSIGNCONV (octave_ ## TYPE ## _scalar, octave_ ## TYPE ## _matrix, octave_ ## TYPE ## _matrix) \ |
1003 INSTALL_ASSIGNCONV (octave_ ## TYPE ## _scalar, octave_matrix, octave_ ## TYPE ## _matrix) \ | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1004 INSTALL_ASSIGNCONV (octave_ ## TYPE ## _scalar, octave_float_matrix, octave_ ## TYPE ## _matrix) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1005 INSTALL_ASSIGNCONV (octave_ ## TYPE ## _scalar, octave_complex_matrix, octave_complex_matrix) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1006 INSTALL_ASSIGNCONV (octave_ ## TYPE ## _scalar, octave_float_complex_matrix, octave_float_complex_matrix) |
4905 | 1007 |
4953 | 1008 #define OCTAVE_INSTALL_MS_INT_ARITH_OPS(PFX, T1, T2) \ |
1009 INSTALL_BINOP (op_add, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _add); \ | |
1010 INSTALL_BINOP (op_sub, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _sub); \ | |
1011 INSTALL_BINOP (op_mul, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _mul); \ | |
1012 INSTALL_BINOP (op_div, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _div); \ | |
1013 /* INSTALL_BINOP (op_pow, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _pow); */ \ | |
1014 /* INSTALL_BINOP (op_ldiv, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _ldiv); */ \ | |
4905 | 1015 \ |
4953 | 1016 INSTALL_BINOP (op_el_mul, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _el_mul); \ |
1017 INSTALL_BINOP (op_el_div, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _el_div); \ | |
1018 INSTALL_BINOP (op_el_pow, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _el_pow); \ | |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
1019 INSTALL_BINOP (op_el_ldiv, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _el_ldiv); |
4905 | 1020 |
4953 | 1021 #define OCTAVE_INSTALL_MS_INT_CMP_OPS(PFX, T1, T2) \ |
1022 INSTALL_BINOP (op_lt, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _lt); \ | |
1023 INSTALL_BINOP (op_le, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _le); \ | |
1024 INSTALL_BINOP (op_eq, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _eq); \ | |
1025 INSTALL_BINOP (op_ge, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _ge); \ | |
1026 INSTALL_BINOP (op_gt, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _gt); \ | |
1027 INSTALL_BINOP (op_ne, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _ne); | |
1028 | |
1029 #define OCTAVE_INSTALL_MS_INT_BOOL_OPS(PFX, T1, T2) \ | |
4964 | 1030 INSTALL_BINOP (op_el_and, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _el_and); \ |
1031 INSTALL_BINOP (op_el_or, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _el_or); | |
4953 | 1032 |
1033 #define OCTAVE_INSTALL_MS_INT_ASSIGN_OPS(PFX, TLHS, TRHS) \ | |
1034 INSTALL_ASSIGNOP (op_asn_eq, octave_ ## TLHS ## matrix, octave_ ## TRHS ## scalar, PFX ## _assign) | |
4905 | 1035 |
1036 #define OCTAVE_INSTALL_MS_INT_OPS(TYPE) \ | |
4953 | 1037 OCTAVE_INSTALL_MS_INT_ARITH_OPS (ms, TYPE ## _, TYPE ## _) \ |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
1038 OCTAVE_INSTALL_MS_INT_ARITH_OPS (msx, TYPE ## _, ) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
1039 OCTAVE_INSTALL_MS_INT_ARITH_OPS (mxs, , TYPE ## _) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1040 OCTAVE_INSTALL_MS_INT_ARITH_OPS (msfx, TYPE ## _, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1041 OCTAVE_INSTALL_MS_INT_ARITH_OPS (mfxs, float_, TYPE ## _) \ |
4953 | 1042 OCTAVE_INSTALL_MS_INT_CMP_OPS (ms, TYPE ## _, TYPE ## _) \ |
1043 OCTAVE_INSTALL_MS_INT_CMP_OPS (mx, TYPE ## _, ) \ | |
4964 | 1044 OCTAVE_INSTALL_MS_INT_CMP_OPS (mxs, , TYPE ## _) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1045 OCTAVE_INSTALL_MS_INT_CMP_OPS (mfx, TYPE ## _, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1046 OCTAVE_INSTALL_MS_INT_CMP_OPS (mfxs, float_, TYPE ## _) \ |
4953 | 1047 OCTAVE_INSTALL_MS_INT_BOOL_OPS (ms, TYPE ## _, TYPE ## _) \ |
1048 OCTAVE_INSTALL_MS_INT_BOOL_OPS (mx, TYPE ## _, ) \ | |
4964 | 1049 OCTAVE_INSTALL_MS_INT_BOOL_OPS (mxs, , TYPE ## _) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1050 OCTAVE_INSTALL_MS_INT_BOOL_OPS (mfx, TYPE ## _, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1051 OCTAVE_INSTALL_MS_INT_BOOL_OPS (mfxs, float_, TYPE ## _) \ |
4953 | 1052 OCTAVE_INSTALL_MS_INT_ASSIGN_OPS (ms, TYPE ## _, TYPE ## _) \ |
1053 OCTAVE_INSTALL_MS_INT_ASSIGN_OPS (mx, TYPE ## _, ) \ | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1054 OCTAVE_INSTALL_MS_INT_ASSIGN_OPS (mfx, TYPE ## _, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1055 INSTALL_ASSIGNCONV (octave_ ## TYPE ## _matrix, octave_complex_scalar, octave_complex_matrix) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1056 INSTALL_ASSIGNCONV (octave_ ## TYPE ## _matrix, octave_float_complex_scalar, octave_float_complex_matrix) |
4905 | 1057 |
1058 #define OCTAVE_INSTALL_M_INT_UNOPS(TYPE) \ | |
1059 INSTALL_UNOP (op_not, octave_ ## TYPE ## _matrix, m_not); \ | |
4965 | 1060 INSTALL_UNOP (op_uplus, octave_ ## TYPE ## _matrix, m_uplus); \ |
4905 | 1061 INSTALL_UNOP (op_uminus, octave_ ## TYPE ## _matrix, m_uminus); \ |
1062 INSTALL_UNOP (op_transpose, octave_ ## TYPE ## _matrix, m_transpose); \ | |
1063 INSTALL_UNOP (op_hermitian, octave_ ## TYPE ## _matrix, m_transpose); \ | |
1064 \ | |
5829 | 1065 INSTALL_NCUNOP (op_incr, octave_ ## TYPE ## _matrix, m_incr); \ |
1066 INSTALL_NCUNOP (op_decr, octave_ ## TYPE ## _matrix, m_decr); | |
4905 | 1067 |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
1068 #define OCTAVE_INSTALL_MM_INT_ARITH_OPS(PFX, T1, T2) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
1069 INSTALL_BINOP (op_add, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _add); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
1070 INSTALL_BINOP (op_sub, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _sub); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
1071 /* INSTALL_BINOP (op_mul, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _mul); */ \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
1072 /* INSTALL_BINOP (op_div, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _div); */ \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
1073 INSTALL_BINOP (op_pow, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _pow); \ |
4905 | 1074 /* INSTALL_BINOP (op_ldiv, octave_ ## T1 ## _matrix, octave_ ## T2 ## _matrix, mm_ldiv); */ \ |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
1075 INSTALL_BINOP (op_el_mul, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _el_mul); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
1076 INSTALL_BINOP (op_el_div, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _el_div); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
1077 INSTALL_BINOP (op_el_pow, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _el_pow); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
1078 INSTALL_BINOP (op_el_ldiv, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _el_ldiv); |
4905 | 1079 |
4964 | 1080 #define OCTAVE_INSTALL_MM_INT_CMP_OPS(PFX, T1, T2) \ |
1081 INSTALL_BINOP (op_lt, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _lt); \ | |
1082 INSTALL_BINOP (op_le, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _le); \ | |
1083 INSTALL_BINOP (op_eq, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _eq); \ | |
1084 INSTALL_BINOP (op_ge, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _ge); \ | |
1085 INSTALL_BINOP (op_gt, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _gt); \ | |
1086 INSTALL_BINOP (op_ne, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _ne); | |
4905 | 1087 |
4964 | 1088 #define OCTAVE_INSTALL_MM_INT_BOOL_OPS(PFX, T1, T2) \ |
1089 INSTALL_BINOP (op_el_and, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _el_and); \ | |
1090 INSTALL_BINOP (op_el_or, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _el_or); | |
4905 | 1091 |
4953 | 1092 #define OCTAVE_INSTALL_MM_INT_ASSIGN_OPS(PFX, TLHS, TRHS) \ |
1093 INSTALL_ASSIGNOP (op_asn_eq, octave_ ## TLHS ## matrix, octave_ ## TRHS ## matrix, PFX ## _assign) | |
4905 | 1094 |
1095 #define OCTAVE_INSTALL_MM_INT_OPS(TYPE) \ | |
1096 OCTAVE_INSTALL_M_INT_UNOPS (TYPE) \ | |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
1097 OCTAVE_INSTALL_MM_INT_ARITH_OPS (mm, TYPE ##_, TYPE ## _) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
1098 OCTAVE_INSTALL_MM_INT_ARITH_OPS (mmx, TYPE ##_, ) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
1099 OCTAVE_INSTALL_MM_INT_ARITH_OPS (mxm, , TYPE ##_) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1100 OCTAVE_INSTALL_MM_INT_ARITH_OPS (mmfx, TYPE ##_, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1101 OCTAVE_INSTALL_MM_INT_ARITH_OPS (mfxm, float_, TYPE ##_) \ |
4964 | 1102 OCTAVE_INSTALL_MM_INT_CMP_OPS (mm, TYPE ## _, TYPE ## _) \ |
1103 OCTAVE_INSTALL_MM_INT_CMP_OPS (mmx, TYPE ## _, ) \ | |
5038 | 1104 OCTAVE_INSTALL_MM_INT_CMP_OPS (mxm, , TYPE ## _) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1105 OCTAVE_INSTALL_MM_INT_CMP_OPS (mmfx, TYPE ## _, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1106 OCTAVE_INSTALL_MM_INT_CMP_OPS (mfxm, float_, TYPE ## _) \ |
4964 | 1107 OCTAVE_INSTALL_MM_INT_BOOL_OPS (mm, TYPE ## _, TYPE ## _) \ |
1108 OCTAVE_INSTALL_MM_INT_BOOL_OPS (mmx, TYPE ## _, ) \ | |
5038 | 1109 OCTAVE_INSTALL_MM_INT_BOOL_OPS (mxm, , TYPE ## _) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1110 OCTAVE_INSTALL_MM_INT_BOOL_OPS (mmfx, TYPE ## _, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1111 OCTAVE_INSTALL_MM_INT_BOOL_OPS (mfxm, float_, TYPE ## _) \ |
4953 | 1112 OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mm, TYPE ## _, TYPE ## _) \ |
1113 OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmx, TYPE ## _, ) \ | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1114 OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmfx, TYPE ## _, float_) \ |
4964 | 1115 INSTALL_WIDENOP (octave_ ## TYPE ## _matrix, octave_complex_matrix, TYPE ## _m_complex_m_conv) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1116 INSTALL_WIDENOP (octave_ ## TYPE ## _matrix, octave_float_complex_matrix, TYPE ## _m_float_complex_m_conv) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1117 INSTALL_ASSIGNCONV (octave_ ## TYPE ## _matrix, octave_complex_matrix, octave_complex_matrix) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1118 INSTALL_ASSIGNCONV (octave_ ## TYPE ## _matrix, octave_float_complex_matrix, octave_float_complex_matrix) |
4905 | 1119 |
4963 | 1120 #define OCTAVE_INSTALL_RE_INT_ASSIGN_OPS(TYPE) \ |
1121 INSTALL_ASSIGNOP (op_asn_eq, octave_matrix, octave_ ## TYPE ## _scalar, TYPE ## ms_assign) \ | |
1122 INSTALL_ASSIGNOP (op_asn_eq, octave_matrix, octave_ ## TYPE ## _matrix, TYPE ## mm_assign) \ | |
1123 INSTALL_ASSIGNCONV (octave_scalar, octave_ ## TYPE ## _scalar, octave_matrix) \ | |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
1124 INSTALL_ASSIGNCONV (octave_matrix, octave_ ## TYPE ## _matrix, octave_matrix) |
4963 | 1125 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1126 #define OCTAVE_INSTALL_FLT_RE_INT_ASSIGN_OPS(TYPE) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1127 INSTALL_ASSIGNOP (op_asn_eq, octave_float_matrix, octave_ ## TYPE ## _scalar, TYPE ## fms_assign) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1128 INSTALL_ASSIGNOP (op_asn_eq, octave_float_matrix, octave_ ## TYPE ## _matrix, TYPE ## fmm_assign) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1129 INSTALL_ASSIGNCONV (octave_float_scalar, octave_ ## TYPE ## _scalar, octave_float_matrix) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1130 INSTALL_ASSIGNCONV (octave_float_matrix, octave_ ## TYPE ## _matrix, octave_float_matrix) |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1131 |
4963 | 1132 #define OCTAVE_INSTALL_CX_INT_ASSIGN_OPS(TYPE) \ |
1133 INSTALL_ASSIGNOP (op_asn_eq, octave_complex_matrix, octave_ ## TYPE ## _scalar, TYPE ## cms_assign) \ | |
1134 INSTALL_ASSIGNOP (op_asn_eq, octave_complex_matrix, octave_ ## TYPE ## _matrix, TYPE ## cmm_assign) \ | |
1135 INSTALL_ASSIGNCONV (octave_complex_scalar, octave_ ## TYPE ## _scalar, octave_complex_matrix) \ | |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
1136 INSTALL_ASSIGNCONV (octave_complex_matrix, octave_ ## TYPE ## _matrix, octave_complex_matrix) |
4963 | 1137 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1138 #define OCTAVE_INSTALL_FLT_CX_INT_ASSIGN_OPS(TYPE) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1139 INSTALL_ASSIGNOP (op_asn_eq, octave_float_complex_matrix, octave_ ## TYPE ## _scalar, TYPE ## fcms_assign) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1140 INSTALL_ASSIGNOP (op_asn_eq, octave_float_complex_matrix, octave_ ## TYPE ## _matrix, TYPE ## fcmm_assign) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1141 INSTALL_ASSIGNCONV (octave_float_complex_scalar, octave_ ## TYPE ## _scalar, octave_complex_matrix) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1142 INSTALL_ASSIGNCONV (octave_float_complex_matrix, octave_ ## TYPE ## _matrix, octave_complex_matrix) |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1143 |
8150
283989f2da9b
make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
8039
diff
changeset
|
1144 #define OCTAVE_INSTALL_INT_NULL_ASSIGN_OPS(TYPE) \ |
283989f2da9b
make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
8039
diff
changeset
|
1145 INSTALL_ASSIGNOP (op_asn_eq, octave_ ## TYPE ## _matrix, octave_null_matrix, TYPE ## null_assign) \ |
283989f2da9b
make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
8039
diff
changeset
|
1146 INSTALL_ASSIGNOP (op_asn_eq, octave_ ## TYPE ## _matrix, octave_null_str, TYPE ## null_assign) \ |
283989f2da9b
make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
8039
diff
changeset
|
1147 INSTALL_ASSIGNOP (op_asn_eq, octave_ ## TYPE ## _matrix, octave_null_sq_str, TYPE ## null_assign) |
283989f2da9b
make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
8039
diff
changeset
|
1148 |
4905 | 1149 #define OCTAVE_INSTALL_INT_OPS(TYPE) \ |
1150 OCTAVE_INSTALL_SS_INT_OPS (TYPE) \ | |
1151 OCTAVE_INSTALL_SM_INT_OPS (TYPE) \ | |
1152 OCTAVE_INSTALL_MS_INT_OPS (TYPE) \ | |
4915 | 1153 OCTAVE_INSTALL_MM_INT_OPS (TYPE) \ |
4963 | 1154 OCTAVE_INSTALL_CONCAT_FN (TYPE) \ |
1155 OCTAVE_INSTALL_RE_INT_ASSIGN_OPS (TYPE) \ | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1156 OCTAVE_INSTALL_FLT_RE_INT_ASSIGN_OPS (TYPE) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1157 OCTAVE_INSTALL_CX_INT_ASSIGN_OPS (TYPE) \ |
8150
283989f2da9b
make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
8039
diff
changeset
|
1158 OCTAVE_INSTALL_FLT_CX_INT_ASSIGN_OPS (TYPE) \ |
283989f2da9b
make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
8039
diff
changeset
|
1159 OCTAVE_INSTALL_INT_NULL_ASSIGN_OPS(TYPE) |
4963 | 1160 |
1161 #define OCTAVE_INSTALL_SM_INT_ASSIGNCONV(TLHS, TRHS) \ | |
1162 INSTALL_ASSIGNCONV (octave_ ## TLHS ## _scalar, octave_ ## TRHS ## _scalar, octave_ ## TLHS ## _matrix) \ | |
1163 INSTALL_ASSIGNCONV (octave_ ## TLHS ## _scalar, octave_ ## TRHS ## _matrix, octave_ ## TLHS ## _matrix) | |
4905 | 1164 |
4964 | 1165 #define OCTAVE_MIXED_INT_CMP_OPS(T1, T2) \ |
1166 OCTAVE_SS_INT_CMP_OPS (T1 ## _ ## T2 ## _ss, T1 ## _, T2 ## _) \ | |
1167 OCTAVE_SM_INT_CMP_OPS (T1 ## _ ## T2 ## _sm, T1 ## _, T2 ## _) \ | |
1168 OCTAVE_MS_INT_CMP_OPS (T1 ## _ ## T2 ## _ms, T1 ## _, T2 ## _) \ | |
1169 OCTAVE_MM_INT_CMP_OPS (T1 ## _ ## T2 ## _mm, T1 ## _, T2 ## _) | |
1170 | |
1171 #define OCTAVE_INSTALL_MIXED_INT_CMP_OPS(T1, T2) \ | |
1172 OCTAVE_INSTALL_SS_INT_CMP_OPS (T1 ## _ ## T2 ## _ss, T1 ## _, T2 ## _) \ | |
1173 OCTAVE_INSTALL_SM_INT_CMP_OPS (T1 ## _ ## T2 ## _sm, T1 ## _, T2 ## _) \ | |
1174 OCTAVE_INSTALL_MS_INT_CMP_OPS (T1 ## _ ## T2 ## _ms, T1 ## _, T2 ## _) \ | |
1175 OCTAVE_INSTALL_MM_INT_CMP_OPS (T1 ## _ ## T2 ## _mm, T1 ## _, T2 ## _) | |
1176 | |
4905 | 1177 /* |
1178 ;;; Local Variables: *** | |
1179 ;;; mode: C++ *** | |
1180 ;;; End: *** | |
1181 */ |