Mercurial > octave
comparison src/OPERATORS/op-m-scm.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 |
---|---|
62 } | 62 } |
63 else | 63 else |
64 { | 64 { |
65 MatrixType typ = v2.matrix_type (); | 65 MatrixType typ = v2.matrix_type (); |
66 | 66 |
67 ComplexMatrix ret = xdiv (v1.matrix_value (), | 67 ComplexMatrix ret = xdiv (v1.matrix_value (), |
68 v2.sparse_complex_matrix_value (), typ); | 68 v2.sparse_complex_matrix_value (), typ); |
69 | 69 |
70 v2.matrix_type (typ); | 70 v2.matrix_type (typ); |
71 return ret; | 71 return ret; |
72 } | 72 } |
78 return octave_value (); | 78 return octave_value (); |
79 } | 79 } |
80 | 80 |
81 DEFBINOP (ldiv, matrix, sparse_complex_matrix) | 81 DEFBINOP (ldiv, matrix, sparse_complex_matrix) |
82 { | 82 { |
83 CAST_BINOP_ARGS (const octave_matrix&, | 83 CAST_BINOP_ARGS (const octave_matrix&, |
84 const octave_sparse_complex_matrix&); | 84 const octave_sparse_complex_matrix&); |
85 MatrixType typ = v1.matrix_type (); | 85 MatrixType typ = v1.matrix_type (); |
86 | 86 |
87 ComplexMatrix ret = xleftdiv (v1.matrix_value (), | 87 ComplexMatrix ret = xleftdiv (v1.matrix_value (), |
88 v2.complex_matrix_value (), typ); | 88 v2.complex_matrix_value (), typ); |
89 | 89 |
90 v1.matrix_type (typ); | 90 v1.matrix_type (typ); |
91 return ret; | 91 return ret; |
92 } | 92 } |
101 DEFBINOP_FN (el_mul, matrix, sparse_complex_matrix, product) | 101 DEFBINOP_FN (el_mul, matrix, sparse_complex_matrix, product) |
102 DEFBINOP_FN (el_div, matrix, sparse_complex_matrix, quotient) | 102 DEFBINOP_FN (el_div, matrix, sparse_complex_matrix, quotient) |
103 | 103 |
104 DEFBINOP (el_pow, matrix, sparse_complex_matrix) | 104 DEFBINOP (el_pow, matrix, sparse_complex_matrix) |
105 { | 105 { |
106 CAST_BINOP_ARGS (const octave_matrix&, | 106 CAST_BINOP_ARGS (const octave_matrix&, |
107 const octave_sparse_complex_matrix&); | 107 const octave_sparse_complex_matrix&); |
108 | 108 |
109 return octave_value | 109 return octave_value |
110 (elem_xpow (SparseMatrix (v1.matrix_value ()), | 110 (elem_xpow (SparseMatrix (v1.matrix_value ()), |
111 v2.sparse_complex_matrix_value ())); | 111 v2.sparse_complex_matrix_value ())); |
112 } | 112 } |
113 | 113 |
114 DEFBINOP (el_ldiv, matrix, sparse_complex_matrix) | 114 DEFBINOP (el_ldiv, matrix, sparse_complex_matrix) |
115 { | 115 { |
116 CAST_BINOP_ARGS (const octave_matrix&, | 116 CAST_BINOP_ARGS (const octave_matrix&, |
117 const octave_sparse_complex_matrix&); | 117 const octave_sparse_complex_matrix&); |
118 return octave_value | 118 return octave_value |
119 (quotient (v2.sparse_complex_matrix_value (), v1.matrix_value ())); | 119 (quotient (v2.sparse_complex_matrix_value (), v1.matrix_value ())); |
120 } | 120 } |
121 | 121 |
122 DEFBINOP_FN (el_and, matrix, sparse_complex_matrix, mx_el_and) | 122 DEFBINOP_FN (el_and, matrix, sparse_complex_matrix, mx_el_and) |
123 DEFBINOP_FN (el_or, matrix, sparse_complex_matrix, mx_el_or) | 123 DEFBINOP_FN (el_or, matrix, sparse_complex_matrix, mx_el_or) |
124 | 124 |
125 DEFCATOP (m_scm, matrix, sparse_complex_matrix) | 125 DEFCATOP (m_scm, matrix, sparse_complex_matrix) |
126 { | 126 { |
127 CAST_BINOP_ARGS (octave_matrix&, const octave_sparse_complex_matrix&); | 127 CAST_BINOP_ARGS (octave_matrix&, const octave_sparse_complex_matrix&); |
128 SparseMatrix tmp (v1.matrix_value ()); | 128 SparseMatrix tmp (v1.matrix_value ()); |
129 return octave_value (tmp. concat (v2.sparse_complex_matrix_value (), | 129 return octave_value (tmp. concat (v2.sparse_complex_matrix_value (), |
130 ra_idx)); | 130 ra_idx)); |
131 } | 131 } |
132 | 132 |
133 DEFCONV (sparse_complex_matrix_conv, matrix, sparse_complex_matrix) | 133 DEFCONV (sparse_complex_matrix_conv, matrix, sparse_complex_matrix) |
134 { | 134 { |
135 CAST_CONV_ARG (const octave_matrix&); | 135 CAST_CONV_ARG (const octave_matrix&); |
136 return new octave_sparse_complex_matrix | 136 return new octave_sparse_complex_matrix |
137 (SparseComplexMatrix (v.complex_matrix_value ())); | 137 (SparseComplexMatrix (v.complex_matrix_value ())); |
138 } | 138 } |
139 | 139 |
140 void | 140 void |
141 install_m_scm_ops (void) | 141 install_m_scm_ops (void) |
150 INSTALL_BINOP (op_le, octave_matrix, octave_sparse_complex_matrix, le); | 150 INSTALL_BINOP (op_le, octave_matrix, octave_sparse_complex_matrix, le); |
151 INSTALL_BINOP (op_eq, octave_matrix, octave_sparse_complex_matrix, eq); | 151 INSTALL_BINOP (op_eq, octave_matrix, octave_sparse_complex_matrix, eq); |
152 INSTALL_BINOP (op_ge, octave_matrix, octave_sparse_complex_matrix, ge); | 152 INSTALL_BINOP (op_ge, octave_matrix, octave_sparse_complex_matrix, ge); |
153 INSTALL_BINOP (op_gt, octave_matrix, octave_sparse_complex_matrix, gt); | 153 INSTALL_BINOP (op_gt, octave_matrix, octave_sparse_complex_matrix, gt); |
154 INSTALL_BINOP (op_ne, octave_matrix, octave_sparse_complex_matrix, ne); | 154 INSTALL_BINOP (op_ne, octave_matrix, octave_sparse_complex_matrix, ne); |
155 INSTALL_BINOP (op_el_mul, octave_matrix, octave_sparse_complex_matrix, | 155 INSTALL_BINOP (op_el_mul, octave_matrix, octave_sparse_complex_matrix, |
156 el_mul); | 156 el_mul); |
157 INSTALL_BINOP (op_el_div, octave_matrix, octave_sparse_complex_matrix, | 157 INSTALL_BINOP (op_el_div, octave_matrix, octave_sparse_complex_matrix, |
158 el_div); | 158 el_div); |
159 INSTALL_BINOP (op_el_pow, octave_matrix, octave_sparse_complex_matrix, | 159 INSTALL_BINOP (op_el_pow, octave_matrix, octave_sparse_complex_matrix, |
160 el_pow); | 160 el_pow); |
161 INSTALL_BINOP (op_el_ldiv, octave_matrix, octave_sparse_complex_matrix, | 161 INSTALL_BINOP (op_el_ldiv, octave_matrix, octave_sparse_complex_matrix, |
162 el_ldiv); | 162 el_ldiv); |
163 INSTALL_BINOP (op_el_and, octave_matrix, octave_sparse_complex_matrix, | 163 INSTALL_BINOP (op_el_and, octave_matrix, octave_sparse_complex_matrix, |
164 el_and); | 164 el_and); |
165 INSTALL_BINOP (op_el_or, octave_matrix, octave_sparse_complex_matrix, | 165 INSTALL_BINOP (op_el_or, octave_matrix, octave_sparse_complex_matrix, |
166 el_or); | 166 el_or); |
167 | 167 |
168 INSTALL_CATOP (octave_matrix, octave_sparse_complex_matrix, m_scm); | 168 INSTALL_CATOP (octave_matrix, octave_sparse_complex_matrix, m_scm); |
169 | 169 |
170 INSTALL_ASSIGNCONV (octave_matrix, octave_sparse_complex_matrix, | 170 INSTALL_ASSIGNCONV (octave_matrix, octave_sparse_complex_matrix, |
171 octave_complex_matrix); | 171 octave_complex_matrix); |
172 | 172 |
173 INSTALL_WIDENOP (octave_matrix, octave_sparse_complex_matrix, | 173 INSTALL_WIDENOP (octave_matrix, octave_sparse_complex_matrix, |
174 sparse_complex_matrix_conv); | 174 sparse_complex_matrix_conv); |
175 } | 175 } |