Mercurial > octave
comparison src/OPERATORS/op-cm-sm.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 |
---|---|
47 DEFBINOP_OP (mul, complex_matrix, sparse_matrix, *) | 47 DEFBINOP_OP (mul, complex_matrix, sparse_matrix, *) |
48 | 48 |
49 DEFBINOP (div, complex_matrix, sparse_matrix) | 49 DEFBINOP (div, complex_matrix, sparse_matrix) |
50 { | 50 { |
51 CAST_BINOP_ARGS (const octave_complex_matrix&, const octave_sparse_matrix&); | 51 CAST_BINOP_ARGS (const octave_complex_matrix&, const octave_sparse_matrix&); |
52 | 52 |
53 if (v2.rows() == 1 && v2.columns() == 1) | 53 if (v2.rows() == 1 && v2.columns() == 1) |
54 { | 54 { |
55 double d = v2.scalar_value (); | 55 double d = v2.scalar_value (); |
56 | 56 |
57 if (d == 0.0) | 57 if (d == 0.0) |
61 } | 61 } |
62 else | 62 else |
63 { | 63 { |
64 MatrixType typ = v2.matrix_type (); | 64 MatrixType typ = v2.matrix_type (); |
65 | 65 |
66 ComplexMatrix ret = xdiv (v1.complex_matrix_value (), | 66 ComplexMatrix ret = xdiv (v1.complex_matrix_value (), |
67 v2.sparse_matrix_value (), typ); | 67 v2.sparse_matrix_value (), typ); |
68 | 68 |
69 v2.matrix_type (typ); | 69 v2.matrix_type (typ); |
70 return ret; | 70 return ret; |
71 } | 71 } |
77 return octave_value (); | 77 return octave_value (); |
78 } | 78 } |
79 | 79 |
80 DEFBINOP (ldiv, complex_matrix, sparse_matrix) | 80 DEFBINOP (ldiv, complex_matrix, sparse_matrix) |
81 { | 81 { |
82 CAST_BINOP_ARGS (const octave_complex_matrix&, | 82 CAST_BINOP_ARGS (const octave_complex_matrix&, |
83 const octave_sparse_matrix&); | 83 const octave_sparse_matrix&); |
84 MatrixType typ = v1.matrix_type (); | 84 MatrixType typ = v1.matrix_type (); |
85 | 85 |
86 ComplexMatrix ret = xleftdiv (v1.complex_matrix_value (), | 86 ComplexMatrix ret = xleftdiv (v1.complex_matrix_value (), |
87 v2.matrix_value (), typ); | 87 v2.matrix_value (), typ); |
88 | 88 |
89 v1.matrix_type (typ); | 89 v1.matrix_type (typ); |
90 return ret; | 90 return ret; |
91 } | 91 } |
100 DEFBINOP_FN (el_mul, complex_matrix, sparse_matrix, product) | 100 DEFBINOP_FN (el_mul, complex_matrix, sparse_matrix, product) |
101 DEFBINOP_FN (el_div, complex_matrix, sparse_matrix, quotient) | 101 DEFBINOP_FN (el_div, complex_matrix, sparse_matrix, quotient) |
102 | 102 |
103 DEFBINOP (el_pow, complex_matrix, sparse_matrix) | 103 DEFBINOP (el_pow, complex_matrix, sparse_matrix) |
104 { | 104 { |
105 CAST_BINOP_ARGS (const octave_complex_matrix&, | 105 CAST_BINOP_ARGS (const octave_complex_matrix&, |
106 const octave_sparse_matrix&); | 106 const octave_sparse_matrix&); |
107 | 107 |
108 return octave_value | 108 return octave_value |
109 (elem_xpow ( SparseComplexMatrix (v1.complex_matrix_value ()), | 109 (elem_xpow ( SparseComplexMatrix (v1.complex_matrix_value ()), |
110 v2.sparse_matrix_value ())); | 110 v2.sparse_matrix_value ())); |
111 } | 111 } |
112 | 112 |
113 DEFBINOP (el_ldiv, complex_matrix, sparse_matrix) | 113 DEFBINOP (el_ldiv, complex_matrix, sparse_matrix) |
114 { | 114 { |
115 CAST_BINOP_ARGS (const octave_complex_matrix&, | 115 CAST_BINOP_ARGS (const octave_complex_matrix&, |
116 const octave_sparse_matrix&); | 116 const octave_sparse_matrix&); |
117 return octave_value | 117 return octave_value |
118 (quotient (v2.sparse_matrix_value (), v1.complex_matrix_value ())); | 118 (quotient (v2.sparse_matrix_value (), v1.complex_matrix_value ())); |
119 } | 119 } |
120 | 120 |
143 INSTALL_BINOP (op_le, octave_complex_matrix, octave_sparse_matrix, le); | 143 INSTALL_BINOP (op_le, octave_complex_matrix, octave_sparse_matrix, le); |
144 INSTALL_BINOP (op_eq, octave_complex_matrix, octave_sparse_matrix, eq); | 144 INSTALL_BINOP (op_eq, octave_complex_matrix, octave_sparse_matrix, eq); |
145 INSTALL_BINOP (op_ge, octave_complex_matrix, octave_sparse_matrix, ge); | 145 INSTALL_BINOP (op_ge, octave_complex_matrix, octave_sparse_matrix, ge); |
146 INSTALL_BINOP (op_gt, octave_complex_matrix, octave_sparse_matrix, gt); | 146 INSTALL_BINOP (op_gt, octave_complex_matrix, octave_sparse_matrix, gt); |
147 INSTALL_BINOP (op_ne, octave_complex_matrix, octave_sparse_matrix, ne); | 147 INSTALL_BINOP (op_ne, octave_complex_matrix, octave_sparse_matrix, ne); |
148 INSTALL_BINOP (op_el_mul, octave_complex_matrix, octave_sparse_matrix, | 148 INSTALL_BINOP (op_el_mul, octave_complex_matrix, octave_sparse_matrix, |
149 el_mul); | 149 el_mul); |
150 INSTALL_BINOP (op_el_div, octave_complex_matrix, octave_sparse_matrix, | 150 INSTALL_BINOP (op_el_div, octave_complex_matrix, octave_sparse_matrix, |
151 el_div); | 151 el_div); |
152 INSTALL_BINOP (op_el_pow, octave_complex_matrix, octave_sparse_matrix, | 152 INSTALL_BINOP (op_el_pow, octave_complex_matrix, octave_sparse_matrix, |
153 el_pow); | 153 el_pow); |
154 INSTALL_BINOP (op_el_ldiv, octave_complex_matrix, octave_sparse_matrix, | 154 INSTALL_BINOP (op_el_ldiv, octave_complex_matrix, octave_sparse_matrix, |
155 el_ldiv); | 155 el_ldiv); |
156 INSTALL_BINOP (op_el_and, octave_complex_matrix, octave_sparse_matrix, | 156 INSTALL_BINOP (op_el_and, octave_complex_matrix, octave_sparse_matrix, |
157 el_and); | 157 el_and); |
158 INSTALL_BINOP (op_el_or, octave_complex_matrix, octave_sparse_matrix, | 158 INSTALL_BINOP (op_el_or, octave_complex_matrix, octave_sparse_matrix, |
159 el_or); | 159 el_or); |
160 | 160 |
161 INSTALL_CATOP (octave_complex_matrix, octave_sparse_matrix, cm_sm); | 161 INSTALL_CATOP (octave_complex_matrix, octave_sparse_matrix, cm_sm); |
162 | 162 |
163 INSTALL_ASSIGNOP (op_asn_eq, octave_complex_matrix, octave_sparse_matrix, | 163 INSTALL_ASSIGNOP (op_asn_eq, octave_complex_matrix, octave_sparse_matrix, |
164 assign); | 164 assign); |
165 INSTALL_ASSIGNCONV (octave_complex_matrix, octave_sparse_matrix, | 165 INSTALL_ASSIGNCONV (octave_complex_matrix, octave_sparse_matrix, |
166 octave_complex_matrix) | 166 octave_complex_matrix) |
167 | 167 |
168 } | 168 } |