Mercurial > octave
comparison src/OPERATORS/op-scm-cm.cc @ 11586:12df7854fa7c
strip trailing whitespace from source files
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 20 Jan 2011 17:24:59 -0500 |
parents | fd0a3ac60b0e |
children | 72c96de7a403 |
comparison
equal
deleted
inserted
replaced
11585:1473d0cf86d2 | 11586:12df7854fa7c |
---|---|
46 | 46 |
47 DEFBINOP_OP (mul, sparse_complex_matrix, complex_matrix, *) | 47 DEFBINOP_OP (mul, sparse_complex_matrix, complex_matrix, *) |
48 | 48 |
49 DEFBINOP (div, sparse_complex_matrix, complex_matrix) | 49 DEFBINOP (div, sparse_complex_matrix, complex_matrix) |
50 { | 50 { |
51 CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, | 51 CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, |
52 const octave_complex_matrix&); | 52 const octave_complex_matrix&); |
53 MatrixType typ = v2.matrix_type (); | 53 MatrixType typ = v2.matrix_type (); |
54 | 54 |
55 ComplexMatrix ret = xdiv (v1.complex_matrix_value (), | 55 ComplexMatrix ret = xdiv (v1.complex_matrix_value (), |
56 v2.complex_matrix_value (), typ); | 56 v2.complex_matrix_value (), typ); |
57 | 57 |
58 v2.matrix_type (typ); | 58 v2.matrix_type (typ); |
59 return ret; | 59 return ret; |
60 } | 60 } |
80 } | 80 } |
81 else | 81 else |
82 { | 82 { |
83 MatrixType typ = v1.matrix_type (); | 83 MatrixType typ = v1.matrix_type (); |
84 | 84 |
85 ComplexMatrix ret = xleftdiv (v1.sparse_complex_matrix_value (), | 85 ComplexMatrix ret = xleftdiv (v1.sparse_complex_matrix_value (), |
86 v2.complex_matrix_value (), typ); | 86 v2.complex_matrix_value (), typ); |
87 | 87 |
88 v1.matrix_type (typ); | 88 v1.matrix_type (typ); |
89 return ret; | 89 return ret; |
90 } | 90 } |
103 DEFBINOP_FN (el_mul, sparse_complex_matrix, complex_matrix, product) | 103 DEFBINOP_FN (el_mul, sparse_complex_matrix, complex_matrix, product) |
104 DEFBINOP_FN (el_div, sparse_complex_matrix, complex_matrix, quotient) | 104 DEFBINOP_FN (el_div, sparse_complex_matrix, complex_matrix, quotient) |
105 | 105 |
106 DEFBINOP (el_pow, sparse_complex_matrix, complex_matrix) | 106 DEFBINOP (el_pow, sparse_complex_matrix, complex_matrix) |
107 { | 107 { |
108 CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, | 108 CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, |
109 const octave_complex_matrix&); | 109 const octave_complex_matrix&); |
110 | 110 |
111 return octave_value | 111 return octave_value |
112 (elem_xpow (v1.sparse_complex_matrix_value (), SparseComplexMatrix | 112 (elem_xpow (v1.sparse_complex_matrix_value (), SparseComplexMatrix |
113 (v2.complex_matrix_value ()))); | 113 (v2.complex_matrix_value ()))); |
114 } | 114 } |
115 | 115 |
116 DEFBINOP (el_ldiv, sparse_complex_matrix, matrix) | 116 DEFBINOP (el_ldiv, sparse_complex_matrix, matrix) |
117 { | 117 { |
118 CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, | 118 CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, |
119 const octave_complex_matrix&); | 119 const octave_complex_matrix&); |
120 | 120 |
121 return octave_value (quotient (v2.complex_matrix_value (), | 121 return octave_value (quotient (v2.complex_matrix_value (), |
122 v1.sparse_complex_matrix_value ())); | 122 v1.sparse_complex_matrix_value ())); |
123 } | 123 } |
124 | 124 |
125 DEFBINOP_FN (el_and, sparse_complex_matrix, complex_matrix, mx_el_and) | 125 DEFBINOP_FN (el_and, sparse_complex_matrix, complex_matrix, mx_el_and) |
126 DEFBINOP_FN (el_or, sparse_complex_matrix, complex_matrix, mx_el_or) | 126 DEFBINOP_FN (el_or, sparse_complex_matrix, complex_matrix, mx_el_or) |
127 | 127 |
128 DEFCATOP (scm_cm, sparse_complex_matrix, complex_matrix) | 128 DEFCATOP (scm_cm, sparse_complex_matrix, complex_matrix) |
129 { | 129 { |
130 CAST_BINOP_ARGS (octave_sparse_complex_matrix&, | 130 CAST_BINOP_ARGS (octave_sparse_complex_matrix&, |
131 const octave_complex_matrix&); | 131 const octave_complex_matrix&); |
132 SparseComplexMatrix tmp (v2.complex_matrix_value ()); | 132 SparseComplexMatrix tmp (v2.complex_matrix_value ()); |
133 return octave_value | 133 return octave_value |
134 (v1.sparse_complex_matrix_value (). concat (tmp, ra_idx)); | 134 (v1.sparse_complex_matrix_value (). concat (tmp, ra_idx)); |
135 } | 135 } |
145 } | 145 } |
146 | 146 |
147 void | 147 void |
148 install_scm_cm_ops (void) | 148 install_scm_cm_ops (void) |
149 { | 149 { |
150 INSTALL_BINOP (op_add, octave_sparse_complex_matrix, | 150 INSTALL_BINOP (op_add, octave_sparse_complex_matrix, |
151 octave_complex_matrix, add); | 151 octave_complex_matrix, add); |
152 INSTALL_BINOP (op_sub, octave_sparse_complex_matrix, | 152 INSTALL_BINOP (op_sub, octave_sparse_complex_matrix, |
153 octave_complex_matrix, sub); | 153 octave_complex_matrix, sub); |
154 INSTALL_BINOP (op_mul, octave_sparse_complex_matrix, | 154 INSTALL_BINOP (op_mul, octave_sparse_complex_matrix, |
155 octave_complex_matrix, mul); | 155 octave_complex_matrix, mul); |
156 INSTALL_BINOP (op_div, octave_sparse_complex_matrix, | 156 INSTALL_BINOP (op_div, octave_sparse_complex_matrix, |
157 octave_complex_matrix, div); | 157 octave_complex_matrix, div); |
158 INSTALL_BINOP (op_pow, octave_sparse_complex_matrix, | 158 INSTALL_BINOP (op_pow, octave_sparse_complex_matrix, |
159 octave_complex_matrix, pow); | 159 octave_complex_matrix, pow); |
160 INSTALL_BINOP (op_ldiv, octave_sparse_complex_matrix, | 160 INSTALL_BINOP (op_ldiv, octave_sparse_complex_matrix, |
161 octave_complex_matrix, ldiv); | 161 octave_complex_matrix, ldiv); |
162 INSTALL_BINOP (op_trans_mul, octave_sparse_complex_matrix, | 162 INSTALL_BINOP (op_trans_mul, octave_sparse_complex_matrix, |
163 octave_complex_matrix, trans_mul); | 163 octave_complex_matrix, trans_mul); |
164 INSTALL_BINOP (op_herm_mul, octave_sparse_complex_matrix, | 164 INSTALL_BINOP (op_herm_mul, octave_sparse_complex_matrix, |
165 octave_complex_matrix, herm_mul); | 165 octave_complex_matrix, herm_mul); |
166 INSTALL_BINOP (op_lt, octave_sparse_complex_matrix, | 166 INSTALL_BINOP (op_lt, octave_sparse_complex_matrix, |
167 octave_complex_matrix, lt); | 167 octave_complex_matrix, lt); |
168 INSTALL_BINOP (op_le, octave_sparse_complex_matrix, | 168 INSTALL_BINOP (op_le, octave_sparse_complex_matrix, |
169 octave_complex_matrix, le); | 169 octave_complex_matrix, le); |
170 INSTALL_BINOP (op_eq, octave_sparse_complex_matrix, | 170 INSTALL_BINOP (op_eq, octave_sparse_complex_matrix, |
171 octave_complex_matrix, eq); | 171 octave_complex_matrix, eq); |
172 INSTALL_BINOP (op_ge, octave_sparse_complex_matrix, | 172 INSTALL_BINOP (op_ge, octave_sparse_complex_matrix, |
173 octave_complex_matrix, ge); | 173 octave_complex_matrix, ge); |
174 INSTALL_BINOP (op_gt, octave_sparse_complex_matrix, | 174 INSTALL_BINOP (op_gt, octave_sparse_complex_matrix, |
175 octave_complex_matrix, gt); | 175 octave_complex_matrix, gt); |
176 INSTALL_BINOP (op_ne, octave_sparse_complex_matrix, | 176 INSTALL_BINOP (op_ne, octave_sparse_complex_matrix, |
177 octave_complex_matrix, ne); | 177 octave_complex_matrix, ne); |
178 INSTALL_BINOP (op_el_mul, octave_sparse_complex_matrix, | 178 INSTALL_BINOP (op_el_mul, octave_sparse_complex_matrix, |
179 octave_complex_matrix, el_mul); | 179 octave_complex_matrix, el_mul); |
180 INSTALL_BINOP (op_el_div, octave_sparse_complex_matrix, | 180 INSTALL_BINOP (op_el_div, octave_sparse_complex_matrix, |
181 octave_complex_matrix, el_div); | 181 octave_complex_matrix, el_div); |
182 INSTALL_BINOP (op_el_pow, octave_sparse_complex_matrix, | 182 INSTALL_BINOP (op_el_pow, octave_sparse_complex_matrix, |
183 octave_complex_matrix, el_pow); | 183 octave_complex_matrix, el_pow); |
184 INSTALL_BINOP (op_el_ldiv, octave_sparse_complex_matrix, | 184 INSTALL_BINOP (op_el_ldiv, octave_sparse_complex_matrix, |
185 octave_complex_matrix, el_ldiv); | 185 octave_complex_matrix, el_ldiv); |
186 INSTALL_BINOP (op_el_and, octave_sparse_complex_matrix, | 186 INSTALL_BINOP (op_el_and, octave_sparse_complex_matrix, |
187 octave_complex_matrix, el_and); | 187 octave_complex_matrix, el_and); |
188 INSTALL_BINOP (op_el_or, octave_sparse_complex_matrix, | 188 INSTALL_BINOP (op_el_or, octave_sparse_complex_matrix, |
189 octave_complex_matrix, el_or); | 189 octave_complex_matrix, el_or); |
190 | 190 |
191 INSTALL_CATOP (octave_sparse_complex_matrix, | 191 INSTALL_CATOP (octave_sparse_complex_matrix, |
192 octave_complex_matrix, scm_cm); | 192 octave_complex_matrix, scm_cm); |
193 | 193 |
194 INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_complex_matrix, | 194 INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_complex_matrix, |
195 octave_complex_matrix, assign); | 195 octave_complex_matrix, assign); |
196 } | 196 } |